[wingide-users] Can't attach debugger to remote process

Daniel Tavares daniel.tavares at slipg8.com
Wed Apr 8 15:31:42 MDT 2009


Hey Stephan,

BigWorld uses CPython.

I get the kEvalError when importing wingdbstub through a console, on the
running python embedded process.

I decided to step back a bit and try to remote debug a standalone
script. I've attached the script so maybe you can reproduce the problem
that I'm running into, along with a copy of wingdbstub that I've been
using.

This is what I'd like to be able to do:

1. Start remote process ( This is running on a Linux box on the same
network as my machine). This attaches the remote debugger
2. Detach from the process from Wing: Debug->Detach from Process
3. Reattach the debugger from Wing. Debug->Attach to Process

At this point, wing fails to attach the debugger and prints the
following message on the "Messages" tool window, in Wing:

No debug process / not listening for connections
No debug process / listening for connections on TCP/IP port 50005
Allowed hosts:  10.10.11.23, 127.0.0.1

I've also noticed that if I press Ctrl+Z to close the process, the
socket used by the debugger isn't properly closed and I need to restart
Wing in order to get it to connect again. I understand that I need to
call wingdbstub.debugger.ProgramQuit(), since I have kEmbedded = 1. But
is there anything else I can do to prevent the debugger from properly
shutdown, in case of a non-graceful shutdown?

Thanks,

Daniel Tavares
Programmer | Slipgate Ironworks
http://www.slipg8.com


-----Original Message-----
From: Wingware Support [mailto:support at wingware.com] 
Sent: Wednesday, April 08, 2009 7:14 AM
To: Daniel Tavares
Cc: wingide-users at wingware.com
Subject: Re: [wingide-users] Can't attach debugger to remote process

Daniel Tavares wrote:
> Yes, I can connect to port 50016. I've checked the firewall and it's
not
> blocking anything.
> 
> I tried starting the debugger by importing wingdbstub, then calling
> wingdbstub.debugger.StartDebug(), but the import fails. I get an error
> saying 'module' object has no attribute 'kEvalError'.

Is this the first time through or the second+ time?  It may be the
environment is clearing out modules but not unloading them.  The
kEvalError value is something in a 'constants.py' module that
should load and remain the same.

One idea is to look at sys.modules and perhaps clear out those
loaded by our debugger before doing 'import wingdbstub' again.
I'm not sure off-hand if that will work, but it's what I would
try next if I'm right about this being an issue the 2nd+
invocation.

If it's doing this on the first invocation, then it may be
something in a custom import hook is preventing proper load,
or an earlier error that you didn't see is causing failure
during import.  You may want to set kLogFile to some actual
file and not stdout in case some of that is being swallowed.

Do you know if this is CPython or Stackless Python in
BigWorld?  That may also have some impact, although so far
it seems like a more general failure.

Please let us know if none of this helps.

-- 

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tick.py
Type: application/octet-stream
Size: 312 bytes
Desc: tick.py
Url : /pipermail/wingide-users/attachments/20090408/6803ebe9/tick.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debugger.log
Type: application/octet-stream
Size: 6475 bytes
Desc: debugger.log
Url : /pipermail/wingide-users/attachments/20090408/6803ebe9/debugger.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wingdbstub.py
Type: application/octet-stream
Size: 9243 bytes
Desc: wingdbstub.py
Url : /pipermail/wingide-users/attachments/20090408/6803ebe9/wingdbstub.obj


More information about the wingide-users mailing list