GNU bug report logs - #31918
25.3; gud inserts invalid gdb commands (gdb 7.10.1 --target=arm-buildroot-...)

Previous Next

Package: emacs;

Reported by: Moritz Wilhelmy <mw-emacs <at> barfooze.de>

Date: Wed, 20 Jun 2018 19:45:02 UTC

Severity: normal

Tags: unreproducible

Found in version 25.3

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 31918 in the body.
You can then email your comments to 31918 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#31918; Package emacs. (Wed, 20 Jun 2018 19:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Moritz Wilhelmy <mw-emacs <at> barfooze.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 20 Jun 2018 19:45:02 GMT) Full text and rfc822 format available.

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

From: Moritz Wilhelmy <mw-emacs <at> barfooze.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.3; gud inserts invalid gdb commands
Date: Wed, 20 Jun 2018 21:34:44 +0200
I'm experiencing problems attaching commands to breakpoints with
gdb/gud. I reproduced this using emacs -q. I also tried to reproduce the
same behaviour with gdb running inside the terminal, but it did not
occur, therefore I blame Emacs. ;)

After M-x gdb, I wrote approximately this (unimportant parts elided):

(gdb) br phy_device.c:579
Breakpoint 2 at 0xc029c468: file drivers/net/phy/phy_device.c, line 579.
(gdb) commands
Type commands for breakpoint(s) 2, one per line.
End with a line saying just "end".
info args
>>>>>info locals
>p/x phy_id
>p bus->id
>if addr < 31
 >cont
 >end
>end
(gdb) i br
2       breakpoint     keep y   0xc029c468 in get_phy_device at drivers/net/phy/phy_device.c:579
	breakpoint already hit 1 time
        info args
        41-stack-info-frame --thread 2
        42-thread-info --thread 2
        43-break-list
        info locals
        p/x phy_id
        p bus->id
        if addr < 31
          cont
        end
(gdb) 

What's the deal with these three lines?

        41-stack-info-frame --thread 2
        42-thread-info --thread 2
        43-break-list

Best,

Moritz


In GNU Emacs 25.3.1 (x86_64-suse-linux-gnu, GTK+ Version 3.22.30)
 of 2018-06-10 built on lamb03
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description:	openSUSE Tumbleweed

Configured using:
 'configure --with-pop --without-hesiod --with-kerberos --with-kerberos5
 --with-xim --with-wide-int --with-file-notification=inotify
 --with-modules --enable-autodepend --prefix=/usr
 --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share
 --localstatedir=/var --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --enable-locallisppath=/usr/share/emacs/25.3/site-lisp:/usr/share/emacs/site-lisp
 --with-x --with-sound --with-xpm --with-jpeg --with-tiff --with-gif
 --with-png --with-rsvg --with-dbus --with-xft --without-gpm
 --with-x-toolkit=gtk3 --with-xwidgets --with-toolkit-scroll-bars
 --x-includes=/usr/include --x-libraries=/usr/lib64 --with-libotf
 --with-m17n-flt --build=x86_64-suse-linux 'CFLAGS=-fmessage-length=0
 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2
 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
 -fstack-clash-protection -g -D_GNU_SOURCE
 -DGDK_DISABLE_DEPRECATION_WARNINGS -DGLIB_DISABLE_DEPRECATION_WARNINGS
 -pipe -Wno-pointer-sign -Wno-unused-variable -Wno-unused-label
 -Wno-unprototyped-calls -fno-optimize-sibling-calls -fno-PIE
 -DSYSTEM_PURESIZE_EXTRA=55000 -DSITELOAD_PURESIZE_EXTRA=10000 '
 LDFLAGS=-Wl,-O2'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES XWIDGETS

Important settings:
  value of $LC_COLLATE: C
  value of $LC_CTYPE: en_US.UTF-8
  value of $LC_NUMERIC: POSIX
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Debugger

Minor modes in effect:
  diff-auto-refine-mode: t
  show-paren-mode: t
  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
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: (only . t)

