473,372 Members | 1,203 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

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 1847
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
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
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
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
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
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
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
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
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.