Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Remote perl debugging via emacs

by sfink (Deacon)
on Jul 29, 2007 at 18:51 UTC ( #629423=note: print w/replies, xml ) Need Help??

in reply to Remote perl debugging via emacs

Answering my own question. Maybe someone has a better way, or warnings about this way.

  • Create an executable shell script in your path called pdbserv:
    #!/bin/sh while true; do nc -l -p 7234; done
  • Start up emacs
  • From within emacs, run perldb
  • When it asks for the command, change it from "perl -d -e 0" to "pdbserv -e 0".
  • Run your program with PERLDB_OPTS=RemotePort=localhost:7234 perl -d (scriptname) -emacs

Next is to try it with diotalevi's Enbugger stuff. If I get a chance to try it out, I'll crosspost under his thread.

perldb and emacs both annoy me greatly with their excessively "clever" ways of activating and controlling the debugger and slave editor mode. This is far from the first time I've had to use a silly workaround to avoid argument manhandling and misquoting.

Update: Oddly, the --chickens version does not work, at least not here. emacs thinks you're trying to do something weird with stdin. Stick to -e 0 (or just 0).

Also modified the script to keep listening after a shutdown instead of exiting.

Replies are listed 'Best First'.
Re^2: Remote perl debugging via emacs
by yurishtil (Initiate) on Nov 03, 2008 at 21:51 UTC
    It kind of works, however in order to be able to view the source file it must be available on the same path on both local (where emacs is) and remote (where the program is run) hosts. Or maybe I am missing something.
      I guess "remote" was the wrong word. I only wanted to run the perl debugger within gdb when the perl process was running in a different window. I guess most of the time that would imply that the perl process is on another machine, but in my case Perl is embedded within an application that is using stdout and the terminal for its own purposes.

      So yes, it only makes sense when the two share a filesystem. So you'd probably want NFS or something.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://629423]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2022-08-09 19:17 GMT
Find Nodes?
    Voting Booth?

    No recent polls found