GNU bug report logs - #39408
Breakpoints don't work with M-x gdb under TRAMP

Previous Next

Package: emacs;

Reported by: Timo Lilja <timo.lilja <at> iki.fi>

Date: Mon, 3 Feb 2020 19:11:01 UTC

Severity: normal

Tags: patch

Fixed in version 27.3

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#39408: closed (Breakpoints don't work with M-x gdb under TRAMP)
Date: Sat, 01 May 2021 10:00:05 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 01 May 2021 11:59:07 +0200
with message-id <87tunmai6s.fsf <at> gmx.de>
and subject line Re: bug#39408: Breakpoints don't work with M-x gdb under TRAMP
has caused the debbugs.gnu.org bug report #39408,
regarding Breakpoints don't work with M-x gdb under TRAMP
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
39408: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=39408
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Timo Lilja <timo.lilja <at> iki.fi>
To: bug-gnu-emacs <at> gnu.org
Subject: Breakpoints don't work with M-x gdb under TRAMP
Date: Mon, 3 Feb 2020 21:07:05 +0200
[Message part 3 (text/plain, inline)]
*** Environment

- GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of
  2019-09-23, modified by Debian
- The code looks identical on the relevant parts in Emacs git master

*** Steps to reproduce

1. Run emacs
   $ emacs -q

2. Start remote debugging session
   M-x gdb RET gdb -i=mi /ssh:vagrant <at> debug:/vagrant/hello

3. Set a breakpoint in *gud-hello* buffer
   (gdb) break main
   Breakpoint 1 at 0x1149: file hello.c, line 6.

4. Run the program to the breakpoint
   (gdb) run

5. Switch back to source window
   C-x b hello.c RET

6. Add another breakpoint
   C-x C-a c-b

Emacs becomes unresponsive and the minibuffer is flooded with the
following error message:

~File /ssh:vagrant <at> debug:/vagrant/"/vagrant/hello.c" no longer exists!~

*** Fix

1. Apply patch gdb-tramp-fix.diff
   $ zcat /usr/share/emacs/26.1/lisp/progmodes/gdb-mi.el.gz >gdb-mi.el
   $ zcat /usr/share/emacs/26.1/lisp/progmodes/gud.el.gz >gud.el
   $ patch <gdb-tramp-fix.diff

2. run emacs with modified gdb-mi.el and gud.el
   $ emacs -q -l el/gdb-mi.el -l el/gud.el

3. Setting breakpoints with C-x C-a C-b should work now

The changes in ~gdb-mi.el~ fix the problem with the "no longer exist"
error message.

The change in ~gud.el~ makes the fringe mark work a bit better and also
the source buffer to pop up when a break point is hit.

The problem seems to be that not all filename information goes through
(gdb-jsonify-buffer) but gdb-mi.el and gud.el read them directly from
gdb's buffers. These patches check wheter a gdb buffer is remote, and
wrap the file names accordingly.

There is probably a better way to fix the problem, but my knowledge
of gdb-mi.el is limited.

Relates to bug #23608.

*** Affected functions
(gdb-place-breakpoints)
(gdb-get-location)
(gdb-goto-breakpoint)
(gdb-frame-handler)
(gud-file-name)

*** References
- https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23608
[Message part 4 (text/html, inline)]
[gdb-tramp-fix.diff (text/x-patch, attachment)]
[Message part 6 (message/rfc822, inline)]
From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 39408-done <at> debbugs.gnu.org
Subject: Re: bug#39408: Breakpoints don't work with M-x gdb under TRAMP
Date: Sat, 01 May 2021 11:59:07 +0200
Version: 27.3

Jim Porter <jporterbugs <at> gmail.com> writes:

> This is already fixed in Emacs 28 thanks to bug#44173 (a78c614), which
> replaces the old GDB/MI parser (that converted the data to JSON first)
> with a more-robust parser. Attached is a patch to fix this under Emacs
> 27.
>
> The problem is that in `gdb-jsonify-buffer', when replacing the
> "fullname" with a Tramp path, the wildcard was greedy, resulting in
> only one "fullname" being replaced in the buffer. This had the effect
> of rendering it impossible to have more than one breakpoint, as all
> but the first breakpoint would have unmodified "fullname"s.

Pushed to the emacs-27 branch. Closing the bug.

Note: I don't know, whether there will be an Emacs 27.3. So the patch is
pushed just in case of.

Best regards, Michael.


This bug report was last modified 4 years and 76 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.