aboutsummaryrefslogtreecommitdiff
path: root/gdb/NEWS
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/NEWS
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/NEWS')
-rw-r--r--gdb/NEWS8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/NEWS b/gdb/NEWS
index 41d8155..d8f4f39 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -9,6 +9,14 @@
This support requires that GDB be built with Python scripting
enabled.
+* New commands
+
+maintenance print record-instruction [ N ]
+ Print the recorded information for a given instruction. If N is not given
+ prints how GDB would undo the last instruction executed. If N is negative,
+ prints how GDB would undo the N-th previous instruction, and if N is
+ positive, it prints how GDB will redo the N-th following instruction.
+
*** Changes in GDB 13
* MI version 1 is deprecated, and will be removed in GDB 14.