473,513 Members | 2,561 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

attaching debugger to runinng python program

alf
Hi,

I have a two fold question:
-how to attach the debugger to running multi threaded program
-the objective is to find an infinite loop in one of threads which
makes the whole thingy going craze (100%CPU)

The program itself is not easy, in fact quite hude and sometimes it
takes hours to get to that infloop state.

Any insight?

Andy
Jul 14 '06 #1
4 2284

alf wrote:
Hi,

I have a two fold question:
-how to attach the debugger to running multi threaded program
-the objective is to find an infinite loop in one of threads which
makes the whole thingy going craze (100%CPU)

The program itself is not easy, in fact quite hude and sometimes it
takes hours to get to that infloop state.
On linux:

% python
>>import os
os.getpid()
54321

Now, in another shell,
% gdb
(gdb) attach 54321

If you want debugging symbols, recompile python with -g.

Jul 14 '06 #2
alf
Bill Pursell wrote:
Now, in another shell,
% gdb
(gdb) attach 54321
Thx for the reply. But I wish to debug the python program, not python
interpreter itself.
Jul 14 '06 #3

alf wrote:
Bill Pursell wrote:
Now, in another shell,
% gdb
(gdb) attach 54321

Thx for the reply. But I wish to debug the python program, not python
interpreter itself.
I haven't used this, but it looks like it's worth a try:

http://hapdebugger.sourceforge.net/

Jul 14 '06 #4
You may try winpdb.
I find it to be a comfortable debugger that also can attach to running
programs. (You need to add a line in your code where the program should
stop and wait for the debugger to attach.)
I am satisfied with it, but I did not debug a multi theaded app.
However, it can handle threads. I'd be glad to later hear whether it
did what you need, or not:

http://www.digitalpeers.com/pythondebugger/threads.htm

Regards, Ruben

Jul 15 '06 #5

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

Similar topics

2
2164
by: Andrew Taranov | last post by:
Hi! I've got a problem attaching the Script Debugger to ASP pages under IIS6. Set up everything following IIS6 documentation: turned on ASP debug in IIS Manager; edited permissions for Machine...
13
2908
by: python | last post by:
hello and thanks for reading this, i have been a dos/windows user using some form of the basic language for 30 years now. i own and run a small programming company and there is one feature that...
1
4704
by: Mark Kamoski | last post by:
Hi-- All of sudden (?) the VS.NET v1 IDE is NOT automatically attaching aspnet_wp.exe as a debugged process. Why? Here is the situation. VS.NET (v1)
0
1199
by: Jim Heavey | last post by:
Hello, I'm having a problem with running the Debugger on Windows 2000 Pro workstation. The help says that there are version of windows in which the debugger is not automatically attached, but it...
0
253
by: Chris Dunaway | last post by:
I am using the following code in a macro to attach to a process: Dim sFilename As String = "progname.exe" Dim proc As EnvDTE.Process For Each proc In DTE.Debugger.LocalProcesses If...
1
1562
by: Andy Leszczynski | last post by:
Hi, I have a program which somewhere gets into infinite look and take 100% of CPU. How can attach to it with the debugger to find out where it takes place? A.
0
886
by: elziko | last post by:
When I used Framework 1.0, if I had any problems once I had copied my application onto a target machine and it had problems I would copy a load of JIT files into the directory (including...
18
2944
by: R. Bernstein | last post by:
Okay, a bit of an exaggeration. Recently, I've been using Python more seriously, and in using the debugger I think one of the first things I noticed was that there is no "restart" ("R" in...
20
4157
by: krypto.wizard | last post by:
Is there any editor or IDE in Python (either Windows or Linux) which has very good debugging facilites like MS VisualStudio has or something like that. I like SPE but couldn't easily use winPDP....
0
7259
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
7158
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7380
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
7535
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...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5683
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4745
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
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
455
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.