Skip to content

Instantly share code, notes, and snippets.

@Roguelazer
Created January 16, 2014 03:13
Show Gist options
  • Save Roguelazer/8449235 to your computer and use it in GitHub Desktop.
Save Roguelazer/8449235 to your computer and use it in GitHub Desktop.
python-assisted gdb breakpoint
import gdb
TARGET = "a"
class PyAssistedBreakpoint(gdb.Breakpoint):
def stop(self):
found_target = False
f = gdb.selected_frame()
while f is not None:
if f.name() == TARGET:
found_target = True
break
f = f.older()
if not found_target:
return False
print found_target
return True
b = PyAssistedBreakpoint("c")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment