how to debug python's extend module written in c/c++ on windows

T

tcfg

dear all:

I have searched the debug informations of many python's IDE, but I
cannot find the method about debuging the extend module written in
Visual studio 2008 on windows.
The wingIDE tell me that we can debug the extend module on linux, but
cannot on windows. and using wingdbstub.py we can embed python into
other's source code but not extending.
Who can tell me the skills, I appreciate!


best regards

fang
2008.07.17
 
D

Diez B. Roggisch

dear all:

I have searched the debug informations of many python's IDE, but I
cannot find the method about debuging the extend module written in
Visual studio 2008 on windows.
The wingIDE tell me that we can debug the extend module on linux, but
cannot on windows. and using wingdbstub.py we can embed python into
other's source code but not extending.
Who can tell me the skills, I appreciate!

I use plain gdb (aka the C-debugger) for this purpose. Create a small
test-script that exposes the error you want to debug, and then start the
python interpreter in the debugger. Set breakpoints, or watch backtraces.

I can't comment on how that works on VS08 though - but it shouldn't be
to hard.

Diez
 
T

tcfg

dear Diez:

I need step into c function in extending module(DLL) when debugging
the script. and I want Single-step debugging the extend module itself,
but python script Launched The whole process.

best regards

fang
 
D

Diez B. Roggisch

dear Diez:

I need step into c function in extending module(DLL) when debugging
the script. and I want Single-step debugging the extend module itself,
but python script Launched The whole process.

That is exactly what attaching a C-debugger to python will give you. Did
you actually try it? Do you know how to debug C-programs?

Diez
 
F

fang

Dear Diez:

It is attaching a C-debugger to python. I can attach python-
debugger(for example:wingIDE) to c-debugger(for example:VS2008), but I
cannot attach VS2008 to wingIDE. I need both python statement and c
statement can be single-step debugged.

best regards

fang
 
D

Diez B. Roggisch

fang said:
Dear Diez:

It is attaching a C-debugger to python. I can attach python-
debugger(for example:wingIDE) to c-debugger(for example:VS2008), but I
cannot attach VS2008 to wingIDE. I need both python statement and c
statement can be single-step debugged.

AFAIK that's not possible. First of all, *don't* attach VS2008 to WingIDE,
use VS2008 to start a python-interpreter with commandline-args (at least
that's how it works for me in gdb)

And then write only small python-scripts that expose an actual error in the
DLL, and debug these.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top