GNU bug report logs - #23608
24.5; Breakpoints don't show in GDB over TRAMP

Previous Next

Package: emacs;

Reported by: Tim Marston <tim <at> ed.am>

Date: Tue, 24 May 2016 15:32:02 UTC

Severity: normal

Found in version 24.5

Fixed in version 26.1

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23608 in the body.
You can then email your comments to 23608 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#23608; Package emacs. (Tue, 24 May 2016 15:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tim Marston <tim <at> ed.am>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 24 May 2016 15:32:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tim Marston <tim <at> ed.am>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; Breakpoints don't show in GDB over TRAMP
Date: Tue, 24 May 2016 09:35:25 +0100
Hi,

I've noticed that breakpoints don't show up in the source code when
running GDB over TRAMP.  It's quite reproducible.


Steps to reproduce:

1/  run emacs
    $ emacs -q

2/  visit a some remote source code
    C-x C-f /laptop:/home/edam/src/lang/c++/hello-world/hw.cc

3/  run GDB
    M-x gdb RET RET

4/  switch back to source code window
    C-x b RET

5/  add breakpoint
    C-x C-a C-b


What happens:

The breakpoint doesn't show up in the source code buffer.  When you run
the program, the breakpoint still works.  And when the program "breaks
out", you get a current line indicator, showing you where execution is
at.  But no breakpoint.

If you do the same as above, but with a local file (i.e., not via
TRAMP), breakpoints show up as expected.

Another detail, which may be related, is that if I try to set another
breakpoint on the same line, I get this message:

    File /scp:laptop:/home/edam/src/lang/c++/hello-world/"/home/edam/data/dev/lang/c++/hello-world/hw.cc" no longer exists!

Which would seem to indicate that emacs is becoming confused about file
file names over TRAMP.




In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2016-04-08 on binet, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11803000
System Description:	Debian GNU/Linux unstable (sid)

Configured using:
 `configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
 --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
 -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Important settings:
  value of $LANG: en_GB.utf8
  locale-coding-system: utf-8-unix

Major mode: C++/l

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent messages:
Tramp: Opening connection for laptop using scp...done
Target doesn't support non-stop mode.  Turning it off.
Command: break hw.cc:5
Use M-x make-directory RET RET to create the directory and its parents

Tramp: Checking `vc-registered' for /scp:laptop:/home/edam/src/lang/c++/hello-world/"/home/edam/data/dev/lang/c++/hello-world/hw.cc"...done
Use M-x make-directory RET RET to create the directory and its parents

Tramp: Checking `vc-registered' for /scp:laptop:/home/edam/data/dev/lang/c++/hello-world/"/home/edam/data/dev/lang/c++/hello-world/hw.cc"...done
Use M-x make-directory RET RET to create the directory and its parents

Load-path shadows:
/usr/share/emacs24/site-lisp/emacs-goodies-el/all hides /usr/share/emacs/24.5/site-lisp/elpa/company-0.8.12/all
/usr/share/emacs24/site-lisp/cmake-data/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode
/usr/share/emacs/24.5/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs24/site-lisp/psgml/psgml-init hides /usr/share/emacs/site-lisp/psgml/psgml-init
/usr/share/emacs24/site-lisp/psgml/psgml-sysdep hides /usr/share/emacs/site-lisp/psgml/psgml-sysdep
/usr/share/emacs24/site-lisp/psgml/psgml-edit hides /usr/share/emacs/site-lisp/psgml/psgml-edit
/usr/share/emacs24/site-lisp/psgml/psgml-dtd hides /usr/share/emacs/site-lisp/psgml/psgml-dtd
/usr/share/emacs24/site-lisp/psgml/psgml hides /usr/share/emacs/site-lisp/psgml/psgml
/usr/share/emacs24/site-lisp/psgml/psgml-info hides /usr/share/emacs/site-lisp/psgml/psgml-info
/usr/share/emacs24/site-lisp/psgml/psgml-parse hides /usr/share/emacs/site-lisp/psgml/psgml-parse
/usr/share/emacs24/site-lisp/psgml/psgml-ids hides /usr/share/emacs/site-lisp/psgml/psgml-ids
/usr/share/emacs24/site-lisp/psgml/psgml-other hides /usr/share/emacs/site-lisp/psgml/psgml-other
/usr/share/emacs24/site-lisp/psgml/psgml-api hides /usr/share/emacs/site-lisp/psgml/psgml-api
/usr/share/emacs24/site-lisp/psgml/psgml-charent hides /usr/share/emacs/site-lisp/psgml/psgml-charent

Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mail-utils gdb-mi bindat json gud
cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs help-mode easymenu tramp-cache tramp-sh tramp
tramp-compat auth-source eieio byte-opt bytecomp byte-compile cl-extra
cl-loaddefs cl-lib cconv eieio-core gnus-util mm-util mail-prsvr
password-cache tramp-loaddefs trampver shell pcomplete comint ansi-color
ring format-spec advice help-fns s ucs-normalize psgml-init
emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs easy-mmode
devhelp dash-functional dash time-date tooltip electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 257936 12358)
 (symbols 48 24798 0)
 (miscs 40 133 191)
 (strings 32 34368 8660)
 (string-bytes 1 1117099)
 (vectors 16 40099)
 (vector-slots 8 806756 6357)
 (floats 8 639 156)
 (intervals 56 543 1441)
 (buffers 960 22)
 (heap 1024 26132 1165))

--
Tim Marston
ed.am




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23608; Package emacs. (Mon, 22 Aug 2016 18:16:01 GMT) Full text and rfc822 format available.

Message #8 received at 23608 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Tim Marston <tim <at> ed.am>
Cc: 23608 <at> debbugs.gnu.org
Subject: Re: bug#23608: 24.5; Breakpoints don't show in GDB over TRAMP
Date: Mon, 22 Aug 2016 20:15:30 +0200
Tim Marston <tim <at> ed.am> writes:

> Hi,

Hi Tim,

> I've noticed that breakpoints don't show up in the source code when
> running GDB over TRAMP.  It's quite reproducible.
>
> Steps to reproduce:
>
> 1/  run emacs
>     $ emacs -q
>
> 2/  visit a some remote source code
>     C-x C-f /laptop:/home/edam/src/lang/c++/hello-world/hw.cc
>
> 3/  run GDB
>     M-x gdb RET RET
>
> 4/  switch back to source code window
>     C-x b RET
>
> 5/  add breakpoint
>     C-x C-a C-b

Thanks for the proper recipe!

> What happens:
>
> The breakpoint doesn't show up in the source code buffer.  When you run
> the program, the breakpoint still works.  And when the program "breaks
> out", you get a current line indicator, showing you where execution is
> at.  But no breakpoint.

gdb-mi.el retrieves file names from the running (remote) gdb
process. Obviously, this process cannot know remote (Tramp) file names.

I've committed the following fix to Emacs master:

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/emacs/lisp/progmodes/gdb-mi.el.~c1b5000d8c484d7acd39414119838c78eaaf9cca~	2016-08-22 20:04:45.263775082 +0200
--- /home/albinus/src/emacs/lisp/progmodes/gdb-mi.el	2016-08-22 19:58:33.826031791 +0200
***************
*** 2661,2668 ****
  If FIX-LIST is non-nil, \"FIX-LIST={..}\" is replaced with
  \"FIX-LIST=[..]\" prior to parsing. This is used to fix broken
  -break-info output when it contains breakpoint script field
! incompatible with GDB/MI output syntax."
    (save-excursion
      (goto-char (point-min))
      (when fix-key
        (save-excursion
--- 2661,2675 ----
  If FIX-LIST is non-nil, \"FIX-LIST={..}\" is replaced with
  \"FIX-LIST=[..]\" prior to parsing. This is used to fix broken
  -break-info output when it contains breakpoint script field
! incompatible with GDB/MI output syntax.
! 
! If `default-directory' is remote, full file names are adapted accordingly."
    (save-excursion
+     (let ((remote (file-remote-p default-directory)))
+       (when remote
+         (goto-char (point-min))
+         (while (re-search-forward "[\\[,]fullname=\"\\(.+\\)\"" nil t)
+           (replace-match (concat remote "\\1") nil nil nil 1))))
      (goto-char (point-min))
      (when fix-key
        (save-excursion
--8<---------------cut here---------------end--------------->8---

Could you, pls, check whether this works for you? I would also be
interested in any undesired side effect, since I couldn't test this
extensively.

> Tim Marston
> ed.am

Best regards, Michael.




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Wed, 31 Aug 2016 09:23:01 GMT) Full text and rfc822 format available.

Notification sent to Tim Marston <tim <at> ed.am>:
bug acknowledged by developer. (Wed, 31 Aug 2016 09:23:02 GMT) Full text and rfc822 format available.

Message #13 received at 23608-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Tim Marston <tim <at> ed.am>
Cc: 23608-done <at> debbugs.gnu.org
Subject: Re: bug#23608: 24.5; Breakpoints don't show in GDB over TRAMP
Date: Wed, 31 Aug 2016 11:22:29 +0200
Version: 25.2

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

> I've committed the following fix to Emacs master:

[...]

> Could you, pls, check whether this works for you? I would also be
> interested in any undesired side effect, since I couldn't test this
> extensively.

No reaction, so I assume everything works as expected. I'm closing the
bug. Feel free to reopen if it doesn't work for you.

>> Tim Marston
>> ed.am

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 28 Sep 2016 11:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 04 Dec 2016 02:50:11 GMT) Full text and rfc822 format available.

bug Marked as fixed in versions 26.1. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 04 Dec 2016 02:50:11 GMT) Full text and rfc822 format available.

bug No longer marked as fixed in versions 25.2. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 04 Dec 2016 02:50:11 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 01 Jan 2017 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 117 days ago.

Previous Next


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