Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Debugging of a long running process under Windows

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


npropadovic at googlemail

Jul 31, 2008, 6:55 AM

Post #1 of 5 (132 views)
Permalink
Debugging of a long running process under Windows

Hello,
I know this issue pops up once in a while, but I haven't found a good
answer to it. I need to debug a long running application under
windows. The application is a combined java/python framework for
testing ECUs in the automotive industry. Basically, the Java GUI
(Eclipse-based) starts test-cases written in Python and provides the
console where the test-logs are seen. When there is a exception
somewhere in the testcases (or the underlying functionallity, also
written in Python), those are also logged, and then the framework
usually continues with the next command in the same test case.
I'd like to have a debugging facillity better than print statements. I
imagine:
a) something like a debugger poping up when I get an exception, or b)
something debugger-like poping up when it reaches a command I entered
something in the code,
or c) Me pressing on a button and getting a debugger-like-thing that
lets me look into the running, possibly halted code.
I've done some little experiments with the code module, which looks
nice but does not seem to get over the control from the java-part, and
with popen2("cmd"), which seems not even to work if I start the code
from a dosbox (the same console is keept), and same thing when strated
by the Java-App.
Just to add, using pdb (or pythonwin debugger) seems not to be an
option, as it makes the test-runs much slower.
Does somebody have an idea? It seems there used to be a python
debugger called Pygdb, able to attach to a running application, but
now it seems it disapeared (now there is a python debugger with the
same name, linked to ViM).
Thanx,
Propad
--
http://mail.python.org/mailman/listinfo/python-list


rocky at panix

Aug 20, 2008, 7:42 PM

Post #2 of 5 (101 views)
Permalink
Re: Debugging of a long running process under Windows [In reply to]

I don't know how well Microsoft Windows allows for sending a process a
signal in Python, but if the Python signal module works reasonably
well on Microsoft Windows, then reread
http://bashdb.sourceforge.net/pydb/pydb/lib/node38.html

Should you not want to use or can't use pydb, or want to do this with
sockets, then basically you do the same thing that pydb is doing here,
substituting sockets if you like.

The basic ideas that were discussed in:

http://groups.google.com/group/comp.unix.shell/browse_thread/thread/87c3f728476ed29d

The discussion was in the context of shell languages, but it is
equally applicable in Python.

Good luck!


Propad <npropadovic[at]googlemail.com> writes:

> Hello,
> I know this issue pops up once in a while, but I haven't found a good
> answer to it. I need to debug a long running application under
> windows. The application is a combined java/python framework for
> testing ECUs in the automotive industry. Basically, the Java GUI
> (Eclipse-based) starts test-cases written in Python and provides the
> console where the test-logs are seen. When there is a exception
> somewhere in the testcases (or the underlying functionallity, also
> written in Python), those are also logged, and then the framework
> usually continues with the next command in the same test case.
> I'd like to have a debugging facillity better than print statements. I
> imagine:
> a) something like a debugger poping up when I get an exception, or b)
> something debugger-like poping up when it reaches a command I entered
> something in the code,
> or c) Me pressing on a button and getting a debugger-like-thing that
> lets me look into the running, possibly halted code.
> I've done some little experiments with the code module, which looks
> nice but does not seem to get over the control from the java-part, and
> with popen2("cmd"), which seems not even to work if I start the code
> from a dosbox (the same console is keept), and same thing when strated
> by the Java-App.
> Just to add, using pdb (or pythonwin debugger) seems not to be an
> option, as it makes the test-runs much slower.
> Does somebody have an idea? It seems there used to be a python
> debugger called Pygdb, able to attach to a running application, but
> now it seems it disapeared (now there is a python debugger with the
> same name, linked to ViM).
> Thanx,
> Propad
--
http://mail.python.org/mailman/listinfo/python-list


mail at timgolden

Aug 21, 2008, 2:10 AM

Post #3 of 5 (106 views)
Permalink
Re: Debugging of a long running process under Windows [In reply to]

R. Bernstein wrote:
> I don't know how well Microsoft Windows allows for sending a process a
> signal in Python, but if the Python signal module works reasonably
> well on Microsoft Windows, then reread
> http://bashdb.sourceforge.net/pydb/pydb/lib/node38.html

The answer is: not terribly well. (Or, rather: in a very
limited way). You should, however, be able to make use
of the SetConsoleCtrlHandler win32 api which is exposed
by pywin32's win32api module, or could be accessed via
ctypes:

http://timgolden.me.uk/pywin32-docs/win32api__SetConsoleCtrlHandler_meth.html
http://msdn.microsoft.com/en-us/library/ms686016(VS.85).aspx

TJG
--
http://mail.python.org/mailman/listinfo/python-list


rocky at panix

Aug 21, 2008, 3:02 AM

Post #4 of 5 (111 views)
Permalink
Re: Debugging of a long running process under Windows [In reply to]

Tim Golden <mail[at]timgolden.me.uk> writes:

> R. Bernstein wrote:
>> I don't know how well Microsoft Windows allows for sending a process a
>> signal in Python, but if the Python signal module works reasonably
>> well on Microsoft Windows, then reread
>> http://bashdb.sourceforge.net/pydb/pydb/lib/node38.html
>
> The answer is: not terribly well. (Or, rather: in a very
> limited way). You should, however, be able to make use
> of the SetConsoleCtrlHandler win32 api which is exposed
> by pywin32's win32api module, or could be accessed via
> ctypes:
>
> http://timgolden.me.uk/pywin32-docs/win32api__SetConsoleCtrlHandler_meth.html
> http://msdn.microsoft.com/en-us/library/ms686016(VS.85).aspx
>
> TJG

Interesting. Yes, it seems limited in that you get CTRL+C or
CTRL+BREAK which seems to map to one of CTRL_CLOSE_EVENT,
CTRL_LOGOFF_EVENT, or CTRL_SHUTDOWN_EVENT signals.

If someone is interested in hooking this into pydb's signal handling
mechanism, I'll consider adding in a future release. (If hacking the
configure script to test for the presense Microsoft Windows or the
win32api is tedious, I can manage doing that part.)
--
http://mail.python.org/mailman/listinfo/python-list


npropadovic at googlemail

Aug 21, 2008, 4:49 AM

Post #5 of 5 (99 views)
Permalink
Re: Debugging of a long running process under Windows [In reply to]

Hello,

thank you very much everybody. I gave up hope for an answer a long
time ago :-).
I'll take a look at the proposed solutions and give you a note.

Cheers,

Propad

On Aug 21, 12:02 pm, ro...@panix.com (R. Bernstein) wrote:
> Tim Golden <m...@timgolden.me.uk> writes:
> > R. Bernstein wrote:
> >> I don't know how well Microsoft Windows allows for sending a process a
> >> signal in Python, but if the Python signal module works reasonably
> >> well on Microsoft Windows, then reread
> >>http://bashdb.sourceforge.net/pydb/pydb/lib/node38.html
>
> > The answer is: not terribly well. (Or, rather: in a very
> > limited way). You should, however, be able to make use
> > of the SetConsoleCtrlHandler win32 api which is exposed
> > by pywin32's win32api module, or could be accessed via
> > ctypes:
>
> >http://timgolden.me.uk/pywin32-docs/win32api__SetConsoleCtrlHandler_m...
> >http://msdn.microsoft.com/en-us/library/ms686016(VS.85).aspx
>
> > TJG
>
> Interesting. Yes, it seems limited in that you get CTRL+C or
> CTRL+BREAK which seems to map to one of CTRL_CLOSE_EVENT,
> CTRL_LOGOFF_EVENT, or CTRL_SHUTDOWN_EVENT signals.  
>
> If someone is interested in hooking this into pydb's signal handling
> mechanism, I'll consider adding in a future release. (If hacking the
> configure script to test for the presense Microsoft Windows or the
> win32api is tedious, I can manage doing that part.)- Hide quoted text -
>
> - Show quoted text -

--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.