unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: 28392@debbugs.gnu.org
Subject: bug#28392: 26.0.50; gdb-mi runs into error with tramp
Date: Thu, 15 Apr 2021 22:03:00 -0700	[thread overview]
Message-ID: <CANh=_JGzFfZFEfKUetM++5R_0ydWsXkv0uHZfH7ea_OUfgv5oQ@mail.gmail.com> (raw)
In-Reply-To: <CAJnfWeHrYW2ULW8eApfULW+1VbBTYt=v8qE4RNJ-Qun7jCNHxw@mail.gmail.com>

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

Attached are patches to fix this in Emacs 27 and 28; they're
essentially the same, but with slightly different contexts around the
diff. I'm not sure if this is wanted for Emacs 27, but it's a small
bugfix, and combined with my patch in bug#39408 (and the GNU ELPA
version of Tramp to fix bug#44151), M-x gdb should work correctly for
Tramp. For Emacs 28, this is the only outstanding issue (that I know
of) preventing M-x gdb from working with Tramp.

The problem here was that `gud-last-frame', set in
`gdb-frame-handler', expects a local file path, so the full Tramp path
was confusing it.

(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: 0002-Emacs-27-Fix-GUD-overlay-arrows-in-M-x-gdb-when-debugging-ove.patch --]
[-- Type: application/octet-stream, Size: 1136 bytes --]

From 77d0f1f753e0e08ddc1751abb6615c9fd2453de6 Mon Sep 17 00:00:00 2001
From: Jim Porter <jporterbugs@gmail.com>
Date: Thu, 15 Apr 2021 21:39:39 -0700
Subject: [PATCH 2/2] Fix GUD overlay arrows in M-x gdb when debugging over
 Tramp

* lisp/progmodes/gdb-mi.el (gdb-frame-handler): Use local part of
file name when setting `gud-last-frame'.
---
 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 1b2642fae7..51a237a38e 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -4376,7 +4376,7 @@ overlay arrow in source buffer."
   (let ((frame (bindat-get-field (gdb-json-partial-output) 'frame)))
     (when frame
       (setq gdb-selected-frame (bindat-get-field frame 'func))
-      (setq gdb-selected-file (bindat-get-field frame 'fullname))
+      (setq gdb-selected-file (file-local-name (bindat-get-field frame 'fullname)))
       (setq gdb-frame-number (bindat-get-field frame 'level))
       (setq gdb-frame-address (bindat-get-field frame 'addr))
       (let ((line (bindat-get-field frame 'line)))
-- 
2.25.1


[-- Attachment #3: 0001-Emacs-28-Fix-GUD-overlay-arrows-in-gdb-mi-when-debugging-over.patch --]
[-- Type: application/octet-stream, Size: 1108 bytes --]

From e1ff9f91150c5d8b11954c59e4240063616033e9 Mon Sep 17 00:00:00 2001
From: Jim Porter <jporterbugs@gmail.com>
Date: Thu, 15 Apr 2021 20:36:43 -0700
Subject: [PATCH] Fix GUD overlay arrows in gdb-mi when debugging over Tramp

* lisp/progmodes/gdb-mi.el (gdb-frame-handler): Use local part of
file name when setting `gud-last-frame'.
---
 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 1a96755bcf..8e6ce3d269 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -4512,7 +4512,7 @@ overlay arrow in source buffer."
   (let ((frame (gdb-mi--field (gdb-mi--partial-output) 'frame)))
     (when frame
       (setq gdb-selected-frame (gdb-mi--field frame 'func))
-      (setq gdb-selected-file (gdb-mi--field frame 'fullname))
+      (setq gdb-selected-file (file-local-name (gdb-mi--field frame 'fullname)))
       (setq gdb-frame-number (gdb-mi--field frame 'level))
       (setq gdb-frame-address (gdb-mi--field frame 'addr))
       (let ((line (gdb-mi--field frame 'line)))
-- 
2.25.1


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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-08 10:52 bug#28392: 26.0.50; gdb-mi runs into error with tramp Zhongwei Yao
2020-11-30 10:57 ` Lars Ingebrigtsen
2020-11-30 11:48   ` Michael Albinus
2021-04-16  5:03 ` Jim Porter [this message]
2021-05-01 10:13   ` 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=_JGzFfZFEfKUetM++5R_0ydWsXkv0uHZfH7ea_OUfgv5oQ@mail.gmail.com' \
    --to=jporterbugs@gmail.com \
    --cc=28392@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).