Subject: bug#4604: 23.1.50; tramp + remote debugging works no longer

From: [email-masked] (Nick Roberts)
Date: Thu, 1 Oct 2009 16:14:35 +1300

Remote debugging generally means that the program and the debugger run on
different machines (see the Emacs or GDB manual).  Tramp just allows you debug
programs on remote hosts

 > I just upgraded from emacs 23.1 (version from web site, not from cvs) to 23.1.50.1.
 > Then tried to debug some simple program:
 > M-x gdb: gdb -i=mi /n.10.3.rh73:/tmp/p1
 > 
 > failed as You can see.
 > 
 > Additionaly I just invoked it again, this time with "debug-on-error". This is result:
 > Debugger entered--Lisp error: (wrong-type-argument stringp nil)
 >   string-match("[^-0-9a-zA-Z_./]" nil 0)
 >   shell-quote-argument(nil)
 >   tramp-shell-quote-argument(nil)
 >   mapconcat(tramp-shell-quote-argument (nil) " ")
 >   tramp-handle-start-file-process("gdb-inferior" #<buffer limbo> nil)
 >   apply(tramp-handle-start-file-process ("gdb-inferior" #<buffer limbo> nil))
 >   tramp-sh-file-name-handler(start-file-process "gdb-inferior" #<buffer limbo> nil)
 >   apply(tramp-sh-file-name-handler start-file-process ("gdb-inferior" #<buffer limbo> nil))
 >   tramp-file-name-handler(start-file-process "gdb-inferior" #<buffer limbo> nil)
 >   apply(tramp-file-name-handler start-file-process "gdb-inferior" #<buffer limbo> nil nil)
 >   start-file-process("gdb-inferior" #<buffer limbo> nil)
 >   apply(start-file-process "gdb-inferior" #<buffer limbo> nil nil)
 >   comint-exec-1("gdb-inferior" #<buffer limbo> nil nil)
 >   comint-exec(#<buffer limbo> "gdb-inferior" nil nil nil)
 >   make-comint-in-buffer("gdb-inferior" #<buffer limbo> nil)
 >   gdb-inferior-io-mode()
 >   gdb-get-buffer-create(gdb-inferior-io)

Yes, it appears to be broken now.  Emacs now lets GDB to take control of the
terminal associated with the I/O buffer for it's own child process (the
program being debugged)and always has a separate I/O buffer.  In fact, it
looks like previously GDB in Emacs didn't work with tramp when it had a
separate I/O buffer (gdb-use-separate-io-buffer is t). 

PROGRAM is nil in make-comint-in-buffer (third arg - also see start-process)
which means just create a pty.

 >   gdb-init-1()
 >   gdb-update()
 >   gdb("gdb -i=mi /n.10.3.rh73:/tmp/p1")
 >   call-interactively(gdb t nil)
 >   execute-extended-command(nil)
 >   call-interactively(execute-extended-command nil nil)
 > 
 > in previous emacs I used to do:
 > 1) visit /n.10.3.rh73:/tmp directory
 > 2) M-x gdb: gdb --annotate=3 ./p1
 > 
 > for emacs 23.1.50.1 I also tried this command, but no success.

That must have been in emacs 23.1.  For now, you're better off using that version
with tramp ... or you can always try to write a patch for 23.1.50.  That would be
great!

-- 
Nick                                           http://users.snap.net.nz/~nickrob