473,503 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pydb remote debugging/cmd.Cmd over socket?

Hi,

I'm fiddling around with pydb. Installation and usage are fine. What I
especially like is the fact that you can attach a signal such that you drop
into debugging mode on demand.

But this is of limited use to me in situations where a server is written in
python. According to the source, pydb's debugger class Gdb extends cmd.Cmd.

It passes stdin/stdout-arguments that should be usable to replace the
standard streams. But so far all my experiments simply dropped the process
into debugging mode putting out and getting io over stdin/stdout - not my
self-supplied streams.

So I wonder (being a bit rusty on my UNIX-piping-skillz): how does one do
that - essentially, create a remote python shell using cmd.Cmd?

Diez
Jun 27 '08 #1
2 2394
"Diez B. Roggisch" <de***@nospam.web.dewrites:
Hi,

I'm fiddling around with pydb. Installation and usage are fine. What I
especially like is the fact that you can attach a signal such that you drop
into debugging mode on demand.

But this is of limited use to me in situations where a server is written in
python. According to the source, pydb's debugger class Gdb extends cmd.Cmd.

It passes stdin/stdout-arguments that should be usable to replace the
standard streams. But so far all my experiments simply dropped the process
into debugging mode putting out and getting io over stdin/stdout - not my
self-supplied streams.

So I wonder (being a bit rusty on my UNIX-piping-skillz): how does one do
that - essentially, create a remote python shell using cmd.Cmd?

Diez
As part of the 2006 Google Summer of Code project Matt Flemming
started working on remote debugging in pydb. Alas it wasn't completed
and I let the code fall through the cracks.

Matt claimed it worked to some degree but I could never get it to work
for me. Most definitely the code has atrophied.

The user interface was loosely based or reminiscent of gdb. So
you'd run pydbserver either as a command inside the debugger or as an
option to pydb or call inside Python pdbserver after importing.

There is a connection class (file pydb/connection.rb) which was to
allow different kinds of protocols, like a socket connection or
a serial line connection, or maybe even two FIFO's so that you could
connect to a different process on the same computer.

And there were some commands on the user-interaction side
to attach or detach the Python program you want to debug.

If you look in pydb.py.in and gdb.py.in you'll see some code commented
out with double hashes which is part of this effort.

I invite you or others to try to resurrect this effort. However as I
look at the code now, it doesn't make much sense other than the broad
outline given above.

Another approach and possibly a much simpler one if you are looking
for a Python debugger which supports remote debugging is Winpdb
http://winpdb.org/ by Nir Aides.
Jun 27 '08 #2
As part of the 2006 Google Summer of Code project Matt Flemming
started working on remote debugging in pydb. Alas it wasn't completed
and I let the code fall through the cracks.

Matt claimed it worked to some degree but I could never get it to work
for me. Most definitely the code has atrophied.

The user interface was loosely based or reminiscent of gdb. So
you'd run pydbserver either as a command inside the debugger or as an
option to pydb or call inside Python pdbserver after importing.

There is a connection class (file pydb/connection.rb) which was to
allow different kinds of protocols, like a socket connection or
a serial line connection, or maybe even two FIFO's so that you could
connect to a different process on the same computer.

And there were some commands on the user-interaction side
to attach or detach the Python program you want to debug.

If you look in pydb.py.in and gdb.py.in you'll see some code commented
out with double hashes which is part of this effort.

I invite you or others to try to resurrect this effort. However as I
look at the code now, it doesn't make much sense other than the broad
outline given above.
Hm. Ok, I'll look into that. It's just that I don't get cmd.Cmd to work
against two streams. Maybe I need to dive into unix-coding a bit deeper
again.
Another approach and possibly a much simpler one if you are looking
for a Python debugger which supports remote debugging is Winpdb
http://winpdb.org/ by Nir Aides.

I've found that - and while it's nice, it has one problem: I can only
start it with winpdb governing the process already, preventing python
from starting.

In contrast, the possibility to use a sginal to start the debugger of
pydb is great, so that's the reason I want to stick with it.

Diez
Jun 27 '08 #3

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

Similar topics

0
1690
by: Job Kelderman | last post by:
Hi all! I'm trying to get remote debugging working with phpeclipse. I think i've installed everything correctly, and the debugger in eclipse starts, but breakpoints are ignored and nothing...
1
7547
by: Tim Gosselin | last post by:
I am writing a tcp tunnel but cannot find a way of detecting when a socket shuts down its read end without writing to the socket. For testing the write end of the remote endpoint I just do a: if...
7
2573
by: | last post by:
I'm writing an ASP.NET app, using Visual Studio 2003. VS is running locally on my laptop, but the web app is running on a remote server. My laptop is not in the domain. I do have a domain account....
1
2010
by: CK | last post by:
Hello All, I have been trying to setup remote debugging for web part development by running through the steps in the following documentation: Debugging Web Parts:...
4
2701
by: Paul Rudin | last post by:
I can't get the gdb fringe interaction functionality to work with either pdb or pydb. Any hints as to versions or incantations I should try? I have the emacs22 from debian unstable...
0
1321
by: carl.dhalluin | last post by:
Hi I want a simple way to interactively remote debug a running python script which has no tty terminal attached to it. The scripts are running standalone (i.e. they are automatically started and...
4
1212
by: kj | last post by:
I'm running into a strange seg fault with the module cjson. The strange part is that it does not occur when I run the code under Emacs' Pydb. Here's an example: import sys, cjson d1 =...
3
2726
by: Rick | last post by:
We have a web site that was built as an ASP.Net Web Site, I am unable to remote debug, when build ing the web site there is not a dll or PDB file generated. I can debug on my local machine but...
3
6609
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
7205
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
7287
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,...
1
7006
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
5592
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
4685
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
3175
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
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
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.