473,287 Members | 1,616 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,287 software developers and data experts.

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 2382
"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
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
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
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
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
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
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
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
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
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.