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

Aleh Arol aleh.arol at gmail.com
Mon Apr 30 10:43:45 MDT 2012


John,

thanks for the answer.

On 30.04.2012 19:00, Wing IDE Support wrote:
> Please correct me if I'm mistaken, but the traceback appears to be
> generated in the process being debugged.
Yes, however

>   Do you get the same exception when gdb is run from the command line?  
No, I don't that's why I'm asking this question. I can attach via cmd
line to the wing debug process and
debug it as manual suggests.
> I'm also unclear on whether you're trying to attach to an existing
> process or not.
Actually traceback I attached appears if only try to run gdb via OS
Commands tool without running any debug session. But yes, I want to
attach to wing existing debug process.
>
> 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 https://wingware.com/doc/howtos/debug-c-cpp
Thanks, I know that.
>
> 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.
:) I understand, the question is not a request for C/C++ debuggin
support in wing - all I want for now is to automate gdb --attach
<running_wing_debug_process_pid> and use OS Commands console for it(if
it's possible), but at minimum I want to automate debug process pid
substitution + env setup(LD_LIBRARY_PATH, gdb source path substitution,
etc.).
>
> Cheers,
>
> John
>
> 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.
>>
>


-- 
Best regards,
Aleh Arol



More information about the wingide-users mailing list