Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
debug cython extension in windows 7
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
martinako  
View profile  
 More options Oct 10 2012, 7:21 am
From: martinako <martin.to...@gmail.com>
Date: Wed, 10 Oct 2012 04:21:47 -0700 (PDT)
Local: Wed, Oct 10 2012 7:21 am
Subject: debug cython extension in windows 7

Hi,

I posted this question in stackoverflow a few days ago but I'm not getting
any answer. I though to try again here.

I'm trying to debug a cython extension module. I have been following the
instructions inhttp://docs.cython.org/src/userguide/debugging.html As I'm
using windows 7 I can't do a apt-get install to get a debug build of python
(as indicated in the userguide). So when I run cygdb I use python instead
of python-dbg

Inside gdb (with python support, ie. gdb-python27.exe) I can set a break
point with cy break module.function and I can run the python script that
uses the pyd with cy run . However, execution doesn't stop at the set
breakpoint, and continues until it crashes (that's what I'm trying to
debug) producing a traceback If I do cy step or cy bt or cy list it
complains with "No frame is currently selected."

Does anybody know what's going on? I suspect it maybe I need a python build
with debug symbols. If that's the case does anybody know where could I
download such a build for windows 7?

Thanks


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
martinako  
View profile  
 More options Dec 10 2012, 8:07 pm
From: martinako <martin.to...@gmail.com>
Date: Mon, 10 Dec 2012 17:07:32 -0800 (PST)
Local: Mon, Dec 10 2012 8:07 pm
Subject: Re: debug cython extension in windows 7

I've tried many things to get this working but without success. The nearest
I got is to debug the c code generated by cython, but that's not human
readable (at least not this human) so it's not much use.
I guess I have to accept that cython debugging under windows is not
possible using cygdb.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Bradshaw  
View profile  
 More options Dec 10 2012, 8:30 pm
From: Robert Bradshaw <rober...@gmail.com>
Date: Mon, 10 Dec 2012 17:30:32 -0800
Local: Mon, Dec 10 2012 8:30 pm
Subject: Re: [cython-users] Re: debug cython extension in windows 7
I'm sure it's possible, but I haven't used Windows for so long I (nor
do I have access to a Windows machine) so wouldn't have a clue how. I
know there are plenty of other Cython Windows users out there,
hopefully one of them could give some advice.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Bell  
View profile  
 More options Dec 11 2012, 3:25 am
From: Ian Bell <ian.h.b...@gmail.com>
Date: Tue, 11 Dec 2012 09:25:15 +0100
Local: Tues, Dec 11 2012 3:25 am
Subject: Re: [cython-users] Re: debug cython extension in windows 7

Debugging on windows is really not super possible or easy.  God forbid you
need matplotlib or numpy.  If you need numpy or matplotlib you basically
must debug on linux since getting debug builds of numpy is nigh impossible
as far as I can tell on windows.  It is possible to build your own debug
version of Python on windows using the visual studio project ( I have had
to do this before), and then go through the debugging.  Honestly, I found
it easier to do everything on linux as you can

a) build your own debug version of python without too much pain
b) use virtualenv to create an environment for your python debug version so
it doesn't mess up your paths
c) Use gdb with Eclipse to debug

To be fair this was when my extensions were SWIG wrappers, but all the same
arguments apply with cython.

Best of luck.
Ian


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mark florisson  
View profile  
 More options Dec 11 2012, 5:43 am
From: mark florisson <markflorisso...@gmail.com>
Date: Tue, 11 Dec 2012 10:43:03 +0000
Local: Tues, Dec 11 2012 5:43 am
Subject: Re: [cython-users] debug cython extension in windows 7
On 10 October 2012 12:21, martinako <martin.to...@gmail.com> wrote:

Yeah, that means it really cannot find any frame. Does the process
still have a stack?

cy break really uses gdb's 'break'. What does it say? Are you using
pending breakpoints? What about using gdb's break with the mangled C
symbol?

You're right in saying you need python with debug symbols, without is
pretty hard to debug, although you can still debug your Cython
extensions if they are compiled with debug support. cygdb was never
tested on Windows I'm afraid...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
martinako  
View profile  
 More options Dec 11 2012, 8:03 am
From: martinako <martin.to...@gmail.com>
Date: Tue, 11 Dec 2012 05:03:14 -0800 (PST)
Local: Tues, Dec 11 2012 8:03 am
Subject: Re: [cython-users] debug cython extension in windows 7

Thanks for your replies. I've had a go again taking into account your
replies but still without success.

What I've tried:

I build python_d.exe (debug version in windows) using visual studio 2008
express. However, this has the problem that this interpreter would only
import *_d.pyd and I'm using many libraries, including numpy and
matplotlib, so I think it's infeasible to attempt to build them all as
debug versions.

 So what I tried instead is to build python.exe in Release mode but disable
optimizations and make sure there is debug symbols for the compile and link
steps. The idea was to use it with the rest of release libraries but as the
interpreter itself has debug symbols I thought there maybe a better chance
to work with cygdb.py. At the end I just renamed my python.exe and drop the
new compiled exe dll pdbs libs on my python installation (I tried to create
a new virtualenv for a debug version and duplicate my python setup using
pip frezee and pip install, but install would be able to find many
packages, I guess because they were originally installed with a windows
installer rather than pip).

 Then I run cygdb with a python script that loads a .pyd (build with debug
symbols and no optimizations, but crucially no --debug because that
generates a *_d.pyd). As in my initial post, I can put a breakpoint at a
function that I call in the pyd and run the script that calls my pyd. This
executes fine but gdb doesn't stop at the breakpoint. Finally, if I write
backtrace, up, or down I get a "No stack".

 This time I realised that when I set the break point with cy break or just
break it complains the function is not defined. sorry I forgot about this
message. The same message happens if I try to set a break point using the
mangled C++ name of the function.

 Don't know what else to do. For the moment I go by debugging with print
statements. Maybe I'll try to install a linux distribution after xmas and
see if how it goes with it.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mark florisson  
View profile  
 More options Dec 11 2012, 9:09 am
From: mark florisson <markflorisso...@gmail.com>
Date: Tue, 11 Dec 2012 14:09:28 +0000
Local: Tues, Dec 11 2012 9:09 am
Subject: Re: [cython-users] debug cython extension in windows 7
On 11 December 2012 13:03, martinako <martin.to...@gmail.com> wrote:

You need to enable pending breakpoints, although IIRC cygdb does that.
Try 'set breakpoint pending on'.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
martinako  
View profile  
 More options Dec 11 2012, 11:25 am
From: martinako <martin.to...@gmail.com>
Date: Tue, 11 Dec 2012 08:25:32 -0800 (PST)
Local: Tues, Dec 11 2012 11:25 am
Subject: Re: [cython-users] debug cython extension in windows 7

I've just tried 'set breakpoint pending on' after setting a break point but
it still doesn't stop at the breakpoint.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »