all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Tim Marston <tim@ed.am>
Cc: 23608@debbugs.gnu.org
Subject: bug#23608: 24.5; Breakpoints don't show in GDB over TRAMP
Date: Mon, 22 Aug 2016 20:15:30 +0200	[thread overview]
Message-ID: <87d1l0k6v1.fsf@gmx.de> (raw)
In-Reply-To: <20160524083525.GA27607@waxworlds.org> (Tim Marston's message of "Tue, 24 May 2016 09:35:25 +0100")

Tim Marston <tim@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	other threads:[~2016-08-22 18:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24  8:35 bug#23608: 24.5; Breakpoints don't show in GDB over TRAMP Tim Marston
2016-08-22 18:15 ` Michael Albinus [this message]
2016-08-31  9:22   ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d1l0k6v1.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=23608@debbugs.gnu.org \
    --cc=tim@ed.am \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.