GNU bug report logs -
#13304
[PATCH] full-path gud breakpoints now don't get confused by tramp
Previous Next
Reported by: Dima Kogan <dima <at> secretsauce.net>
Date: Sat, 29 Dec 2012 11:02:02 UTC
Severity: normal
Tags: patch
Done: Dima Kogan <dima <at> secretsauce.net>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
This patch fixes a bug I hit when remotely-debugging a python program
with gud through tramp. If I tried to set a breakpoint from the source
buffer, the python debugger would be given the full path to the file,
tramp fields and all. This made it impossible to set breakpoints in this
manner.
Attached is a patch that strips out the remote pieces of the path when
communicating with the backend debugger.
[0001-full-path-gud-breakpoints-now-don-t-get-confused-by-.patch (text/x-diff, inline)]
From 3bfe6f560a8c6f96ef0ed9200015bab0d29235c9 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima <at> secretsauce.net>
Date: Sat, 29 Dec 2012 02:54:40 -0800
Subject: [PATCH] full-path gud breakpoints now don't get confused by tramp
prior to this patch if gud used a path to set a breakpoint, the FULL
path would be sent to the backend debugger, including the tramp
pieces. The backends don't know anything about tramp, so they were
naturally confused by this. Most notably, it was impossible to set
from-source breakpoints in pdb, the python debugger.
---
lisp/progmodes/gud.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 13eac83..45e0ddf 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2743,6 +2743,11 @@ Obeying it means displaying in another window the specified file and line."
(defun gud-format-command (str arg)
(let ((insource (not (eq (current-buffer) gud-comint-buffer)))
(frame (or gud-last-frame gud-last-last-frame))
+ (buffer-file-name-localized
+ (if (and (buffer-file-name) (file-remote-p (buffer-file-name)))
+ (tramp-file-name-localname (tramp-dissect-file-name
+ (buffer-file-name) t))
+ (buffer-file-name)))
result)
(while (and str
(let ((case-fold-search nil))
@@ -2752,15 +2757,15 @@ Obeying it means displaying in another window the specified file and line."
(cond
((eq key ?f)
(setq subst (file-name-nondirectory (if insource
- (buffer-file-name)
+ buffer-file-name-localized
(car frame)))))
((eq key ?F)
(setq subst (file-name-base (if insource
- (buffer-file-name)
+ buffer-file-name-localized
(car frame)))))
((eq key ?d)
(setq subst (file-name-directory (if insource
- (buffer-file-name)
+ buffer-file-name-localized
(car frame)))))
((eq key ?l)
(setq subst (int-to-string
--
1.7.10.4
This bug report was last modified 9 years and 246 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.