Quantcast

[C++-sig] debugging c++ extension

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[C++-sig] debugging c++ extension

Nariman Habili
Thanks for your reply. I've followed your instructions and I get the
following outputs:

$gdb python

GNU gdb 2003-09-20-cvs (cygwin-special)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...(no debugging symbols
found)...
(gdb) run
Starting program: /cygdrive/c/Python23/python.exe
Enthought Edition build 1057
Python 2.3.3 (#51, Feb 16 2004, 04:07:52) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.

(gdb) run

Starting program: /cygdrive/c/Python23/python.exe
Enthought Edition build 1057
Python 2.3.3 (#51, Feb 16 2004, 04:07:52) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.

>>import my_module

Hit "Ctrl-C"

Program received signal SIGINT, Interrupt.
[Switching to thread 3920.0x6dc]
0x7c874fed in KERNEL32!GetConsoleCharType () from
/cygdrive/c/WINDOWS/system32/kernel32.dll

(gdb) b my_module.cc:200

No symbol table is loaded.  Use the "file" command.

I'm using windows xp. I'm wondering, does my_module.cc have to be in the
same directory as my_module.obj and my_module.pyd? I'm compiling my c++
extension with the "debug" flag set.

Regards,
Nari


_______________________________________________
C++-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/c++-sig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [C++-sig] debugging c++ extension

skottmckay
What if you try the suggested methods in the FAQ?

http://www.boost.org/libs/python/doc/v2/faq.html

The basic steps required to initiate a gdb session to debug a c++ library via python are shown here. Note, however that you should start the gdb session in the directory that contains your BPL my_ext.so module.

(gdb) target exec python
(gdb) run
>>> from my_ext import *
>>> [C-c]
(gdb) break MyClass::MyBuggyFunction
(gdb) cont
>>> pyobj = MyClass()
>>> pyobj.MyBuggyFunction ()
Breakpoint 1, MyClass::MyBuggyFunction ...
Current language: auto; currently c++
(gdb) do debugging stuff


On 9/7/05, Nariman Habili <[hidden email]> wrote:
Thanks for your reply. I've followed your instructions and I get the
following outputs:

$gdb python

GNU gdb 2003-09-20-cvs (cygwin-special)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...(no debugging symbols
found)...
(gdb) run
Starting program: /cygdrive/c/Python23/python.exe
Enthought Edition build 1057
Python 2.3.3 (#51, Feb 16 2004, 04:07:52) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.

(gdb) run

Starting program: /cygdrive/c/Python23/python.exe
Enthought Edition build 1057
Python 2.3.3 (#51, Feb 16 2004, 04:07:52) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.

>>import my_module

Hit "Ctrl-C"

Program received signal SIGINT, Interrupt.
[Switching to thread 3920.0x6dc]
0x7c874fed in KERNEL32!GetConsoleCharType () from
/cygdrive/c/WINDOWS/system32/kernel32.dll

(gdb) b my_module.cc:200

No symbol table is loaded.  Use the "file" command.

I'm using windows xp. I'm wondering, does my_module.cc have to be in the
same directory as my_module.obj and my_module.pyd? I'm compiling my c++
extension with the "debug" flag set.

Regards,
Nari


_______________________________________________
C++-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/c++-sig


_______________________________________________
C++-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/c++-sig
Loading...