[Python-checkins] devguide: Give an example backtrace
antoine.pitrou
python-checkins at python.org
Thu Jan 20 21:17:54 CET 2011
antoine.pitrou pushed b3be5d9849cc to devguide:
http://hg.python.org/devguide/rev/b3be5d9849cc
changeset: 163:b3be5d9849cc
tag: tip
user: Antoine Pitrou <solipsis at pitrou.net>
date: Thu Jan 20 21:17:49 2011 +0100
summary:
Give an example backtrace
files:
gdb.rst
diff --git a/gdb.rst b/gdb.rst
--- a/gdb.rst
+++ b/gdb.rst
@@ -22,6 +22,29 @@
root directory of your checkout. Read the module docstring for details on how
to use the file to enhance gdb for easier debugging of a CPython process.
+This is what a backtrace looks like (truncated) when this extension is
+enabled::
+
+ #0 0x000000000041a6b1 in PyObject_Malloc (nbytes=Cannot access memory at address 0x7fffff7fefe8
+ ) at Objects/obmalloc.c:748
+ #1 0x000000000041b7c0 in _PyObject_DebugMallocApi (id=111 'o', nbytes=24) at Objects/obmalloc.c:1445
+ #2 0x000000000041b717 in _PyObject_DebugMalloc (nbytes=24) at Objects/obmalloc.c:1412
+ #3 0x000000000044060a in _PyUnicode_New (length=11) at Objects/unicodeobject.c:346
+ #4 0x00000000004466aa in PyUnicodeUCS2_DecodeUTF8Stateful (s=0x5c2b8d "__lltrace__", size=11, errors=0x0, consumed=
+ 0x0) at Objects/unicodeobject.c:2531
+ #5 0x0000000000446647 in PyUnicodeUCS2_DecodeUTF8 (s=0x5c2b8d "__lltrace__", size=11, errors=0x0)
+ at Objects/unicodeobject.c:2495
+ #6 0x0000000000440d1b in PyUnicodeUCS2_FromStringAndSize (u=0x5c2b8d "__lltrace__", size=11)
+ at Objects/unicodeobject.c:551
+ #7 0x0000000000440d94 in PyUnicodeUCS2_FromString (u=0x5c2b8d "__lltrace__") at Objects/unicodeobject.c:569
+ #8 0x0000000000584abd in PyDict_GetItemString (v=
+ {'Yuck': <type at remote 0xad4730>, '__builtins__': <module at remote 0x7ffff7fd5ee8>, '__file__': 'Lib/test/crashers/nasty_eq_vs_dict.py', '__package__': None, 'y': <Yuck(i=0) at remote 0xaacd80>, 'dict': {0: 0, 1: 1, 2: 2, 3: 3}, '__cached__': None, '__name__': '__main__', 'z': <Yuck(i=0) at remote 0xaace60>, '__doc__': None}, key=
+ 0x5c2b8d "__lltrace__") at Objects/dictobject.c:2171
+
+(notice how the dictionary argument to ``PyDict_GetItemString`` is displayed
+as its ``repr()``, rather than an opaque ``PyObject *`` pointer)
+
+
.. note: This is only available for Python 2.7, 3.2 and higher.
gdb 6 and earlier
--
Repository URL: http://hg.python.org/devguide
More information about the Python-checkins
mailing list