Skip to content

Commit 75d244a

Browse files
committed
fix setting breakpoints over tramp
1 parent 3ad4746 commit 75d244a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

gdb-mi.el

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
;; ------------------------------------------------------------------------------------------
3030
;; Package and related things
3131
(require 'cl-lib)
32+
(require 'subr-x)
3233
(require 'comint)
3334
(require 'hydra)
3435

@@ -1280,11 +1281,13 @@ stopped thread before running the command. If FORCE-STOPPED is
12801281

12811282
(defun gdb--point-location ()
12821283
"Return a GDB-readable location of the point, in a source file or special buffer."
1283-
(cond ((buffer-file-name) (format "%s:%d" (buffer-file-name) (gdb--current-line)))
1284-
((gdb--is-buffer-type 'gdb--disassembly)
1285-
(let* ((instr (get-text-property (line-beginning-position) 'gdb--instr))
1286-
(addr (and instr (gdb--disassembly-instr-addr instr))))
1287-
(when addr (format "*%s" addr))))))
1284+
(if-let (file-name (buffer-file-name))
1285+
(format "%s:%d" (or (file-remote-p file-name 'localname) file-name) (gdb--current-line))
1286+
1287+
(when (gdb--is-buffer-type 'gdb--disassembly)
1288+
(let* ((instr (get-text-property (line-beginning-position) 'gdb--instr))
1289+
(addr (and instr (gdb--disassembly-instr-addr instr))))
1290+
(when addr (format "*%s" addr))))))
12881291

12891292
(defun gdb--infer-breakpoint (&optional session)
12901293
(cond ((or (buffer-file-name)

0 commit comments

Comments
 (0)