473,756 Members | 3,973 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 2414
"Diez B. Roggisch" <de***@nospam.w eb.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
1752
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 seems to happen :( Is there some way to simply check if the debug plugin for php is correctly installed
1
7622
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 not sock.recv(buffsize) I cannot write to the socket and check if send returns 0 though, because that involves sending data out of the which may not have come in yet. When I try polling the socket with:
7
2596
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. I had no issue creating the web app on the remote server after authenticating with the domain account, but I can't debug. It complains that I don't have rights. My domain account is in the administrators group on the remote machine. I also have...
1
2026
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: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_SP2003_ta/html/sharepoint_debugwebparts.asp Debug Settings and Preparation: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/_core_Debugging_Preparation.asp unfortunately, I have...
4
2723
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 emacs-snapshot-gtk package fwiw.
0
1338
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 have no terminal) and very infrequently come into error conditions which i want to understand and debug. The idea is that I do the debugging as shown below. Is that a good way of solving my problem? Do I need anything special
4
1223
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 = {'a': 1, 'b': 2, 'c': 3}
3
2769
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 unable to attach to the process when running from the web server. Can someone tell me how to remote debug an ASP.Net Website that does not genate a dll or PDB file? Thanks in advance! Rick
3
6628
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 installed on the server I want to debug, the remote debugger tools from the VS 2005 CD. I just install the windows application. I tried from there to debug, without succes. I could connect to the remote machine only when the msvsmon.exe is in the...
0
9455
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9271
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10031
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9869
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6534
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
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 we have to send another system
2
3354
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2665
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.