0

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.

2
  • 1
    modified by the GDB user means if you manually change a register inside gdb. Commented Nov 21, 2022 at 20:19
  • Thx, it works now when I change the register value in GDB using set command. I expected the event handler to give me an interrupt every time any register is changed (not by user) Commented Nov 22, 2022 at 0:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.