URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a...
Transcript of URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a...
![Page 1: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/1.jpg)
URDB: A Universal Reversible Debugger Based onDecomposing Debugging Histories
Ana-Maria Visan Kapil Arya Gene CoopermanTyler Denniston
Northeastern University{amvisan,kapil,gene,tyler}@ccs.neu.edu
October 23, 2011
![Page 2: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/2.jpg)
Your Typical Debugging Session
Launch program −→ Fault −→ Bug
Why is it so frustrating and time consuming?
I Analyze the bug near the errorI Produce a hypothesis about the cause of the bugI Restart the program from the beginning
Wouldn’t it be great to be able to go backwards?
![Page 3: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/3.jpg)
Your Typical Debugging Session
Launch program −→ Fault −→ Bug
Why is it so frustrating and time consuming?
I Analyze the bug near the errorI Produce a hypothesis about the cause of the bugI Restart the program from the beginning
Wouldn’t it be great to be able to go backwards?
![Page 4: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/4.jpg)
Your Typical Debugging Session
Launch program −→ Fault −→ Bug
Why is it so frustrating and time consuming?
I Analyze the bug near the errorI Produce a hypothesis about the cause of the bugI Restart the program from the beginning
Wouldn’t it be great to be able to go backwards?
![Page 5: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/5.jpg)
Your Typical Debugging Session
Launch program −→ Fault −→ Bug
Why is it so frustrating and time consuming?
I Analyze the bug near the errorI Produce a hypothesis about the cause of the bugI Restart the program from the beginning
Wouldn’t it be great to be able to go backwards?
![Page 6: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/6.jpg)
Your Typical Debugging Session
Launch program −→ Fault −→ Bug
Why is it so frustrating and time consuming?
I Analyze the bug near the errorI Produce a hypothesis about the cause of the bugI Restart the program from the beginning
Wouldn’t it be great to be able to go backwards?
![Page 7: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/7.jpg)
Introducing URDB
URDB is a universal reversible debugger based on:I checkpointI restartI re-execution of debugging historiesI decomposing of debugging histories
![Page 8: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/8.jpg)
Introducing URDB
URDB is a universal reversible debugger based on:I checkpointI restartI re-execution of debugging historiesI decomposing of debugging histories
![Page 9: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/9.jpg)
Introducing URDB
URDB is a universal reversible debugger based on:I checkpointI restartI re-execution of debugging historiesI decomposing of debugging histories
![Page 10: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/10.jpg)
Introducing URDB
URDB is a universal reversible debugger based on:I checkpointI restartI re-execution of debugging historiesI decomposing of debugging histories
![Page 11: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/11.jpg)
Introducing URDB
URDB is a universal reversible debugger based on:I checkpointI restartI re-execution of debugging historiesI decomposing of debugging histories
![Page 12: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/12.jpg)
URDB: The Novelty
I Universality, placing the user within the framework of a familiardebugger (GDB/Python/MATLAB/Perl)(Reversibility can be added in less than a day)
I The decomposition algorithms for manipulating a history ofdebugging primitives
I Transparent checkpointing of GDB sessions in DMTCP(Distributed MultiThreaded CheckPointing)
![Page 13: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/13.jpg)
URDB: The Novelty
I Universality, placing the user within the framework of a familiardebugger (GDB/Python/MATLAB/Perl)(Reversibility can be added in less than a day)
I The decomposition algorithms for manipulating a history ofdebugging primitives
I Transparent checkpointing of GDB sessions in DMTCP(Distributed MultiThreaded CheckPointing)
![Page 14: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/14.jpg)
URDB: The Novelty
I Universality, placing the user within the framework of a familiardebugger (GDB/Python/MATLAB/Perl)(Reversibility can be added in less than a day)
I The decomposition algorithms for manipulating a history ofdebugging primitives
I Transparent checkpointing of GDB sessions in DMTCP(Distributed MultiThreaded CheckPointing)
![Page 15: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/15.jpg)
URDB: The Architecture
URDB
user
usercommands
a.out
gdb
commands
restartcheckpoint
gdb
packageDMTCP ckpt
![Page 16: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/16.jpg)
DMTCP: checkpointing an entire GDB session
ptrace is a system call that allows a superior process (e.g. GDB) totrace an inferior process (target application) at the binary level.
Why is this difficult?The inferior process is normally being traced by GDB.
During a checkpoint, DMTCP has control, and not GDB.
DMTCP then arranges for GDB to resume tracing the inferior processat the time of resume or restart.
![Page 17: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/17.jpg)
DMTCP: checkpointing an entire GDB session
ptrace is a system call that allows a superior process (e.g. GDB) totrace an inferior process (target application) at the binary level.
Why is this difficult?The inferior process is normally being traced by GDB.
During a checkpoint, DMTCP has control, and not GDB.
DMTCP then arranges for GDB to resume tracing the inferior processat the time of resume or restart.
![Page 18: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/18.jpg)
DMTCP: checkpointing an entire GDB session
ptrace is a system call that allows a superior process (e.g. GDB) totrace an inferior process (target application) at the binary level.
Why is this difficult?The inferior process is normally being traced by GDB.
During a checkpoint, DMTCP has control, and not GDB.
DMTCP then arranges for GDB to resume tracing the inferior processat the time of resume or restart.
![Page 19: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/19.jpg)
DMTCP: checkpointing an entire GDB session
ptrace is a system call that allows a superior process (e.g. GDB) totrace an inferior process (target application) at the binary level.
Why is this difficult?The inferior process is normally being traced by GDB.
During a checkpoint, DMTCP has control, and not GDB.
DMTCP then arranges for GDB to resume tracing the inferior processat the time of resume or restart.
![Page 20: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/20.jpg)
Debugging Primitives and Their Reverse Analogs
I step: enter a function callI next: do not enter any function callsI continue: until next breakpointI finish: until end of function
breakpoint
reverse−finishfunction 1
function 2
time
reverse−next
forward execution
reverse execution
continuereverse−
stepreverse−
![Page 21: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/21.jpg)
Debugging Primitives and Their Reverse Analogs
I step: enter a function callI next: do not enter any function callsI continue: until next breakpointI finish: until end of function
reverse−step
breakpointfunction 1
function 2
time
reverse−next
forward execution
reverse execution
continuereverse−
reverse−finish
![Page 22: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/22.jpg)
Debugging Primitives and Their Reverse Analogs
I step: enter a function callI next: do not enter any function callsI continue: until next breakpointI finish: until end of function
reverse−step
breakpoint
reverse−finishfunction 1
function 2
time
reverse−next
forward execution
reverse execution
reverse−continue
![Page 23: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/23.jpg)
Debugging Primitives and Their Reverse Analogs
I step: enter a function callI next: do not enter any function callsI continue: until next breakpointI finish: until end of function
reverse−step
breakpointfunction 1
function 2
time
reverse−next
forward execution
reverse execution
continuereverse−
reverse−finish
![Page 24: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/24.jpg)
When a Reverse Command is Issued ...
Prerequisites
I checkpoint CI debugging history h
Algorithmrestart from checkpoint Cnew_h −→ decomposition_algorithm(h)/* new_h is the decomposed debugging history */restart from checkpoint Cre-execute new_h, minus the last command
![Page 25: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/25.jpg)
URDB: An Example
reverse-step([step, next, step]) −→ [step, next]
reverse-step([continue, next]) −→ ?
![Page 26: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/26.jpg)
URDB: An Example
reverse-step([step, next, step]) −→ [step, next]
reverse-step([continue, next]) −→ ?
![Page 27: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/27.jpg)
Reverse-step
[continue, next]
while True doif last command is continue or next/bkpt then
undo_command()do_step()while we are not at breakpoint do
do_next()else if last command is step then
undo_command()break
else /* last command is next */undo_command()do_step()while deeper() do
do_next()
![Page 28: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/28.jpg)
Reverse-step
[continue]
while True doif last command is continue or next/bkpt then
undo_command()do_step()while we are not at breakpoint do
do_next()else if last command is step then
undo_command()break
else /* last command is next */undo_command()do_step()while deeper() do
do_next()
![Page 29: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/29.jpg)
Reverse-step
[continue, step]
while True doif last command is continue or next/bkpt then
undo_command()do_step()while we are not at breakpoint do
do_next()else if last command is step then
undo_command()break
else /* last command is next */undo_command()do_step()while deeper() do
do_next()
![Page 30: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/30.jpg)
Reverse-step
[continue, step, next, …, next, next]
while True doif last command is continue or next/bkpt then
undo_command()do_step()while we are not at breakpoint do
do_next()else if last command is step then
undo_command()break
else /* last command is next */undo_command()do_step()while deeper() do
do_next()
![Page 31: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/31.jpg)
Reverse-step
[continue, step, next, …, next, next]
while True doif last command is continue or next/bkpt then
undo_command()do_step()while we are not at breakpoint do
do_next()else if last command is step then
undo_command()break
else /* last command is next */undo_command()do_step()while deeper() do
do_next()
![Page 32: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/32.jpg)
Reverse-step
[continue, step, next, …, next]
while True doif last command is continue or next/bkpt then
undo_command()do_step()while we are not at breakpoint do
do_next()else if last command is step then
undo_command()break
else /* last command is next */undo_command()do_step()while deeper() do
do_next()
![Page 33: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/33.jpg)
Reverse-step
[continue, step, next, …, next, step]
while True doif last command is continue or next/bkpt then
undo_command()do_step()while we are not at breakpoint do
do_next()else if last command is step then
undo_command()break
else /* last command is next */undo_command()do_step()while deeper() do
do_next()
![Page 34: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/34.jpg)
Reverse-step
[continue, step, next, …, next, step]
while True doif last command is continue or next/bkpt then
undo_command()do_step()while we are not at breakpoint do
do_next()else if last command is step then
undo_command()break
else /* last command is next */undo_command()do_step()while deeper() do
do_next()
![Page 35: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/35.jpg)
Reverse-step
[continue, step, next, …, next, step]
while True doif last command is continue or next/bkpt then
undo_command()do_step()while we are not at breakpoint do
do_next()else if last command is step then
undo_command()break
else /* last command is next */undo_command()do_step()while deeper() do
do_next()
![Page 36: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/36.jpg)
Reverse-step
[continue, step, next, …, next]
while True doif last command is continue or next/bkpt then
undo_command()do_step()while we are not at breakpoint do
do_next()else if last command is step then
undo_command()break
else /* last command is next */undo_command()do_step()while deeper() do
do_next()
![Page 37: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/37.jpg)
Reverse-step
[continue, step, next, …, next]
while True doif last command is continue or next/bkpt then
undo_command()do_step()while we are not at breakpoint do
do_next()else if last command is step then
undo_command()break
else /* last command is next */undo_command()do_step()while deeper() do
do_next()
![Page 38: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/38.jpg)
Multiple Checkpoints
UsefulnessTo reduce the cost of replaying histories.
Core IdeaI If the decomposed debugging history is currently empty, then one
reverts to the earlier checkpoint and its debugging history.I Future Work: extra checkpoints will be taken automatically.
![Page 39: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/39.jpg)
Multiple Checkpoints
UsefulnessTo reduce the cost of replaying histories.
Core IdeaI If the decomposed debugging history is currently empty, then one
reverts to the earlier checkpoint and its debugging history.I Future Work: extra checkpoints will be taken automatically.
![Page 40: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/40.jpg)
URDB Timings Across Debuggers
The test program inserts (via a function call) twenty numbers into alinked list.
Command gdb-7.2 MATLAB Perl Pythoncheckpoint 1.86s 2.02s 0.17s 0.18srestart 1.20s 1.65s 0.20s 0.17sreverse-next 20.44s 21.61s 16.75s 12.93sreverse-step 22.14s 18.40s 16.42s 12.80sreverse-continue 7.78s 7.43s 5.77s 5.62sreverse-finish 3.67s 1.86s 0.88s 0.78s
![Page 41: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/41.jpg)
URDB Timings Across Debuggers
The test program inserts (via a function call) twenty numbers into alinked list.
Command gdb-7.2 MATLAB Perl Pythoncheckpoint 1.86s 2.02s 0.17s 0.18srestart 1.20s 1.65s 0.20s 0.17sreverse-next 20.44s 21.61s 16.75s 12.93sreverse-step 22.14s 18.40s 16.42s 12.80sreverse-continue 7.78s 7.43s 5.77s 5.62sreverse-finish 3.67s 1.86s 0.88s 0.78s
![Page 42: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/42.jpg)
URDB versus gdb-7.2
I Test program: a C program that inserts 1,000,000 elements into alinked list (the program allocated its own memory and avoided theuse of C malloc).
I URDB was 5,200 times faster than the target record mode ofgdb-7.2!
I gdb-7.2: the reverse time depends on the number of reverse stepsexecuted.
I URDB: the reverse time depends on the number of forwardinstructions from the last checkpoint.
![Page 43: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/43.jpg)
URDB versus gdb-7.2
I Test program: a C program that inserts 1,000,000 elements into alinked list (the program allocated its own memory and avoided theuse of C malloc).
I URDB was 5,200 times faster than the target record mode ofgdb-7.2!
I gdb-7.2: the reverse time depends on the number of reverse stepsexecuted.
I URDB: the reverse time depends on the number of forwardinstructions from the last checkpoint.
![Page 44: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/44.jpg)
URDB versus gdb-7.2
I Test program: a C program that inserts 1,000,000 elements into alinked list (the program allocated its own memory and avoided theuse of C malloc).
I URDB was 5,200 times faster than the target record mode ofgdb-7.2!
I gdb-7.2: the reverse time depends on the number of reverse stepsexecuted.
I URDB: the reverse time depends on the number of forwardinstructions from the last checkpoint.
![Page 45: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/45.jpg)
URDB versus gdb-7.2
I Test program: a C program that inserts 1,000,000 elements into alinked list (the program allocated its own memory and avoided theuse of C malloc).
I URDB was 5,200 times faster than the target record mode ofgdb-7.2!
I gdb-7.2: the reverse time depends on the number of reverse stepsexecuted.
I URDB: the reverse time depends on the number of forwardinstructions from the last checkpoint.
![Page 46: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/46.jpg)
Related Work: 4 previous approaches
(1) Record/Reverse-execute via logging the state of eachinstruction
I Grishman, AFIPS, 1970I Zelkowitz, Communications of the ACM, 1973I Tolmach and Appel, LFP, 1990I TotalViewI gdb-7.2
(2) Record/Replay via virtual machine snapshots
I King, Dunlap, and Chen, USENIX, 2005
![Page 47: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/47.jpg)
Related Work: 4 previous approaches
(1) Record/Reverse-execute via logging the state of eachinstruction
I Grishman, AFIPS, 1970I Zelkowitz, Communications of the ACM, 1973I Tolmach and Appel, LFP, 1990I TotalViewI gdb-7.2
(2) Record/Replay via virtual machine snapshots
I King, Dunlap, and Chen, USENIX, 2005
![Page 48: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/48.jpg)
Related Work: 4 previous approaches
(3) Checkpoint/Re-execute via live checkpoints
I Feldman and Brown, SIGPLAN Notices, 1989I Srinivasan, Kandula, Andrews, and Zhou, USENIX, 2004I Leroy, Doligez, Garrigue, Rémy, and Vouillon, OCaml 3.11, 2008I Boothe, PLDI, 2000
(4) Post-mortem debugging via logging of events to a database
I Pothier, Tanter, and Piquer, OOPSLA, 2007I Lefebvre, Cully, Feeley, Hutchinson, and Warfield, EuroSys, 2009
![Page 49: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/49.jpg)
Related Work: 4 previous approaches
(3) Checkpoint/Re-execute via live checkpoints
I Feldman and Brown, SIGPLAN Notices, 1989I Srinivasan, Kandula, Andrews, and Zhou, USENIX, 2004I Leroy, Doligez, Garrigue, Rémy, and Vouillon, OCaml 3.11, 2008I Boothe, PLDI, 2000
(4) Post-mortem debugging via logging of events to a database
I Pothier, Tanter, and Piquer, OOPSLA, 2007I Lefebvre, Cully, Feeley, Hutchinson, and Warfield, EuroSys, 2009
![Page 50: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/50.jpg)
Thank you!
Questions?
![Page 51: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/51.jpg)
Reverse-nextwhile true do
if last command is continue or next/bkpt thenundo-command()if last command is next/bkpt and same() then breakelse if last command is next/bkpt and deeper() then
/* next/bkpt had exited a function */reverse-finish()break
else /* shallower() or last command is continue */do_step()while we are not at breakpoint do do_next()
else if last command is step or next thenundo-command()if same() or shallower() then breakelse if deeper() then /* next had exited a function */
reverse-finish()break
![Page 52: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/52.jpg)
Reverse-nextwhile true do
if last command is continue or next/bkpt thenundo-command()if last command is next/bkpt and same() then breakelse if last command is next/bkpt and deeper() then
/* next/bkpt had exited a function */reverse-finish()break
else /* shallower() or last command is continue */do_step()while we are not at breakpoint do do_next()
else if last command is step or next thenundo-command()if same() or shallower() then breakelse if deeper() then /* next had exited a function */
reverse-finish()break
![Page 53: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/53.jpg)
Reverse-nextwhile true do
if last command is continue or next/bkpt thenundo-command()if last command is next/bkpt and same() then breakelse if last command is next/bkpt and deeper() then
/* next/bkpt had exited a function */reverse-finish()break
else /* shallower() or last command is continue */do_step()while we are not at breakpoint do do_next()
else if last command is step or next thenundo-command()if same() or shallower() then breakelse if deeper() then /* next had exited a function */
reverse-finish()break
![Page 54: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/54.jpg)
Reverse-nextwhile true do
if last command is continue or next/bkpt thenundo-command()if last command is next/bkpt and same() then breakelse if last command is next/bkpt and deeper() then
/* next/bkpt had exited a function */reverse-finish()break
else /* shallower() or last command is continue */do_step()while we are not at breakpoint do do_next()
else if last command is step or next thenundo-command()if same() or shallower() then breakelse if deeper() then /* next had exited a function */
reverse-finish()break
![Page 55: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/55.jpg)
Reverse-nextwhile true do
if last command is continue or next/bkpt thenundo-command()if last command is next/bkpt and same() then breakelse if last command is next/bkpt and deeper() then
/* next/bkpt had exited a function */reverse-finish()break
else /* shallower() or last command is continue */do_step()while we are not at breakpoint do do_next()
else if last command is step or next thenundo-command()if same() or shallower() then breakelse if deeper() then /* next had exited a function */
reverse-finish()break
![Page 56: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/56.jpg)
Reverse-continue
repeatundo-command()
until we are at a breakpoint
NoteAn optimization can scan the history and replay it until the lastbreakpoint before the current statement, wherereverse-continue() was issued.
![Page 57: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/57.jpg)
Reverse-continue
repeatundo-command()
until we are at a breakpoint
NoteAn optimization can scan the history and replay it until the lastbreakpoint before the current statement, wherereverse-continue() was issued.
![Page 58: URDB: A Universal Reversible Debugger Based on Decomposing ... fileIntroducing URDB URDBis a universal reversible debugger based on: I checkpoint I restart I re-execution of debugging](https://reader030.fdocuments.in/reader030/viewer/2022040716/5e202c31a26509085951d1c3/html5/thumbnails/58.jpg)
Reverse-finish
I The algorithm follows a logic similar in spirit to that ofreverse-next() and reverse-step().
I Implementation: execute a sequence of reverse-next()’s andchecking the stack depth after each reverse-next().