GDB-python register_changed event handler

41 Views Asked by At

I am creating a GDB TUI python extension for embedded debugging. The python script is being run by the GDB. Trying to create a handler for register_changed event in GDB according to the documentation like so:

def reg_changed_handler(event):
    print('register changed' + str(event.regnum))

gdb.events.register_changed.connect(reg_changed_handler)

I can't get working this very specific event handler. Other events are implemented in the very same way and are working fine. Is there something I am missing? I am running gdb 12.1-0ubuntu1 on Ubuntu 22.04.1 LTS, Python 3.10.6

I don't clearly understand when the event occurs. From the documentation: Emits gdb.RegisterChangedEvent which indicates that a register in the inferior has been modified by the GDB user.

Does it mean, that the event occurs only when I specifically change a register (in assembly code)? Or it occurs every time, any register is changed (after compilation to assembly)

I tried evoking the event by modifying specific registers in assembly on my embedded dev board, but without success.

0

There are 0 best solutions below