GNU bug report logs - #28392
26.0.50; gdb-mi runs into error with tramp

Previous Next

Package: emacs;

Reported by: Zhongwei Yao <ashi08104 <at> gmail.com>

Date: Fri, 8 Sep 2017 14:04:01 UTC

Severity: normal

Merged with 44151

Found in version 26.0.50

Fixed in version 27.3

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28392 in the body.
You can then email your comments to 28392 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#28392; Package emacs. (Fri, 08 Sep 2017 14:04:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zhongwei Yao <ashi08104 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 08 Sep 2017 14:04:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Zhongwei Yao <ashi08104 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; gdb-mi runs into error with tramp
Date: Fri, 8 Sep 2017 18:52:48 +0800
[Message part 1 (text/plain, inline)]
emacs runs on Mac with tramp . And I have a test project on a remote
machine (dev-sever): /home/xxx/project/test_gdb/. It has a simple file:
test.c. test.c is compiled by gcc with -O0 -g to test_bin.

test.c:
1 int foo(int a, int b) {
2  int c = a + b;
3  return c;
4 }
5
6 int main(void) {
7  return foo(3, 4);
8 }

Steps:
1. Open test.c on dev-server in emacs
2. run 'M-x gdb'  gdb -i=mi test_bin and open gdb-many-window mode.
3. In *gud-test* buffer, run: break 7
4. Run: run and gdb stop at line 7
5. Step into line 7

But the cursor of source buffer will not move at all. And then emacs become
irresponsive after running several step commands. I press Ctrl-G several
times. Then it returns error: json-read-string: Bad string format: "doesn't
start with `\"'!"

Here is the backtrace for above error:

Debugger entered--Lisp error: (json-string-format "doesn't start with
`\"'!")
  signal(json-string-format ("doesn't start with `\"'!"))
  json-read-string()
  json-read-object()
  apply(json-read-object nil)
  json-read()
  gdb-json-read-buffer(nil nil)
  gdb-json-partial-output()
  gdb-thread-list-handler-custom()
  gdb-thread-list-handler()
  apply(gdb-thread-list-handler nil)
  (save-current-buffer (set-buffer #<buffer *threads of test*>) (apply
(quote gdb-thread-list-handler) args))
  (with-current-buffer #<buffer *threads of test*> (apply (quote
gdb-thread-list-handler) args))
  (lambda (&rest args) (with-current-buffer #<buffer *threads of test*>
(apply (quote gdb-thread-list-handler) args)))()
  gdb-handle-reply(27)
  gdb-done-or-error("27" done "threads=[{id=\"1\",target-id=\"process
25128\",name=\"test\",frame={level=\"0\",addr=\"0x00000000004004f4\",func=\"main\",args=[],file=\"test.c\",fullname=\"/home/xxx/projects/tests/test_gdb/test.c\",line=\"7\"},state=\"stopped\",core=\"24\"}],current-thread-id=\"1\""
t)
  gdb-done("27" "threads=[{id=\"1\",target-id=\"process
25128\",name=\"test\",frame={level=\"0\",addr=\"0x00000000004004f4\",func=\"main\",args=[],file=\"test.c\",fullname=\"/home/xxx/projects/tests/test_gdb/test.c\",line=\"7\"},state=\"stopped\",core=\"24\"}],current-thread-id=\"1\""
t)
  gdbmi-bnf-incomplete-record-result("27" (gdb-done . progressive))
  #[0 "\302\300\301\242\"\207" ["27" ((gdb-done . progressive))