Recent messages:
Checking 24 files in /usr/share/emacs/25.3/lisp/cedet...
Checking 57 files in /usr/share/emacs/25.3/lisp/calendar...
Checking 87 files in /usr/share/emacs/25.3/lisp/calc...
Checking 120 files in /usr/share/emacs/25.3/lisp/obsolete...
Checking for load-path shadows...done
scroll-down-command: Beginning of buffer
scroll-up-command: End of buffer
scroll-down-command: Beginning of buffer
next-line: End of buffer [21 times]
Auto-saving...done
previous-line: Beginning of buffer [3 times]

Load-path shadows:
None found.

Features:
(pp shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-fns kmacro
thingatpt etags xref project eieio eieio-core cl-macs vc-git diff-mode
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs cl-seq gdb-mi bindat json map seq byte-opt gv bytecomp
byte-compile cl-extra help-mode cconv cl-loaddefs pcase cl-lib gud
easy-mmode comint ansi-color ring misearch multi-isearch jka-compr info
easymenu paren ispell time-date mule-util delsel lpr tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core 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 charscript case-table epa-hook jka-cmpr-hook help
simple abbrev 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
dbusbind inotify dynamic-setting system-font-setting font-render-setting
xwidget-internal move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 223680 21443)
 (symbols 48 25962 0)
 (miscs 40 351 417)
 (strings 32 47786 8262)
 (string-bytes 1 2193690)
 (vectors 16 22020)
 (vector-slots 8 572010 11995)
 (floats 8 275 338)
 (intervals 56 13253 173)
 (buffers 976 37))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31918; Package emacs. (Thu, 21 Jun 2018 14:28:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Moritz Wilhelmy <mw-emacs <at> barfooze.de>
Cc: 31918 <at> debbugs.gnu.org
Subject: Re: bug#31918: 25.3; gud inserts invalid gdb commands
Date: Thu, 21 Jun 2018 17:27:02 +0300
> From: Moritz Wilhelmy <mw-emacs <at> barfooze.de>
> Date: Wed, 20 Jun 2018 21:34:44 +0200
> 
> I'm experiencing problems attaching commands to breakpoints with
> gdb/gud. I reproduced this using emacs -q. I also tried to reproduce the
> same behaviour with gdb running inside the terminal, but it did not
> occur, therefore I blame Emacs. ;)
> 
> After M-x gdb, I wrote approximately this (unimportant parts elided):
> 
> (gdb) br phy_device.c:579
> Breakpoint 2 at 0xc029c468: file drivers/net/phy/phy_device.c, line 579.
> (gdb) commands
> Type commands for breakpoint(s) 2, one per line.
> End with a line saying just "end".
> info args
> >>>>>info locals
> >p/x phy_id
> >p bus->id
> >if addr < 31
>  >cont
>  >end
> >end
> (gdb) i br
> 2       breakpoint     keep y   0xc029c468 in get_phy_device at drivers/net/phy/phy_device.c:579
> 	breakpoint already hit 1 time
>         info args
>         41-stack-info-frame --thread 2
>         42-thread-info --thread 2
>         43-break-list
>         info locals
>         p/x phy_id
>         p bus->id
>         if addr < 31
>           cont
>         end
> (gdb) 
> 
> What's the deal with these three lines?
> 
>         41-stack-info-frame --thread 2
>         42-thread-info --thread 2
>         43-break-list

I tried to reproduce this, but couldn't.  Please tell what is your GDB
version.  Also, can you provide a complete recipe, including a program
to debug, and all the steps needed to reproduce the issue, preferably
starting from "emacs -Q"?

(The additional commands are commands injected by gdb-mi.el to allow
Emacs display of various information: call-stack, thread information,
etc.  But they shouldn't appear in the commands you specified for your
breakpoints, so this is still some kind of problem.  I cannot
reproduce it, though.)

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31918; Package emacs. (Sat, 23 Jun 2018 15:06:02 GMT) Full text and rfc822 format available.

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

From: Moritz Wilhelmy <mw-emacs <at> barfooze.de>
To: 31918 <at> debbugs.gnu.org
Subject: Re: bug#31918: 25.3; gud inserts invalid gdb commands
Date: Sat, 23 Jun 2018 17:05:41 +0200
Hi Eli,

On Thu, Jun 21 2018, Eli Zaretskii wrote:
> I tried to reproduce this, but couldn't.  Please tell what is your GDB
> version.  Also, can you provide a complete recipe, including a program
> to debug, and all the steps needed to reproduce the issue, preferably
> starting from "emacs -Q"?

