Created
April 24, 2015 22:00
-
-
Save mirekfranc/5d25237a9882e3ee49f5 to your computer and use it in GitHub Desktop.
how to process gdb breakpoints in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://sourceware.org/gdb/onlinedocs/gdb/Breakpoints-In-Python.html | |
# https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html | |
def my_breakpoint_handler (event): | |
if (isinstance(event, gdb.BreakpointEvent) and (event.breakpoint.location == "g")): | |
print event.breakpoint.hit_count | |
gdb.events.stop.connect(my_breakpoint_handler) | |
gdb.execute("start") | |
gdb.execute("break g") | |
gdb.execute("continue") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment