13
1 sbdb: A Semi-Automated Bidirectional DeBugger Prasenjit Mitra Stanford University CS 343: Research Proposal

sbdb: A Semi-Automated Bidirectional DeBugger

  • Upload
    baakir

  • View
    32

  • Download
    5

Embed Size (px)

DESCRIPTION

sbdb: A Semi-Automated Bidirectional DeBugger. Prasenjit Mitra Stanford University CS 343: Research Proposal. Introduction. Debugging requires a lot of manual effort. Problem: Overshoot a bug - re-execute. Solution: Backtracking. Related Work. Execution History: - PowerPoint PPT Presentation

Citation preview

Page 1: sbdb: A Semi-Automated Bidirectional DeBugger

1

sbdb: A Semi-Automated Bidirectional DeBugger

Prasenjit MitraStanford University

CS 343: Research Proposal

Page 2: sbdb: A Semi-Automated Bidirectional DeBugger

2

Introduction

• Debugging requires a lot of manual effort.

• Problem: Overshoot a bug - re-execute.

• Solution: Backtracking.

Page 3: sbdb: A Semi-Automated Bidirectional DeBugger

3

Related Work

• Execution History:– Balzer, Spring Joint Comp. Conf., 1969.– Lieberman and Fry, Software Viz., 1998.– Agrawal, et al. IEEE Software, 1991.– Netzer and Weaver, PLDI, 1994 .

• Re-execution:– Tolmach and Appel, J. Func. Prog. 1993.– Bob Boothe, PLDI, 2000.

• Checkpointing

Page 4: sbdb: A Semi-Automated Bidirectional DeBugger

4

Execution History

• Step Counter:– number of steps from start of a program.

• Change-Set of a Statement:– registers, memory variables that change value

• Store:– Step counter, program counter, values of

variables in change-set.– Portion of stack while entering/exiting function.

Page 5: sbdb: A Semi-Automated Bidirectional DeBugger

5

Coarser Granularity

• Jump over loops.

• Statement-level to Basic-Block-level.

• Bb = {S1;S2}

• Cs(Bb) = Cs(S1) U Cs(S2) - DefinedIn( S1)

• Store <Var, Val> – where Val = Value of Var before S1

Page 6: sbdb: A Semi-Automated Bidirectional DeBugger

6

Exponential Thinning of Execution History Log

Per Stmt.Per 2Bb.

• For distant points, granularity of logs coarser.

• To jump within a Bb, rollback to start and then execute forward.

Per Bb.Per 4Bb.Per 8Bb.

Page 7: sbdb: A Semi-Automated Bidirectional DeBugger

7

Checkpoints

• Large number of backward steps - inefficient.

• Maintain checkpoints of program states at intermediate points.

• Fork the program and use the OS’ copy on write policy.

• Exponential thinning of checkpoints.

Page 8: sbdb: A Semi-Automated Bidirectional DeBugger

8

Hybrid Approach

• Move backward incrementally using execution history log.

• Move backward using coarse-grained log and then re-execute forward.

• Jump back to a checkpoint prior to program point and re-execute forward.

• Jump back to a checkpoint after program point and then use execution history log.

Page 9: sbdb: A Semi-Automated Bidirectional DeBugger

9

Operations

• bstep n - step n

• prev n - next n

• bcontinue - continue

• before - finish

• until <cond.> - buntil <cond.>

• undo

• prove <condition>

Page 10: sbdb: A Semi-Automated Bidirectional DeBugger

10

Comparisons

X X X XXXXX

O OOO

• Boothe

• History

• Checkpoints

Page 11: sbdb: A Semi-Automated Bidirectional DeBugger

11

Comparisons (contd.)

• + Less checkpointing interval.

• + Option to move forward or backward.

• - History logs

Page 12: sbdb: A Semi-Automated Bidirectional DeBugger

12

Conclusion

• Bidirectional Debugger.

• Hybrid approach involving– execution history logs– checkpoints

• Potential to analyze programs using stored program state.

Page 13: sbdb: A Semi-Automated Bidirectional DeBugger

13

And that will be…...

• A million dollars please…………

•Questions ???