The program I'm debugging is a Linux kernel on an ARM SoC over a serial
link. We're using an older version of buildroot to build everything
(planning to switch to something newer, which would also bring a newer
gdb version), but for now we're stuck with this:

$ cat bin/kernelgdb
#!/bin/sh
BR=~/src/buildroot
exec ${BR}/output/host/usr/bin/arm-buildroot-linux-musleabi-gdb ${BR}/output/images/vmlinux -b 115200 -ex "target remote localhost:4441" "$@"

With agent-proxy running on localhost 4440^4441.

$ exec ${BR}/output/host/usr/bin/arm-buildroot-linux-musleabi-gdb
GNU gdb (GDB) 7.10.1
Copyright (C) 2015 Free Software Foundation, Inc.
...
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=arm-buildroot-linux-musleabi".
...
(gdb) show configuration
This GDB was configured as follows:
   configure --host=x86_64-pc-linux-gnu --target=arm-buildroot-linux-musleabi
             --with-auto-load-dir=$debugdir:$datadir/auto-load
             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
             --with-expat
             --with-gdb-datadir=/home/mw/src/FAME/miro-service.buildroot/output/host/usr/share/gdb (relocatable)
             --with-jit-reader-dir=/home/mw/src/FAME/miro-service.buildroot/output/host/usr/lib/gdb (relocatable)
             --without-libunwind-ia64
             --with-lzma
             --without-guile
             --with-separate-debug-dir=/home/mw/src/FAME/miro-service.buildroot/output/host/usr/lib/debug (relocatable)
             --without-babeltrace

("Relocatable" means the directory can be moved with the GDB installation
tree, and GDB will still find it.)
(gdb)

Is there a minimum required gdb version for gdb-mi to work correctly?

> (The additional commands are commands injected by gdb-mi.el to allow
> Emacs display of various information: call-stack, thread information,
> etc.  But they shouldn't appear in the commands you specified for your
> breakpoints, so this is still some kind of problem.  I cannot
> reproduce it, though.)

For now, I've switched back to gud-gdb without MI, which seems to work
better on my setup but I'm somewhat invested in the future of gdb/gud
and I think MI is a step in the right direction, so please let me know
if you need any more information.

Best regards,