gdbmi-bnf-incomplete-record-result] 3]()
  gdbmi-bnf-result-and-async-record-impl()
  gdbmi-bnf-async-record()
  gdbmi-bnf-out-of-band-record()
  gdbmi-bnf-output()
  gud-gdbmi-marker-filter("27^done,threads=[{id=\"1\",target-id=\"process
25128\",name=\"test\",frame={level=\"0\",addr=\"0x00000000004004f4\",func=\"main\",args=[],file=\"test.c\",fullname=\"/home/xxx/projects/tests/test_gdb/test.c\",line=\"7\"},state=\"stopped\",core=\"24\"}],current-thread-id=\"1\"\n(gdb)
\n28^done,BreakpointTable={nr_rows=\"1\",nr_cols=\"6\",hdr=[{width=\"7\",alignment=\"-1\",col_name=\"number\",colhdr=\"Num\"},{width=\"14\",alignment=\"-1\",col_name=\"type\",colhdr=\"Type\"},{width=\"4\",alignment=\"-1\",col_name=\"disp\",colhdr=\"Disp\"},{width=\"3\",alignment=\"-1\",col_name=\"enabled\",colhdr=\"Enb\"},{width=\"18\",alignment=\"-1\",col_name=\"addr\",colhdr=\"Address\"},{width=\"40\",alignment=\"2\",col_name=\"what\",colhdr=\"What\"}],body=[bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x00000000004004f4\",func=\"main\",file=\"test.c\",fullname=\"/home/xxx/projects/tests/test_gdb/test.c\",line=\"7\",thread-groups=[\"i1\"],times=\"1\",original-location=\"/home/xxx/projects/tests/test_gdb/test.c:7\"}]}\n(gdb)
\n29^done,locals=[]\n(gdb) \n30^done,stack=[frame={level=\"0\",addr=\"")
  apply(gud-gdbmi-marker-filter
"27^done,threads=[{id=\"1\",target-id=\"process
25128\",name=\"test\",frame={level=\"0\",addr=\"0x00000000004004f4\",func=\"main\",args=[],file=\"test.c\",fullname=\"/home/xxx/projects/tests/test_gdb/test.c\",line=\"7\"},state=\"stopped\",core=\"24\"}],current-thread-id=\"1\"\n(gdb)
\n28^done,BreakpointTable={nr_rows=\"1\",nr_cols=\"6\",hdr=[{width=\"7\",alignment=\"-1\",col_name=\"number\",colhdr=\"Num\"},{width=\"14\",alignment=\"-1\",col_name=\"type\",colhdr=\"Type\"},{width=\"4\",alignment=\"-1\",col_name=\"disp\",colhdr=\"Disp\"},{width=\"3\",alignment=\"-1\",col_name=\"enabled\",colhdr=\"Enb\"},{width=\"18\",alignment=\"-1\",col_name=\"addr\",colhdr=\"Address\"},{width=\"40\",alignment=\"2\",col_name=\"what\",colhdr=\"What\"}],body=[bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x00000000004004f4\",func=\"main\",file=\"test.c\",fullname=\"/home/xxx/projects/tests/test_gdb/test.c\",line=\"7\",thread-groups=[\"i1\"],times=\"1\",original-location=\"/home/xxx/projects/tests/test_gdb/test.c:7\"}]}\n(gdb)
\n29^done,locals=[]\n(gdb) \n30^done,stack=[frame={level=\"0\",addr=\"")
  gud-marker-filter("27^done,threads=[{id=\"1\",target-id=\"process
25128\",name=\"test\",frame={level=\"0\",addr=\"0x00000000004004f4\",func=\"main\",args=[],file=\"test.c\",fullname=\"/home/xxx/projects/tests/test_gdb/test.c\",line=\"7\"},state=\"stopped\",core=\"24\"}],current-thread-id=\"1\"\n(gdb)
\n28^done,BreakpointTable={nr_rows=\"1\",nr_cols=\"6\",hdr=[{width=\"7\",alignment=\"-1\",col_name=\"number\",colhdr=\"Num\"},{width=\"14\",alignment=\"-1\",col_name=\"type\",colhdr=\"Type\"},{width=\"4\",alignment=\"-1\",col_name=\"disp\",colhdr=\"Disp\"},{width=\"3\",alignment=\"-1\",col_name=\"enabled\",colhdr=\"Enb\"},{width=\"18\",alignment=\"-1\",col_name=\"addr\",colhdr=\"Address\"},{width=\"40\",alignment=\"2\",col_name=\"what\",colhdr=\"What\"}],body=[bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x00000000004004f4\",func=\"main\",file=\"test.c\",fullname=\"/home/xxx/projects/tests/test_gdb/test.c\",line=\"7\",thread-groups=[\"i1\"],times=\"1\",original-location=\"/home/xxx/projects/tests/test_gdb/test.c:7\"}]}\n(gdb)
\n29^done,locals=[]\n(gdb) \n30^done,stack=[frame={level=\"0\",addr=\"")
  gud-filter(#<process gud-test>
"27^done,threads=[{id=\"1\",target-id=\"process
25128\",name=\"test\",frame={level=\"0\",addr=\"0x00000000004004f4\",func=\"main\",args=[],file=\"test.c\",fullname=\"/home/xxx/projects/tests/test_gdb/test.c\",line=\"7\"},state=\"stopped\",core=\"24\"}],current-thread-id=\"1\"\n(gdb)
\n28^done,BreakpointTable={nr_rows=\"1\",nr_cols=\"6\",hdr=[{width=\"7\",alignment=\"-1\",col_name=\"number\",colhdr=\"Num\"},{width=\"14\",alignment=\"-1\",col_name=\"type\",colhdr=\"Type\"},{width=\"4\",alignment=\"-1\",col_name=\"disp\",colhdr=\"Disp\"},{width=\"3\",alignment=\"-1\",col_name=\"enabled\",colhdr=\"Enb\"},{width=\"18\",alignment=\"-1\",col_name=\"addr\",colhdr=\"Address\"},{width=\"40\",alignment=\"2\",col_name=\"what\",colhdr=\"What\"}],body=[bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x00000000004004f4\",func=\"main\",file=\"test.c\",fullname=\"/home/xxx/projects/tests/test_gdb/test.c\",line=\"7\",thread-groups=[\"i1\"],times=\"1\",original-location=\"/home/xxx/projects/tests/test_gdb/test.c:7\"}]}\n(gdb)
\n29^done,locals=[]\n(gdb) \n30^done,stack=[frame={level=\"0\",addr=\"")



In GNU Emacs 26.0.50 (build 1, x86_64-apple-darwin13.4.0, NS appkit-1265.21
Version 10.9.5 (Build 13F1911))
 of 2017-06-11 built on builder10-9.local
Windowing system distributor 'Apple', version 10.3.1504
Recent messages:
Warning: arch-dependent data dir
’/Users/build/workspace/Emacs-Multi-Build/label/mavericks/emacs-source/nextstep/Emacs.app/Contents/MacOS/libexec/’:
No such file or directory

For information about GNU Emacs and the GNU system, type C-h C-a.
user-error: Beginning of history; no preceding item
user-error: End of history; no default available
Quit

Configured using:
 'configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp' --with-modules'

Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message subr-x puny seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils thingatpt time-date
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote kqueue cocoa ns
multi-tty make-network-process emacs)

Memory information:
((conses 16 203699 7694)
 (symbols 48 19849 1)
 (miscs 40 71 164)
 (strings 32 18182 5316)
 (string-bytes 1 600826)
 (vectors 16 34880)
 (vector-slots 8 694435 4243)
 (floats 8 49 67)
 (intervals 56 194 0)
 (buffers 976 12))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28392; Package emacs. (Mon, 30 Nov 2020 10:58:02 GMT) Full text and rfc822 format available.

Message #8 received at 28392 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Zhongwei Yao <ashi08104 <at> gmail.com>
Cc: 28392 <at> debbugs.gnu.org
Subject: Re: bug#28392: 26.0.50; gdb-mi runs into error with tramp
Date: Mon, 30 Nov 2020 11:57:27 +0100
Zhongwei Yao <ashi08104 <at> gmail.com> writes:

> Steps:
> 1. Open test.c on dev-server in emacs
> 2. run 'M-x gdb'  gdb -i=mi test_bin and open gdb-many-window mode.
> 3. In *gud-test* buffer, run: break 7
> 4. Run: run and gdb stop at line 7
> 5. Step into line 7
>
> But the cursor of source buffer will not move at all. And then emacs become
> irresponsive after running several step commands. I press Ctrl-G
> several times

(This bug report unfortunately got no response at the time.)

I vaguely remember seeing a bug report about gdb and Tramp, so this may
or may not have been fixed in the years since this was reported.  Are
you still seeing this problem in Emacs 28?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 30 Nov 2020 10:58:02 GMT) Full text and rfc822 format available.

Merged 28392 44151. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Mon, 30 Nov 2020 11:45:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28392; Package emacs. (Mon, 30 Nov 2020 11:49:01 GMT) Full text and rfc822 format available.

Message #15 received at 28392 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 28392 <at> debbugs.gnu.org, Zhongwei Yao <ashi08104 <at> gmail.com>
Subject: Re: bug#28392: 26.0.50; gdb-mi runs into error with tramp
Date: Mon, 30 Nov 2020 12:48:31 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

Hi,

>> Steps:
>> 1. Open test.c on dev-server in emacs
>> 2. run 'M-x gdb'  gdb -i=mi test_bin and open gdb-many-window mode.
>> 3. In *gud-test* buffer, run: break 7
>> 4. Run: run and gdb stop at line 7
>> 5. Step into line 7
>>
>> But the cursor of source buffer will not move at all. And then emacs become
>> irresponsive after running several step commands. I press Ctrl-G
>> several times
>
> I vaguely remember seeing a bug report about gdb and Tramp, so this may
> or may not have been fixed in the years since this was reported.  Are
> you still seeing this problem in Emacs 28?

Bug#44151. The Tramp part is solved in Emacs' master branch, but there's
still something left for the gdb part. I've merged both bugs.

(Unfortunately, I'm not a gdb-mi.el expert).

Best regards, Michael.




Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 14 Dec 2020 17:17:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28392; Package emacs. (Fri, 16 Apr 2021 07:12:02 GMT) Full text and rfc822 format available.

Message #20 received at 28392 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: 28392 <at> debbugs.gnu.org
Subject: Re: bug#28392: 26.0.50; gdb-mi runs into error with tramp
Date: Thu, 15 Apr 2021 22:03:00 -0700
[Message part 1 (text/plain, inline)]
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.)
[0002-Emacs-27-Fix-GUD-overlay-arrows-in-M-x-gdb-when-debugging-ove.patch (application/octet-stream, attachment)]
[0001-Emacs-28-Fix-GUD-overlay-arrows-in-gdb-mi-when-debugging-over.patch (application/octet-stream, attachment)]

Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Sat, 01 May 2021 10:14:02 GMT) Full text and rfc822 format available.

Notification sent to Zhongwei Yao <ashi08104 <at> gmail.com>:
bug acknowledged by developer. (Sat, 01 May 2021 10:14:02 GMT) Full text and rfc822 format available.

Message #25 received at 28392-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 28392-done <at> debbugs.gnu.org
Subject: Re: bug#28392: 26.0.50; gdb-mi runs into error with tramp
Date: Sat, 01 May 2021 12:13:22 +0200
Version: 27.3

Jim Porter <jporterbugs <at> gmail.com> writes:

> 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.

Pushed to both the emacs-27 and master branch. Closing the bug.

I don't know whether there will be an Emacs 27.3, but it doesn't hurt to
push the fix, I believe.

Best regards, Michael.




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Sat, 01 May 2021 10:14:03 GMT) Full text and rfc822 format available.

Notification sent to William Xu <william.xwl <at> gmail.com>:
bug acknowledged by developer. (Sat, 01 May 2021 10:14:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 29 May 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 333 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.