Archaeopteryx Software, Inc.
Take Flight!Search

Wing IDE
About Us
Open Source

 Advanced Search

[wingide-users] debugging COM servers
Tue, 5 Mar 2002 12:22:33 -0500

I've encountered two problems that prevented me from being able to use this
debugging technique (more generically, where the python environment is
started outside the control of the WingIDE debugger). And I discovered the
steps needed to overcome them, in my specific case at least.

1) I version 1.1.2 of Wing IDE, the "attach to an already-running debug
process" command did not work. It did not bring up the "attach to debug
process" dialog.

my fix:
I uninstalled 1.1.2 and reinstalled 1.1.1, and now it works. I'm not
certain whether this is Wing IDE version related or if installing fresh
somehow mysteriously fixed the problem.

2) Python 2.1.1 did not have a debugging support folder in the standard
Wing IDE installation.

my fix:
In my case, WingIDE is installed in C:\Program Files\Wing IDE.
In that directory, the bin directory contained a 2.1.0 directory, but not a
2.1.1 directory. So I copied the 2.1.0 directory and renamed it to 2.1.1.
This allowed me to connect to the debugger when running a python script by
calling the python21.dll from C++ or C#. This seemed like a kludgy solution
but it worked. If there is a more dependable way (perhaps to build a custom
2.1.1 folder from first principles), I hope archaeopteryx will consider
supplying such a directory in future releases.

I'm posting this in case it may help someone else who has run into either
of these problems.
Also, I'm hoping someone may add their insight into teh situation's I



                    Wing IDE Support                                                                    
                    <>             To:     Craig Morris <>          
                    Sent by:                          cc:     <>               
                    wingide-users-admin@archaeo       Subject:     Re: [wingide-users] debugging COM    
                    03/01/2002 12:07 PM                                                                 

On Fri, 1 Mar 2002, Craig Morris wrote:
> It is my curse to have to occasionally debug python code that is
> functioning as a Windows COM server using Mark Hammond's excellent
> stuff.  I was wondering if anyone has figured out a way to use Wing to
> debug such a beast (the com server code is externally started from
> something like a VB client).  I tried the default wingdbstub and that did
> not work, although it is quite likely I was doing something wrong.
> Any pointers would be most gratefully received.

Did you read through the manual section debugging externally launched
code?  The steps are basically:

- Make sure the WINGHOME value is set right in
- Copy over to where your COM server code is
- Add an 'import wingdbstub' in a place that gets executed before
  the code you want to debug
- Turn on passive listen in Wing from the Debug / Network Mode menu
- Set a breakpoint in Wing IDE
- Launch the COM server code... it should stop at the breakpoint
  or at least the debug status area in the top of Wing's windows
  should change to "Debugger: Program Running"

I'm assuming you're running Wing and the debug process on the same
machine.  If not, there are additional steps needed.

You can diagnose problems by setting kSilent=0 in and by
starting Wing from the command line with console_wing.exe (which will
outputs extra debug info).  The output is pretty verbose but if you send
it to we can likely figure out where the problem lies.

Hope that helps... please let us know if not.


- Stephan

Archaeopteryx Software, Inc.
Wing IDE discussion list

Run by Mailman v 2.0.8

Copyright (c) 2000-2002, Archaeopteryx Software, Inc.
Legal Statements