aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorBruno Larsen <blarsen@redhat.com>2022-11-03 10:17:36 +0100
committerBruno Larsen <blarsen@redhat.com>2023-01-04 11:21:57 +0100
commite24d337e219da287535eddc5c9918ac410d124be (patch)
treeb13e90469ebd1690ffeb755eb1ccaab6471d2a60 /gdb/doc
parent502c7218da3c486e58d6ce039b36fb4fa62d3a92 (diff)
downloadgdb-e24d337e219da287535eddc5c9918ac410d124be.zip
gdb-e24d337e219da287535eddc5c9918ac410d124be.tar.gz
gdb-e24d337e219da287535eddc5c9918ac410d124be.tar.bz2
gdb: add 'maintenance print record-instruction' command
While chasing some reverse debugging bugs, I found myself wondering what was recorded by GDB to undo and redo a certain instruction. This commit implements a simple way of printing that information. If there isn't enough history to print the desired instruction (such as when the user hasn't started recording yet or when they request 2 instructions back but only 1 was recorded), GDB warns the user like so: (gdb) maint print record-instruction Not enough recorded history If there is enough, GDB prints the instruction like so: (gdb) maint print record-instruction 4 bytes of memory at address 0x00007fffffffd5dc changed from: 01 00 00 00 Register eflags changed: [ IF ] Register rip changed: (void (*)()) 0x401115 <main+15> Approved-by: Eli Zaretskii <eliz@gnu.org> Reviewed-by: Alexandra Hajkova <ahajkova@redhat.com> Reviewed-by: Lancelot Six <lsix@lancelotsix.com> Approved-by: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/gdb.texinfo8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index ea54f25..dd8f8bc 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -40542,6 +40542,14 @@ that symbol is described. The type chain produced by this command is
a recursive definition of the data type as stored in @value{GDBN}'s
data structures, including its flags and contained types.
+@kindex maint print record-instruction
+@item maint print record-instruction
+@itemx maint print record-instruction @var{N}
+print how GDB recorded a given instruction. If @var{n} is not positive
+number, it prints the values stored by the inferior before the @var{n}-th previous
+instruction was exectued. If @var{n} is positive, print the values after the @var{n}-th
+following instruction is executed. If @var{n} is not given, 0 is assumed.
+
@kindex maint selftest
@cindex self tests
@item maint selftest @r{[}-verbose@r{]} @r{[}@var{filter}@r{]}