Lines Matching defs:gdb
3 From gdb 7 onwards, gdb's build can be configured --with-python, allowing gdb
6 http://sourceware.org/gdb/current/onlinedocs/gdb/Python-API.html
10 "inferior process" in gdb parlance) is itself python, or more specifically,
19 In particular, given a gdb.Value corresponding to a PyObject* in the inferior
20 process, we can generate a "proxy value" within the gdb process. For example,
23 generate a proxy value within the gdb process that is a list of bytes
36 We try to defer gdb.lookup_type() invocations for python types until as late as
41 The module also extends gdb with some python-specific commands.
44 import gdb
50 # Look up the gdb.Type for some standard types:
52 # gdb loads different executables
55 return gdb.lookup_type('char').pointer() # char*
59 return gdb.lookup_type('unsigned char').pointer() # unsigned char*
63 return gdb.lookup_type('unsigned short').pointer()
67 return gdb.lookup_type('unsigned int').pointer()
71 return gdb.lookup_type('void').pointer().sizeof
103 # break the gdb process too much (e.g. sizes of iterations, sizes of lists)
156 Class wrapping a gdb.Value that's either a (PyObject*) within the
175 Get the gdb.Value for the given field within the PyObject, coping with
244 Python, and the precise version of gdb.
265 within the gdb process, whilst (hopefully) avoiding crashes when
273 visited: a set of all gdb.Value pyobject pointers already visited
314 Given a PyTypeObjectPtr instance wrapping a gdb.Value that's a
320 (gdb) python print gdb.lookup_symbol('PyList_Type')[0].value
396 return gdb.lookup_type(cls._typename).pointer()
459 _PyObject_VAR_SIZE._type_size_t = gdb.lookup_type('size_t')
481 type_PyVarObject_ptr = gdb.lookup_type('PyVarObject').pointer()
505 PyDictValuesPtrPtr = gdb.lookup_type("PyDictValues").pointer().pointer()
515 HeapTypePtr = gdb.lookup_type("PyHeapTypeObject").pointer()
566 Class wrapping a gdb.Value that's a PyBaseExceptionObject* i.e. an exception
592 Class wrapping a gdb.Value that's a PyClassObject* i.e. a <classobj>
619 Class wrapping a gdb.Value that's a PyCFunctionObject*
697 Class wrapping a gdb.Value that's a PyCodeObject* i.e. a <code> instance
752 Class wrapping a gdb.Value that's a PyDictObject* i.e. a dict instance
827 ent_ptr_t = gdb.lookup_type('PyDictKeyEntry').pointer()
829 ent_ptr_t = gdb.lookup_type('PyDictUnicodeEntry').pointer()
839 # Get the gdb.Value for the (PyObject*) with the given index:
895 if gdb.lookup_type('digit').sizeof == 2:
915 Class wrapping a gdb.Value that's a PyBoolObject* i.e. one of the two
926 Class wrapping a gdb.Value that's a PyObject* pointing to the
1039 obj_ptr_ptr = gdb.lookup_type("PyObject").pointer().pointer()
1066 codeunit_p = gdb.lookup_type("_Py_CODEUNIT").pointer()
1137 # gdb fails to load debug symbols. Use a catch-all "except
1223 return gdb.lookup_global_symbol('_PySet_Dummy').value()
1295 # Get a PyStringObject* within the Python 2 gdb process:
1327 # Get the gdb.Value for the (PyObject*) with the given index:
1375 _type_Py_UNICODE = gdb.lookup_type('Py_UNICODE')
1439 # Get a PyUnicodeObject* within the Python 2 gdb process:
1601 if type.code != gdb.TYPE_CODE_PTR:
1611 (gdb) python
1614 sys.path.append('/home/david/coding/python-gdb')
1619 (gdb) python reload(libpython)
1622 if the code is autoloaded by gdb when visiting libpython.so, provided
1624 .debug file) plus a "-gdb.py" suffix, e.g:
1625 /usr/lib/libpython2.6.so.1.0-gdb.py
1626 /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
1630 obj = gdb
1635 register (gdb.current_objfile ())
1639 # Unfortunately, the exact API exposed by the gdb module varies somewhat
1645 Wrapper for gdb.Frame, adding various methods
1667 Not all builds have a gdb.Frame.select method; seems to be present on Fedora 12
1671 'this build of gdb does not expose a gdb.Frame.select method')
1712 So we reject those with type gdb.INLINE_FRAME
1714 if self._gdbframe.type() == gdb.NORMAL_FRAME:
1802 _gdbframe = gdb.selected_frame()
1813 except gdb.error:
1886 class PyList(gdb.Command):
1899 gdb.Command.__init__ (self,
1901 gdb.COMMAND_FILES,
1902 gdb.COMPLETE_NONE)
1923 print('Unable to locate gdb frame for python bytecode interpreter')
2000 class PyUp(gdb.Command):
2003 gdb.Command.__init__ (self,
2005 gdb.COMMAND_STACK,
2006 gdb.COMPLETE_NONE)
2012 class PyDown(gdb.Command):
2015 gdb.Command.__init__ (self,
2017 gdb.COMMAND_STACK,
2018 gdb.COMPLETE_NONE)
2024 # Not all builds of gdb have gdb.Frame.select
2025 if hasattr(gdb.Frame, 'select'):
2029 class PyBacktraceFull(gdb.Command):
2032 gdb.Command.__init__ (self,
2034 gdb.COMMAND_STACK,
2035 gdb.COMPLETE_NONE)
2051 class PyBacktrace(gdb.Command):
2054 gdb.Command.__init__ (self,
2056 gdb.COMMAND_STACK,
2057 gdb.COMPLETE_NONE)
2074 class PyPrint(gdb.Command):
2077 gdb.Command.__init__ (self,
2079 gdb.COMMAND_DATA,
2080 gdb.COMPLETE_NONE)
2108 class PyLocals(gdb.Command):
2111 gdb.Command.__init__ (self,
2113 gdb.COMMAND_DATA,
2114 gdb.COMPLETE_NONE)