Lines Matching refs:gdb
5 """GDB Pretty printers and convenience functions for Go's runtime structures.
7 This script is loaded by GDB when it finds a .debug_gdb_scripts
14 # foo string' will make foo a plain struct in the eyes of gdb,
27 goobjfile = gdb.current_objfile() or gdb.objfiles()[0]
101 Map-typed go variables are really pointers. dereference them in gdb
152 Chan-typed go variables are really pointers. dereference them in gdb
198 # fields to python attributes in gdb.py isn't complete: you can't test
205 except gdb.error:
212 except gdb.error:
218 return gdb.lookup_type(name)
219 except gdb.error:
222 return gdb.lookup_type('struct ' + name)
223 except gdb.error:
226 return gdb.lookup_type('struct ' + name[1:]).pointer()
227 except gdb.error:
239 return go_type_ptr.cast(gdb.lookup_type("struct reflect.rtype").pointer()).dereference()
313 class GoLenFunc(gdb.Function):
319 gdb.Function.__init__(self, "len")
328 class GoCapFunc(gdb.Function):
334 gdb.Function.__init__(self, "cap")
343 class DTypeFunc(gdb.Function):
350 gdb.Function.__init__(self, "dtype")
355 except gdb.error:
372 class GoroutinesCmd(gdb.Command):
376 gdb.Command.__init__(self, "info goroutines", gdb.COMMAND_STACK, gdb.COMPLETE_NONE)
379 # args = gdb.string_to_argv(arg)
380 vp = gdb.lookup_type('void').pointer()
381 for ptr in SliceValue(gdb.parse_and_eval("'runtime.allgs'")):
393 #python3 / newer versions of gdb
395 except gdb.error:
400 blk = gdb.block_for_pc(pc)
412 @return tuple (gdb.Value, gdb.Value)
414 vp = gdb.lookup_type('void').pointer()
415 for ptr in SliceValue(gdb.parse_and_eval("'runtime.allgs'")):
423 class GoroutineCmd(gdb.Command):
424 """Execute gdb command in the context of goroutine <goid>.
427 execute an arbitrary gdb command, and restore PC and SP.
429 Usage: (gdb) goroutine <goid> <gdbcmd>
436 gdb.Command.__init__(self, "goroutine", gdb.COMMAND_STACK, gdb.COMPLETE_NONE)
440 goid = gdb.parse_and_eval(goid)
446 #python3 / newer versions of gdb
448 except gdb.error:
450 save_frame = gdb.selected_frame()
451 gdb.parse_and_eval('$save_pc = $pc')
452 gdb.parse_and_eval('$save_sp = $sp')
453 gdb.parse_and_eval('$pc = {0}'.format(str(pc)))
454 gdb.parse_and_eval('$sp = {0}'.format(str(sp)))
456 gdb.execute(cmd)
458 gdb.parse_and_eval('$pc = $save_pc')
459 gdb.parse_and_eval('$sp = $save_sp')
463 class GoIfaceCmd(gdb.Command):
467 gdb.Command.__init__(self, "iface", gdb.COMMAND_DATA, gdb.COMPLETE_SYMBOL)
470 for obj in gdb.string_to_argv(arg):
473 obj = gdb.parse_and_eval(str(obj))