tests/abbrev.stc
author Jan Vrany <jan.vrany@labware.com>
Thu, 07 Dec 2023 12:33:31 +0000
changeset 322 1b26d0a9560c
parent 272 cdd1c9ad00de
permissions -rw-r--r--
Emit and handle (custom) `-register-changed` notification This commit adds new (custom) asynchronous notification about register value being changed. Standard GDB does not notify MI clients about register value being changed when debugging (for example, by CLI command `set $rax = 1` or via Python's `Value.assign()`). This caused libgdb's register value cache being out of sync. In the past, this was partially worked around by manually emiting the notification on `GDBRegisterWithValue` APIs, but this did not (and could not) handle the case register was changed from GDB command line. To solve this problem, this commit installs a custom Python event handler that emits new GDB/MI notification - `-register-changed` - whenever a register changes after debugee is stopped. This has been enabled by upstream GDB commit 4825fd "gdb/python: implement support for sending custom MI async notifications" On libgdbs side, complete inferior state is invalidated. In theory, one could carefully invalidate only the changed `GDBRegisterWithValue` but in certain cases this could also change the backtrace (for example, if one updates stack pointer) or position in code. So it seems safer to just invalidate everything.

# automagically generated by the project definition
# this file is needed for stc to be able to compile modules independently.
# it provides information about a classes filename, category and especially namespace.
GDBDebuggeesResource GDBDebuggeesResource jv:libgdbs/tests 'GDB-Tests' 1
GDBDebuggerTestCase GDBDebuggerTestCase jv:libgdbs/tests 'GDB-Tests' 1
GDBInternalPipeStreamTests GDBInternalPipeStreamTests jv:libgdbs/tests 'GDB-Tests-Support' 1
GDBMIParserTests GDBMIParserTests jv:libgdbs/tests 'GDB-Tests-Private' 1
GDBMIPrinterTests GDBMIPrinterTests jv:libgdbs/tests 'GDB-Tests-Private' 1
GDBTransientDataHolderTests GDBTransientDataHolderTests jv:libgdbs/tests 'GDB-Tests-Private' 1
jv_libgdbs_tests jv_libgdbs_tests jv:libgdbs/tests '* Projects & Packages *' 3
GDBDebuggerExamples GDBDebuggerExamples jv:libgdbs/tests 'GDB-Tests-Examples' 1
GDBDebuggerTestsR GDBDebuggerTestsR jv:libgdbs/tests 'GDB-Tests' 1
GDBSimulatorResource GDBSimulatorResource jv:libgdbs/tests 'GDB-Tests' 1