pal-gdb.py 460 B

12345678910111213141516
  1. #!/usr/bin/env python
  2. import os, sys, gdb
  3. if len(gdb.inferiors()) == 1:
  4. gdb.execute("set env IN_GDB = 1")
  5. gdb.execute("set auto-load off")
  6. sys.stdout.write("Are you loading the script [Y]/n ? ")
  7. sys.stdout.flush()
  8. ans = sys.stdin.readline()
  9. if ans[0] != 'n' and ans[0] != 'N':
  10. gdbfile = os.path.dirname(__file__) + "/pal.gdb"
  11. gdb.execute("source " + gdbfile)
  12. sys.stdout.write("script %s loaded\n" % gdbfile)