unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: 39408@debbugs.gnu.org
Subject: bug#39408: Breakpoints don't work with M-x gdb under TRAMP
Date: Thu, 15 Apr 2021 22:02:01 -0700	[thread overview]
Message-ID: <CANh=_JEGHi3VCcAyrQmA1sY9QyEywemJos2VTXxLOMhxauK0yw@mail.gmail.com> (raw)
In-Reply-To: <CAFsu5Z2nPRXbedpT_6WJ+F6YYZ3WA2V304PpaiqsEGkm=PYwUg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 720 bytes --]

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.

(Note: I have a couple of patches in Tramp already that put me at the
limit for patches without copyright assignment paperwork. However,
I've already requested the form.)

[-- Attachment #2: 0001-Emacs-27-Fix-setting-breakpoints-in-M-x-gdb-for-remote-files.patch --]
[-- Type: application/octet-stream, Size: 1062 bytes --]

From 2ab1ecef679df32230705e37098c1d93c639c22f Mon Sep 17 00:00:00 2001
From: Jim Porter <jporterbugs@gmail.com>
Date: Thu, 15 Apr 2021 21:39:03 -0700
Subject: [PATCH 1/2] Fix setting breakpoints in M-x gdb for remote files

* lisp/progmodes/gdb-mi.el (gdb-jsonify-buffer): Fix modification of
GDB/MI "fullname" property for remote files
---
 lisp/progmodes/gdb-mi.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 65fe997341..1b2642fae7 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -2696,7 +2696,7 @@ If `default-directory' is remote, full file names are adapted accordingly."
     (let ((remote (file-remote-p default-directory)))
       (when remote
         (goto-char (point-min))
-        (while (re-search-forward "[\\[,]fullname=\"\\(.+\\)\"" nil t)
+        (while (re-search-forward "[\\[,]fullname=\"\\(.+?\\)\"" nil t)
           (replace-match (concat remote "\\1") nil nil nil 1))))
     (goto-char (point-min))
     (when fix-key
-- 
2.25.1


  parent reply	other threads:[~2021-04-16  5:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03 19:07 bug#39408: Breakpoints don't work with M-x gdb under TRAMP Timo Lilja
2020-08-21 11:48 ` Lars Ingebrigtsen
2020-08-21 14:08   ` Michael Albinus
2021-04-16  5:02 ` Jim Porter [this message]
2021-05-01  9:59   ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CANh=_JEGHi3VCcAyrQmA1sY9QyEywemJos2VTXxLOMhxauK0yw@mail.gmail.com' \
    --to=jporterbugs@gmail.com \
    --cc=39408@debbugs.gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).