ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> visualpython-discuss
visualpython-discuss
Re: [Visualpython-discuss] Debugging Python extensions with Visual Studio
by Robert Ferrell other posts by this author
Nov 5 2003 12:18AM messages near this date
view in the new Beta List Site
Re: [Visualpython-discuss] Debugging Python extensions with Visual Studio | [Visualpython-discuss] Sophos Acquires Anti-Spam Specialist ActiveState
Okay, I think I'm getting the hang of this.  Thanks for the help.

I have a couple more questions.

1. What is the appropriate organization of Python modules and packages
into Visual Studio projects and solutions?  I'm used to developing
heirarchies of packages.  A directory corresponds to a package, and each
directory contains supporting Python module files.  Should I make each
package it's own project in Visual Python?

2. What is a good way to organized unit testing with Visual Python?  I use
PyUnit (unittest).

3. Finally, these messages aren't showing up on visualpython-discuss.  Has
the archive moved?

Thanks,
-robert

<quote who="Eric Promislow"> 
>  Hello, Robert,
> 
>  I would use a second instance of vs.net to remote-attach to the
>  C++ driver code.  You would have had to install the native remote
>  debugger during setup, which for some inexplicable reason is one
>  of the few C++ components that does not get installed by default,
>  for both vs.net 2002 and 2003.
> 
>  Then I would typically insert a
> 
>    <<::MessageBox(0, _T("testing"), _T("my app name"), MB_OK);>>
> 
>  line near the beginning of the main C entry points I'm interested
>  in debugging.  When you get there, break into the C++ DLL code
>  from the second instance.  Once the debugger is hooked to the code, you
>  can either set breakpoints or hit existing ones.
> 
>  You have to run msvcmon.exe (available via
>  Start Menu\Programs\Microsoft Visual Studio .NET\Visual Studio .NET
>  Tools\ Remote Debug Monitor from the 2002 start menu, similar steps for
>  2003) before you can attach with the Debug|Processes dialog.
> 
>  Regards,
>  Eric
> 
>  On Thu, Oct 30, 2003 at 03:35:11PM -0500, Robert Ferrell wrote:
> > I'm trying to debug a Python extension written in C.  I'm on Windows
> > 2000.
> >  I'm using Visual Studio .NET 2003, ActivePython and Visual Python.  I
> > made a "Solution" with 2 projects.  One of the projects is C code,
> > which contains the code for the extension.  That project builds a DLL.
> >  The other project contains a Python driver script which imports the
> > extension, and then calls methods in the extension.
> >
> > The problem I'm having is I have not found a way to debug the Python
> > driver script and the C extension code at the same time.  I can either
> > debug the Python driver or the extension, but not both.  If I set the
> > startup project to be the driver, then I can step through the Python.
> > But, I cannot step into my C code, and if I set breakpoints in the C
> > code they are ignored.  OR, I can set the startup project to be the
> > extension DLL, in which case I can step through the C code, but cannot
> > pop out to the driver script and see what is going on in the Python.
> >
> > How can I debug both pieces of code at the same time?
> >
> > thanks,
> > -robert
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Visualpython-discuss mailing list
> > Visualpython-discuss@[...].com
> > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Robert Ferrell
Eric Promislow
Robert Ferrell

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved