473,507 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 31 '08 #1
4 1855
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....c3f728476ed29d

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

Good luck!
Propad <np*********@googlemail.comwrites:
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
Aug 21 '08 #2
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/...dler_meth.html
http://msdn.microsoft.com/en-us/libr...16(VS.85).aspx

TJG
Aug 21 '08 #3
Tim Golden <ma**@timgolden.me.ukwrites:
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/...dler_meth.html
http://msdn.microsoft.com/en-us/libr...16(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.)
Aug 21 '08 #4
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.ukwrites:
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/...eCtrlHandler_m...
http://msdn.microsoft.com/en-us/libr...16(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 -
Aug 21 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
3787
by: Gustavo Franco | last post by:
Hi, I did a medium complex application in C#, and in some areas the memory goes up to 60Mb, when I finish I dispose everything and setting everything to null and calling GC.Collect, but the...
16
1721
by: Dean R. Henderson | last post by:
I have a project built for ASP.NET that recently started running really slow in debug mode (it takes about 10 seconds or more to step from one line of code to the next). This just started...
3
5501
by: Steve Wark | last post by:
I have a Windows 2003 Web server on which I was debugging remotely with no problems. I then moved this server to a different domain and now remote debugging will not work, the error is; ...
0
3203
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
16
4173
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
7
3145
by: Frank | last post by:
I'm running a mixed ASP / ASP.NET environment. I can use the debugger in for the ASP.NET code, no problems. But when I turn on ASP Debugging for the project, I get the error message: "Error...
5
3612
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
10
1949
by: Doug Robertson | last post by:
First off, I'm a hardware/OS guy. I just write code on the side and I'm completely self taught - so bear in mind my total lack of expertise. I have a program originally written in VB2003 using...
3
6610
by: Yves Gagnon | last post by:
Hi, I try to debug a WCF hosted in a windows services on a serveur that is on an other domaine then my developpement machine. I tried many things without succes. Here is what I tried: First I...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.