debuging in shared library (using gdb or ddd)

Michael P. Reilly arcege at shore.net
Mon Nov 8 20:04:58 CET 1999


> Hi!
> 
> How can I debug a shared library module imported into python
> 
> with gdb or ddd debugger ?

I often start gdb with python, run the program getting an interactive
shell, import the appropriate module(s) or package(s).  Then I interrupt
the process (cntl-C), which is captured first by GDB, not Python, set
my breakpoints and finally "cont"inue the interactive interpreter:

$ gdb python
...
(gdb) run
...
>>> import foobar
>>> <cntl-c>
(gdb) break foobar_function
(gdb) cont
Continuing.
<return>
>>>

There may be some configurations where this won't work (threads, etc.),
but I've used it on a lot of systems this way.

  -Arcege





More information about the Python-list mailing list