i have a script which is seg faulting and leaving behind a .core file, i'd like to look at it and see if it can help me find the problem but i can't use scripts with gdb? is there something else i can use?
Quoting Timothy Smith <timothy@open-networks.net>:
i have a script which is seg faulting and leaving behind a .core file,
i'd like to look at it and see if it can help me find the problem but i
can't use scripts with gdb? is there something else i can use?
You could try running gdb on the python executable and the core file. That
would at least give you a starting point to work from. After that, you might
be able to invoke the script as an argument to the 'run' gdb command. This is
all conjecture, I haven't tried it, but that's where I'd start with a core
file.
HTH,
- Bill
<>< ><> <>< ><> <>< ><> <>< ><> <>< ><> <>< ><> <><
Bill Woodward (wpwood@saifa.net)
http://www.saifa.net
···
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Timothy Smith wrote:
i have a script which is seg faulting and leaving behind a .core file, i'd like to look at it and see if it can help me find the problem but i can't use scripts with gdb? is there something else i can use?
Bill's advice was right on target. Here is how I usually do it when I get a core file:
$ gdb /usr/bin/python
(gdb) core /path/to/corefile
(gdb) bt
Then it prints out a dump of the C stack. Depending on your python and gtk builds it may or may not be helpful. If the debug info has been stripped then you may not get much of a stack. I often will run with a python that I have built myself so I know that the debug info is still present.
You can also run the python app within the debugger and then the debugger will automatically stop when any exceptions happen. Or you can add calls to wx.Trap() in your python code and that will also cause the debugger to stop at that point.
Finally, take a look at this stuff here for some useful gdb macros that you can put in your ~/.gdbinit:
···
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!