[wingide-users] semi automatic gdb launch from wing for C++ extensions debugging

Wing IDE Support support at wingware.com
Mon Apr 30 10:00:44 MDT 2012

Please correct me if I'm mistaken, but the traceback appears to be 
generated in the process being debugged.  Do you get the same exception 
when gdb is run from the command line?  I'm also unclear on whether 
you're trying to attach to an existing process or not.

I generally use an C/C++ IDE (Xcode on OS X, Visual Studio on win32) or 
emacs when debugging C/C++ so I can see the source, the run pointer, set 
breakpoints, etc.  I launch the python program from Wing and then attach 
to it from the C/C++ debugger.  Some hints on how to do this are at 

It would be great to be able to step through C/C++ in Wing, but that's a 
long ways off.  It would require either implementing a C/C++ debugger or 
interfacing with the various platform specific ones.



On 4/30/12 4:37 AM, Aleh Arol wrote:
> Hi,
> I'd like to automate to some extend the task of C++ extensions debug
> (I'm using python ogre and indeed the whole program is c++ extension).
> I googled a way to get debug process pid from wing,  but now I have 2
> issues:
> 1) if I try to use OS Commands and command line contains gdb it
> complains(see below) that my python is not build with pydebug(which is
> correct, this is the one with only -g)
> Traceback (most recent call last):
>    File "/usr/lib/python2.7/site.py", line 562, in<module>
>      main()
>    File "/usr/lib/python2.7/site.py", line 544, in main
>      known_paths = addusersitepackages(known_paths)
>    File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
>      user_site = getusersitepackages()
>    File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
>      user_base = getuserbase() # this will also set USER_BASE
>    File "/usr/lib/python2.7/site.py", line 236, in getuserbase
>      USER_BASE = get_config_var('userbase')
>    File "/usr/lib/python2.7/sysconfig.py", line 543, in get_config_var
>      return get_config_vars().get(name)
>    File "/usr/lib/python2.7/sysconfig.py", line 442, in get_config_vars
>      _init_posix(_CONFIG_VARS)
>    File "/usr/lib/python2.7/sysconfig.py", line 303, in _init_posix
>      makefile = _get_makefile_filename()
>    File "/usr/lib/python2.7/sysconfig.py", line 297, in
> _get_makefile_filename
>      return
> os.path.join(get_path('platstdlib').replace("/usr/local","/usr",1),
> "config" + (sys.pydebug and "_d" or ""), "Makefile")
> AttributeError: 'module' object has no attribute 'pydebug'
> 2) Well, if I imagine issue 1) gone is there any way to tie result of
> wing script to command line arg in OS Command?
> I suspect that I'm going the wrong way and that I don't need an OS
> Comands tool for that, just a script...
> Any suggestions?
> Thanks in advance.

More information about the wingide-users mailing list