pal-gdb.py 483 B

1234567891011121314151617
  1. #!/usr/bin/env python
  2. import os, sys, gdb
  3. if len(gdb.inferiors()) == 1:
  4. print "Are you loading the script [Y]/n ? ",
  5. ans = sys.stdin.readline()
  6. if ans[0] == 'n' or ans[0] == 'N':
  7. gdb.execute("set detach-on-fork on")
  8. gdb.execute("set follow-fork-mode child")
  9. else:
  10. gdbfile = os.path.dirname(__file__) + "/pal.gdb"
  11. gdb.execute("set env IN_GDB = 1")
  12. gdb.execute("source " + gdbfile)
  13. print "script", gdbfile, "loaded"