From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#13304: [PATCH] full-path gud breakpoints now don't get confused by tramp Date: Sat, 29 Dec 2012 03:00:11 -0800 Message-ID: <87sj6p86o4.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1356778875 3164 80.91.229.3 (29 Dec 2012 11:01:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Dec 2012 11:01:15 +0000 (UTC) To: 13304@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 29 12:01:31 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TouAR-00059A-GW for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Dec 2012 12:01:27 +0100 Original-Received: from localhost ([::1]:60123 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TouAC-00023P-VP for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Dec 2012 06:01:12 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TouA7-000237-Ly for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 06:01:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TouA5-000235-9X for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 06:01:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TouA5-000231-5a for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 06:01:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TouB0-0001HY-Gj for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 06:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Dec 2012 11:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13304 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13567788884884 (code B ref -1); Sat, 29 Dec 2012 11:02:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Dec 2012 11:01:28 +0000 Original-Received: from localhost ([127.0.0.1]:35639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TouAS-0001Gi-9i for submit@debbugs.gnu.org; Sat, 29 Dec 2012 06:01:28 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34843) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TouAO-0001GZ-JL for submit@debbugs.gnu.org; Sat, 29 Dec 2012 06:01:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tou9P-0001nj-Ix for submit@debbugs.gnu.org; Sat, 29 Dec 2012 06:00:26 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:41459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tou9P-0001mp-FN for submit@debbugs.gnu.org; Sat, 29 Dec 2012 06:00:23 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tou9K-00020K-Sx for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 06:00:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tou9I-0001gX-0E for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 06:00:18 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:41713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tou9H-0001fv-LN for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 06:00:15 -0500 Original-Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 6BE02206BC for ; Sat, 29 Dec 2012 06:00:13 -0500 (EST) Original-Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160]) by compute5.internal (MEProxy); Sat, 29 Dec 2012 06:00:13 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=from:to:subject:date:message-id:mime-version:content-type; s= mesmtp; bh=M10vJodC6JIYC421Eq1Dd8DUzzM=; b=Uez8ydSWlE1tIu+8YNuAA qQvCZwF1HtsJmjx7cN1kWz//nj4OTqsqd6QB2cqs84rEQld0o3ocsnzWNzp/NHEi g2kyqj3JSuQQtJQSOp8trlfWugKpIY/9+xrIkHdPy3k0nnoAxXWpJ4/oMH4cje93 OCYLyhAq/cXw95RdWEOjz8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id :mime-version:content-type; s=smtpout; bh=M10vJodC6JIYC421Eq1Dd8 DUzzM=; b=CO27AytJ7F12CsNA4Z78RYEvH5BYRa+bRbxbJiv1XGSCkD2uKCq4/7 a9HFEOEwSQjuCo2OA1PX5hphU4lHJQajyqucDV4/je++l5JKjzmrDjaPk5c3mhze BgtA34DbOeYWrk2xbSH70l4NXflw8U9SZihLUSq/JIdl1d9l8YOWE= X-Sasl-enc: kKb2KHl2MdLfCPoa8xOiTT4eRNSwoDEoSQq6220EjXlW 1356778813 Original-Received: from shorty.local (unknown [76.169.242.46]) by mail.messagingengine.com (Postfix) with ESMTPA id 238CE8E0726 for ; Sat, 29 Dec 2012 06:00:13 -0500 (EST) Original-Received: from dima by shorty.local with local (Exim 4.80) (envelope-from ) id 1Tou9D-0004MG-O4 for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 03:00:11 -0800 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:69148 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-full-path-gud-breakpoints-now-don-t-get-confused-by-.patch Content-Description: patch >From 3bfe6f560a8c6f96ef0ed9200015bab0d29235c9 Mon Sep 17 00:00:00 2001 From: Dima Kogan 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 --=-=-=--