Moritz




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31918; Package emacs. (Sat, 23 Jun 2018 15:15:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Moritz Wilhelmy <mw-emacs <at> barfooze.de>
Cc: 31918 <at> debbugs.gnu.org
Subject: Re: bug#31918: 25.3; gud inserts invalid gdb commands
Date: Sat, 23 Jun 2018 18:14:27 +0300
> From: Moritz Wilhelmy <mw-emacs <at> barfooze.de>
> Date: Sat, 23 Jun 2018 17:05:41 +0200
> 
> $ exec ${BR}/output/host/usr/bin/arm-buildroot-linux-musleabi-gdb
> GNU gdb (GDB) 7.10.1
> Copyright (C) 2015 Free Software Foundation, Inc.
> ...
> This GDB was configured as "--host=x86_64-pc-linux-gnu --target=arm-buildroot-linux-musleabi".
> ...
> (gdb) show configuration
> This GDB was configured as follows:
>    configure --host=x86_64-pc-linux-gnu --target=arm-buildroot-linux-musleabi
>              --with-auto-load-dir=$debugdir:$datadir/auto-load
>              --with-auto-load-safe-path=$debugdir:$datadir/auto-load
>              --with-expat
>              --with-gdb-datadir=/home/mw/src/FAME/miro-service.buildroot/output/host/usr/share/gdb (relocatable)
>              --with-jit-reader-dir=/home/mw/src/FAME/miro-service.buildroot/output/host/usr/lib/gdb (relocatable)
>              --without-libunwind-ia64
>              --with-lzma
>              --without-guile
>              --with-separate-debug-dir=/home/mw/src/FAME/miro-service.buildroot/output/host/usr/lib/debug (relocatable)
>              --without-babeltrace
> 
> ("Relocatable" means the directory can be moved with the GDB installation
> tree, and GDB will still find it.)
> (gdb)
> 
> Is there a minimum required gdb version for gdb-mi to work correctly?

GDB 7.0, AFAIK.  But it's possible that some features need a newer
GDB.

If you invoke GDB from the shell with -i=mi, can you reproduce the
problem?

Also, do these commands appear in "info break" output right after you
define the breakpoint, or do you need the breakpoint to break a few
times before that happens?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31918; Package emacs. (Sat, 23 Jun 2018 16:14:01 GMT) Full text and rfc822 format available.

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

From: Moritz Wilhelmy <mw-emacs <at> barfooze.de>
To: 31918 <at> debbugs.gnu.org
Subject: Re: bug#31918: 25.3; gud inserts invalid gdb commands
Date: Sat, 23 Jun 2018 18:13:27 +0200
On Sat, Jun 23 2018, Eli Zaretskii wrote:
> GDB 7.0, AFAIK.  But it's possible that some features need a newer
> GDB.

I'll try this as soon as we get this kernel update out of the door.

> If you invoke GDB from the shell with -i=mi, can you reproduce the
> problem?

I did one debug session last week with manually running gdb -i=mi to
verify whether this is the case, and console gdb did not insert these
commands so my debugging session ran without problems.

I also noticed that Linux console output takes the following form on my
setup:
@"console message from the kernel"
These show up in the terminal, but not in gdb-mi inside Emacs, making
Linux debugging with gdb-mi a bit cumbersome at the moment. I think this
is the format that's described in (info "(gdb) GDB/MI Stream Records").

> Also, do these commands appear in "info break" output right after you
> define the breakpoint, or do you need the breakpoint to break a few
> times before that happens?

I'll check on Monday. I think they appeared right away but I might be
wrong.


Best regards,

Moritz




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31918; Package emacs. (Sat, 23 Jun 2018 16:32:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Moritz Wilhelmy <mw-emacs <at> barfooze.de>
Cc: 31918 <at> debbugs.gnu.org
Subject: Re: bug#31918: 25.3; gud inserts invalid gdb commands
Date: Sat, 23 Jun 2018 19:31:06 +0300
> From: Moritz Wilhelmy <mw-emacs <at> barfooze.de>
> Date: Sat, 23 Jun 2018 18:13:27 +0200
> 
> I also noticed that Linux console output takes the following form on my
> setup:
> @"console message from the kernel"
> These show up in the terminal, but not in gdb-mi inside Emacs, making
> Linux debugging with gdb-mi a bit cumbersome at the moment.

Does it perhaps appear in the I/O window?

There's also an unused gdbmi-bnf-target-stream-output, maybe you could
use it for this.




Changed bug title to '25.3; gud inserts invalid gdb commands (gdb 7.10.1 --target=arm-buildroot-...)' from '25.3; gud inserts invalid gdb commands' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 25 Jul 2018 02:25:02 GMT) Full text and rfc822 format available.

Added tag(s) unreproducible. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 25 Jul 2018 02:25:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31918; Package emacs. (Sat, 13 Jul 2019 03:39:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31918 <at> debbugs.gnu.org, Moritz Wilhelmy <mw-emacs <at> barfooze.de>
Subject: Re: bug#31918: 25.3; gud inserts invalid gdb commands
Date: Sat, 13 Jul 2019 05:38:30 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Moritz Wilhelmy <mw-emacs <at> barfooze.de>
>> Date: Sat, 23 Jun 2018 18:13:27 +0200
>> 
>> I also noticed that Linux console output takes the following form on my
>> setup:
>> @"console message from the kernel"
>> These show up in the terminal, but not in gdb-mi inside Emacs, making
>> Linux debugging with gdb-mi a bit cumbersome at the moment.
>
> Does it perhaps appear in the I/O window?
>
> There's also an unused gdbmi-bnf-target-stream-output, maybe you could
> use it for this.

More information was requested a year ago, but apparently wasn't given,
so I'm closing this bug report.

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




bug closed, send any further explanations to 31918 <at> debbugs.gnu.org and Moritz Wilhelmy <mw-emacs <at> barfooze.de> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 13 Jul 2019 03:39:02 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, 10 Aug 2019 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 260 days ago.

Previous Next


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