cba30deb1440 — Steve Fink tip 17 days ago
WIP display old/new values for watchpoints. Needs work. Depends on gdb patches.
1 files changed, 11 insertions(+), 0 deletions(-)

M conf/gdbstart.py
M conf/gdbstart.py +11 -0
@@ 8,3 8,14 @@ gdb.execute("source {}/gdbinit.pahole.py
 gdb.execute("source {}/gdbinit.gecko.py".format(SFINK_TOOLS_DIR))
 gdb.execute("source {}/gdbinit.misc".format(SFINK_TOOLS_DIR))
 gdb.execute("source {}/gdbinit.rr.py".format(SFINK_TOOLS_DIR))
+
+def breakpoint_handler(event):
+    if not isinstance(event, gdb.BreakpointEvent):
+        return
+    bpnums = [b.number for b in event.breakpoints]
+    old = getattr(event, "old_val", "(N/A)")
+    new = getattr(event, "new_val", "(N/A)")
+    nums = ' '.join(str(n) for n in bpnums)
+    print(f"stopped at breakpoint {nums}: {old} -> {new}")
+
+gdb.events.stop.connect(breakpoint_handler)