Re: reverse for GDB/MI

Tomas Holmberg
2008-12-17T14:57:04Z

[-- Attachment #1: Type: text/plain, Size: 124 bytes --]

> Thanks, but please also submit a suitable change for the manual.
Documentation for reverse MI commands attached.

/tomas

[-- Attachment #2: gdb.texinfo.rev_mi.txt --]
[-- Type: text/plain, Size: 5471 bytes --]

Index: gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.541
diff -u -r1.541 gdb.texinfo
--- gdb.texinfo 16 Dec 2008 06:14:00 -0000 1.541
+++ gdb.texinfo 17 Dec 2008 14:47:26 -0000
@@ -20813,6 +20813,212 @@
@end smallexample

+@subheading The @code{-exec-reverse-continue} Command
+@findex -exec-reverse-continue
+
+@subsubheading Synopsis
+
+@smallexample
+ -exec-reverse-continue
+@end smallexample
+
+Resumes the reverse execution of the inferior program until a
+breakpoint is encountered, or until the inferior exits.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{reverse-continue}.
+
+@subsubheading Example
+
+@smallexample
+(gdb)
+-exec-reverse-continue
+^running
+*running,thread-id="all"
+(gdb)
+*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",
+thread-id="1",stopped-threads="all",
+frame=@{addr="0x10000560",func="mark",args=[],file="debug_example.c",
+fullname="/home/th/debug_example.c",line="19"@}
+(gdb)
+@end smallexample
+
+
+@subheading The @code{-exec-reverse-finish} Command
+@findex -exec-reverse-finish
+
+@subsubheading Synopsis
+
+@smallexample
+ -exec-reverse-finish
+@end smallexample
+
+Resumes the reverse execution of the inferior program until the point
+where current function was called.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{reverse-finish}.
+
+@subsubheading Example
+
+@smallexample
+(gdb)
+-exec-step
+^running
+*running,thread-id="all"
+(gdb)
+*stopped,reason="end-stepping-range",thread-id="1",stopped-threads="all",
+frame=@{addr="0x10000580",func="mark",args=[],file="debug_example.c",
+fullname="/home/th/debug_example.c",line="20"@}
+(gdb)
+-exec-reverse-finish
+^running
+*running,thread-id="all"
+(gdb)
+*stopped
+*running,thread-id="all"
+*stopped,reason="end-stepping-range",thread-id="1",stopped-threads="all",
+frame=@{addr="0x1000070c",func="main",args=[],
+file="debug_example.c",fullname="/home/th/debug_example.c",line="52"@}
+(gdb)
+@end smallexample
+
+
+@subheading The @code{-exec-reverse-next} Command
+@findex -exec-reverse-next
+
+@subsubheading Synopsis
+
+@smallexample
+ -exec-reverse-next
+@end smallexample
+
+Resumes reverse execution of the inferior program, stopping at the
+beginning of the previous source line. Starting from the first line of
+a function, the command will take you back to the caller of that
+function, before the function was called.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{reverse-next}.
+
+@subsubheading Example
+
+@smallexample
+(gdb)
+-exec-reverse-next
+^running
+*running,thread-id="all"
+(gdb)
+*stopped,reason="end-stepping-range",
+thread-id="1",stopped-threads="all",
+frame=@{addr="0x100006f4",func="main",args=[],
+file="debug_example.c",fullname="/home/th/debug_example.c",line="52"@}
+(gdb)
+@end smallexample
+
+
+@subheading The @code{-exec-reverse-next-instruction} Command
+@findex -exec-reverse-next-instruction
+
+@subsubheading Synopsis
+
+@smallexample
+ -exec-reverse-next-instruction
+@end smallexample
+
+Resumes reverse execution of the inferior program, stopping at the
+previous instruction. If the previously executed instruction was a
+return from another instruction, it will continue to execute in
+reverse until the call to that function (from the current stack frame)
+is reached.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{reverse-nexti}.
+
+@subsubheading Example
+
+@smallexample
+(gdb)
+-exec-reverse-next-instruction
+^running
+*running,thread-id="all"
+(gdb)
+*stopped,reason="end-stepping-range",
+thread-id="1",stopped-threads="all",
+frame=@{addr="0x100006f4",func="main",args=[],
+file="debug_example.c",fullname="/home/th/debug_example.c",line="52"@}
+(gdb)
+@end smallexample
+
+
+@subheading The @code{-exec-reverse-step} Command
+@findex -exec-reverse-step
+
+@subsubheading Synopsis
+
+@smallexample
+ -exec-reverse-step
+@end smallexample
+
+Resumes reverse execution of the inferior program, stopping at the
+beginning of the previously executed source line.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{reverse-step}.
+
+@subsubheading Example
+
+@smallexample
+(gdb)
+-exec-reverse-step
+^running
+*running,thread-id="all"
+(gdb)
+*stopped,reason="end-stepping-range",
+thread-id="1",stopped-threads="all",
+frame=@{addr="0x100006d8",func="main",args=[],
+file="debug_example.c",fullname="/home/th/debug_example.c",line="51"@}
+(gdb)
+@end smallexample
+
+
+@subheading The @code{-exec-reverse-step-instruction} Command
+@findex -exec-reverse-step-instruction
+
+@subsubheading Synopsis
+
+@smallexample
+ -exec-reverse-step-instruction
+@end smallexample
+
+Resumes reverse execution of the inferior program, stopping at the
+previously executed instruction.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{reverse-stepi}.
+
+@subsubheading Example
+
+@smallexample
+(gdb)
+-exec-reverse-step-instruction
+^running
+*running,thread-id="all"
+(gdb)
+*stopped,reason="end-stepping-range",
+thread-id="1",stopped-threads="all",
+frame=@{addr="0x100006d8",func="main",args=[],
+file="debug_example.c",fullname="/home/th/debug_example.c",line="51"@}
+(gdb)
+@end smallexample
+
+
@subheading The @code{-exec-run} Command
@findex -exec-run