1 """ debug utilities """
6 gdb_path = '/usr/bin/gdb'
9 def spawn_gdb(binary_path, core_path, logger):
10 if os.path.isfile(gdb_path) and os.access(gdb_path, os.X_OK):
11 # automatically attach gdb
12 gdb_cmdline = "%s %s %s" % (gdb_path, binary_path, core_path)
13 gdb = pexpect.spawn(gdb_cmdline)
20 raise Exception("GDB refused to die...")
22 logger.error("Debugger '%s' does not exist or is not an "
23 "executable.." % gdb_path)