Changes between Version 9 and Version 10 of TracTroubleshooting
- Timestamp:
- Mar 24, 2012, 4:40:33 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracTroubleshooting
v9 v10 84 84 In this case, the first thing to do is to identify the subsystem involved, by getting the ''stack trace'' of the process. This can be done using `gdb` on Unix or [http://www.microsoft.com/whdc/devtools/debugging/default.mspx WinDbg] on Windows (or MS Developer Studio). 85 85 86 With GDB, you can also make the link between the C stack trace and the Python backtrace. For this, you need to teach `gdb` a few additional commands: Get the following [http:// svn.python.org/view/python/trunk/Misc/gdbinit gdbinit] script, and "source" it.86 With GDB, you can also make the link between the C stack trace and the Python backtrace. For this, you need to teach `gdb` a few additional commands: Get the following [http://hg.python.org/cpython/file/2.7/Misc/gdbinit gdbinit] script, and "source" it. 87 87 You should be able to issue interesting commands like `pystack`, `pyframe`, `pylocals`, etc. 88 89 If you're using a gdb 7.x version built "`--with-python`", you can instead "`source`" [http://hg.python.org/cpython/file/2.7/Tools/gdb/libpython.py libpython.py] and use `py-bt` (see also [http://sourceware.org/gdb/current/onlinedocs/gdb/Python.html Scripting gdb using Python]). 88 90 89 91 ==== Debugging Segmentation Faults ==== … … 146 148 147 149 The `bt` command is what gives you the "backtrace" of the program, usually the most interesting bit of information. You can also resume execution of the program (using `cont`) and interrupt the process a bit later, to see if it remains hanged in the same area. In case there's no hang (you "attached" to it just for curiosity), you can also `detach` from the process and it will continue to work unaffected. 148