unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25488: 25.1; gdb package interpreter problem
@ 2017-01-19 20:33 Randy Yates
  2017-01-20 19:24 ` Glenn Morris
  2019-09-15  1:21 ` Stefan Kangas
  0 siblings, 2 replies; 10+ messages in thread
From: Randy Yates @ 2017-01-19 20:33 UTC (permalink / raw)
  To: 25488; +Cc: yates@ieee.org, Nick Roberts


this bug is for the gdb package, when debugging remotely. an extraneous
space is appended to the <path-to-exe> given in a "set remote exec-file
<path-to-exe>" command. this is causing the subsequent debug commands
(start, run, etc.) to fail.

presumably this is a bug in the interpreter adding an extraneous space.
note that the same commands issued to a command-line gdb instance work
fine.

Step-by-step
------------

1. configure remote system by running "gdbserver --multi localhost:<port>"

2. on host system, run emacs, then "M-x gdb <ret> -i=mi"

3. at the gdb prompt:

  file <path-to-exe>
  target extended-remote <remote-host-ip-addr>:<port>
  set remote exec-file <path-to-exe>
  start

4.on the remote side, note the message:

  "Cannot exec <path-to-exe> : No such file or directory."

specifically, note the space between "<path-to-exe>" and ":", which
should not be there. this is the extraneous space.



In GNU Emacs 25.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.20.9)
 of 2016-10-13 built on buildvm-05.phx2.fedoraproject.org
Windowing system distributor 'Fedora Project', version 11.0.11804000
Configured using:
 'configure --build=x86_64-redhat-linux-gnu
 --host=x86_64-redhat-linux-gnu --program-prefix=
 --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
 --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
 --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
 --libexecdir=/usr/libexec --localstatedir=/var
 --sharedstatedir=/var/lib --mandir=/usr/share/man
 --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
 --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3
 --with-gpm=no --with-xwidgets build_alias=x86_64-redhat-linux-gnu
 host_alias=x86_64-redhat-linux-gnu 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g
 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
 -m64 -mtune=generic' LDFLAGS=-Wl,-z,relro
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

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 XWIDGETS

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

Major mode: rcirc

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  show-paren-mode: t
  display-time-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  mouse-wheel-mode: t
  use-hard-newlines: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
nnimap read 17k from localhost
nnimap read 25k from localhost
nnimap read 34k from localhost
Mark set
Quit [2 times]
Making completion list...
Quit [2 times]
Making completion list...
Quit [2 times]
Mark set
Quit

Load-path shadows:
/usr/share/emacs/25.1/lisp/progmodes/cpp hides ./cpp

Features:
(shadow emacsbug dictionary link connection eieio-opt speedbar sb-image
ezimage dframe find-func rcirc gdb-mi bindat json map gud search-utils
sd-src-utils tramp-sh browse-url filecache cus-edit jka-compr info
tabify imenu man dired-aux vc-bzr vc-src vc-sccs flow-fill tramp-cache
tramp tramp-compat tramp-loaddefs trampver ucs-normalize advice
conf-mode vc-git diff-mode whitespace pulse make-mode pcmpl-unix qp
mm-archive rect thingatpt ggtags etags xref project ewoc edmacro kmacro
cscope c-comment-edit cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs log-edit easy-mmode
pcvs-util add-log vc-cvs vc-rcs pp misearch multi-isearch vc-svn
tex-mode compile shell pcomplete comint ring latexenc server mailalias
nnir sort ansi-color gnus-cite mail-extr gnus-async gnus-bcklg gnus-ml
disp-table nndraft nnmh utf-7 nnfolder network-stream nsm starttls
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art
mm-uu mml2015 mm-view mml-smime smime dig mailcap nntp gnus-cache
gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int
gnus-range message idna dired format-spec rfc822 mml mml-sec epg
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader gnus-win gnus gnus-ems nnheader wid-edit paren time delsel
cus-start cus-load vc vc-dispatcher derived my-keys mailrc invoices
my-easl-utils my-slime my-color-theme my-tags my-programming-utils
my-packages my-grep-find-file my-dictionary my-compile my-project
my-ggtags my-git ido smtpmail sendmail rfc2047 rfc2045 ietf-drums
mail-utils url-util url-parse auth-source cl-seq eieio eieio-core
cl-macs gnus-util mm-util help-fns mail-prsvr password-cache url-vars
my-utils my-gnus email-html cl finder-inf package epg-config seq
byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv
cl-loaddefs pcase cl-lib time-date mule-util 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 1085807 195400)
 (symbols 48 164211 94)
 (miscs 40 8539 3854)
 (strings 32 222707 17481)
 (string-bytes 1 6015145)
 (vectors 16 62826)
 (vector-slots 8 1069367 52625)
 (floats 8 613 2889)
 (intervals 56 97658 1231)
 (buffers 976 273)
 (heap 1024 269956 169705))




^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25488: 25.1; gdb package interpreter problem
  2017-01-19 20:33 bug#25488: 25.1; gdb package interpreter problem Randy Yates
@ 2017-01-20 19:24 ` Glenn Morris
  2017-01-20 19:33   ` Sergio Durigan Junior
  2019-09-15  1:21 ` Stefan Kangas
  1 sibling, 1 reply; 10+ messages in thread
From: Glenn Morris @ 2017-01-20 19:24 UTC (permalink / raw)
  To: Randy Yates; +Cc: yates@ieee.org, 25488, sergiodj


(Nick doesn't maintain gdb.el any more, so I removed him from the cc)

Randy Yates wrote:

> 1. configure remote system by running "gdbserver --multi localhost:<port>"
>
> 2. on host system, run emacs, then "M-x gdb <ret> -i=mi"
>
> 3. at the gdb prompt:
>
>   file <path-to-exe>
>   target extended-remote <remote-host-ip-addr>:<port>
>   set remote exec-file <path-to-exe>
>   start
>
> 4.on the remote side, note the message:
>
>   "Cannot exec <path-to-exe> : No such file or directory."
>
> specifically, note the space between "<path-to-exe>" and ":", which
> should not be there. this is the extraneous space.


Confirmed on rhel 7.

This seems to be due to the " " in:

(concat gdb-continuation string " ")

in gdb-send, which was added in bug#14847. I've cc'd the author of that change.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25488: 25.1; gdb package interpreter problem
  2017-01-20 19:24 ` Glenn Morris
@ 2017-01-20 19:33   ` Sergio Durigan Junior
  0 siblings, 0 replies; 10+ messages in thread
From: Sergio Durigan Junior @ 2017-01-20 19:33 UTC (permalink / raw)
  To: Glenn Morris; +Cc: yates@ieee.org, 25488, Randy Yates

[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]

On Friday, January 20 2017, Glenn Morris wrote:

>> 1. configure remote system by running "gdbserver --multi localhost:<port>"
>>
>> 2. on host system, run emacs, then "M-x gdb <ret> -i=mi"
>>
>> 3. at the gdb prompt:
>>
>>   file <path-to-exe>
>>   target extended-remote <remote-host-ip-addr>:<port>
>>   set remote exec-file <path-to-exe>
>>   start
>>
>> 4.on the remote side, note the message:
>>
>>   "Cannot exec <path-to-exe> : No such file or directory."
>>
>> specifically, note the space between "<path-to-exe>" and ":", which
>> should not be there. this is the extraneous space.
>
>
> Confirmed on rhel 7.
>
> This seems to be due to the " " in:
>
> (concat gdb-continuation string " ")
>
> in gdb-send, which was added in bug#14847. I've cc'd the author of that change.

Heh, I helped the reporter diagnose this issue, and as it turns out I
was the culprit!

Thanks for the report, I'll take a look at this later today.

Cheers,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25488: 25.1; gdb package interpreter problem
  2017-01-19 20:33 bug#25488: 25.1; gdb package interpreter problem Randy Yates
  2017-01-20 19:24 ` Glenn Morris
@ 2019-09-15  1:21 ` Stefan Kangas
  2019-09-16 13:32   ` Sergio Durigan Junior
  1 sibling, 1 reply; 10+ messages in thread
From: Stefan Kangas @ 2019-09-15  1:21 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: yates@ieee.org, 25488, Randy Yates

Sergio Durigan Junior <sergiodj@sergiodj.net> writes:

> On Friday, January 20 2017, Glenn Morris wrote:
>
>>> 1. configure remote system by running "gdbserver --multi localhost:<port>"
>>>
>>> 2. on host system, run emacs, then "M-x gdb <ret> -i=mi"
>>>
>>> 3. at the gdb prompt:
>>>
>>>   file <path-to-exe>
>>>   target extended-remote <remote-host-ip-addr>:<port>
>>>   set remote exec-file <path-to-exe>
>>>   start
>>>
>>> 4.on the remote side, note the message:
>>>
>>>   "Cannot exec <path-to-exe> : No such file or directory."
>>>
>>> specifically, note the space between "<path-to-exe>" and ":", which
>>> should not be there. this is the extraneous space.
>>
>>
>> Confirmed on rhel 7.
>>
>> This seems to be due to the " " in:
>>
>> (concat gdb-continuation string " ")
>>
>> in gdb-send, which was added in bug#14847. I've cc'd the author of that change.
>
> Heh, I helped the reporter diagnose this issue, and as it turns out I
> was the culprit!
>
> Thanks for the report, I'll take a look at this later today.

Hi Sergio,

I see that the latest update here was in January 2017.  Did you ever get
a chance to look into this issue?

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25488: 25.1; gdb package interpreter problem
  2019-09-15  1:21 ` Stefan Kangas
@ 2019-09-16 13:32   ` Sergio Durigan Junior
  2019-09-16 13:44     ` Stefan Kangas
  2019-09-23 13:03     ` Noam Postavsky
  0 siblings, 2 replies; 10+ messages in thread
From: Sergio Durigan Junior @ 2019-09-16 13:32 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: yates@ieee.org, 25488, Randy Yates

[-- Attachment #1: Type: text/plain, Size: 3210 bytes --]

On Saturday, September 14 2019, Stefan Kangas wrote:

> Sergio Durigan Junior <sergiodj@sergiodj.net> writes:
>
>> On Friday, January 20 2017, Glenn Morris wrote:
>>
>>>> 1. configure remote system by running "gdbserver --multi localhost:<port>"
>>>>
>>>> 2. on host system, run emacs, then "M-x gdb <ret> -i=mi"
>>>>
>>>> 3. at the gdb prompt:
>>>>
>>>>   file <path-to-exe>
>>>>   target extended-remote <remote-host-ip-addr>:<port>
>>>>   set remote exec-file <path-to-exe>
>>>>   start
>>>>
>>>> 4.on the remote side, note the message:
>>>>
>>>>   "Cannot exec <path-to-exe> : No such file or directory."
>>>>
>>>> specifically, note the space between "<path-to-exe>" and ":", which
>>>> should not be there. this is the extraneous space.
>>>
>>>
>>> Confirmed on rhel 7.
>>>
>>> This seems to be due to the " " in:
>>>
>>> (concat gdb-continuation string " ")
>>>
>>> in gdb-send, which was added in bug#14847. I've cc'd the author of that change.
>>
>> Heh, I helped the reporter diagnose this issue, and as it turns out I
>> was the culprit!
>>
>> Thanks for the report, I'll take a look at this later today.
>
> Hi Sergio,
>
> I see that the latest update here was in January 2017.  Did you ever get
> a chance to look into this issue?

Wow, what a strange concept of "later today"!  Sorry about that.

Yeah, I had the chance to look into it, and even though I don't remember
the details now, I have a patch here that seems to work for me.  I'm
attaching it to this message; can you check if it fixes the problem for
you, please?

It seems strange that the extra whitespace was added by mistake there.
I'm a bit afraid that there is a case which I haven't envisioned and
which requires that whitespace, but I couldn't come up with a testing
scenario that triggers the error.  I tested this by debugging a binary
with and without arguments (i.e., "/bin/true" and "/bin/true --help"),
and both worked fine.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

From cad0deb10f2dbdc7b3dd7d3c6f4347da9cb1f557 Mon Sep 17 00:00:00 2001
From: Sergio Durigan Junior <sergiodj@sergiodj.net>
Date: Sun, 15 Sep 2019 14:50:17 -0400
Subject: [PATCH] [gdb-mi.el] Don't add trailing whitespace when passing
 argument to GDB

This fixes bug #25488.

* lisp/progmodes/gdb-mi.el (gdb-send): Don't append whitespace to
'gdb-continuation'.
---
 lisp/progmodes/gdb-mi.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 48c7dde9f51..cf54207337d 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1827,7 +1827,7 @@ gdb-send
 		      " "))
       (setq gdb-first-done-or-error t)
       (let ((to-send (concat "-interpreter-exec console "
-                             (gdb-mi-quote (concat gdb-continuation string " "))
+                             (gdb-mi-quote (concat gdb-continuation string))
                              "\n")))
         (if gdb-enable-debug
             (push (cons 'mi-send to-send) gdb-debug-log))
-- 
2.20.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* bug#25488: 25.1; gdb package interpreter problem
  2019-09-16 13:32   ` Sergio Durigan Junior
@ 2019-09-16 13:44     ` Stefan Kangas
  2019-09-23 13:03     ` Noam Postavsky
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Kangas @ 2019-09-16 13:44 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: yates@ieee.org, 25488, Randy Yates

tags 25488 + patch
quit

Sergio Durigan Junior <sergiodj@sergiodj.net> writes:

> Yeah, I had the chance to look into it, and even though I don't remember
> the details now, I have a patch here that seems to work for me.  I'm
> attaching it to this message; can you check if it fixes the problem for
> you, please?

Thanks for reporting back and providing a patch.  Could someone more
familiar with this code please help test and review this?

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25488: 25.1; gdb package interpreter problem
  2019-09-16 13:32   ` Sergio Durigan Junior
  2019-09-16 13:44     ` Stefan Kangas
@ 2019-09-23 13:03     ` Noam Postavsky
  2019-09-23 13:18       ` Stefan Kangas
  1 sibling, 1 reply; 10+ messages in thread
From: Noam Postavsky @ 2019-09-23 13:03 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: yates@ieee.org, 25488, Randy Yates, Stefan Kangas

> Sergio Durigan Junior <sergiodj@sergiodj.net> writes:
>
>> Yeah, I had the chance to look into it, and even though I don't remember
>> the details now, I have a patch here that seems to work for me.  I'm
>> attaching it to this message; can you check if it fixes the problem for
>> you, please?
>>
>> It seems strange that the extra whitespace was added by mistake there.
>> I'm a bit afraid that there is a case which I haven't envisioned and
>> which requires that whitespace, but I couldn't come up with a testing
>> scenario that triggers the error.  I tested this by debugging a binary
>> with and without arguments (i.e., "/bin/true" and "/bin/true --help"),
>> and both worked fine.

> Thanks for reporting back and providing a patch.  Could someone more
> familiar with this code please help test and review this?

I'm not very familiar with the code, but looking around, it seems quite
likely that the extra " " was just due to a copy paste error.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25488: 25.1; gdb package interpreter problem
  2019-09-23 13:03     ` Noam Postavsky
@ 2019-09-23 13:18       ` Stefan Kangas
  2019-09-23 16:19         ` Eli Zaretskii
  2019-10-02 13:12         ` Stefan Kangas
  0 siblings, 2 replies; 10+ messages in thread
From: Stefan Kangas @ 2019-09-23 13:18 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: yates@ieee.org, 25488, Randy Yates, Sergio Durigan Junior

Noam Postavsky <npostavs@gmail.com> writes:

> > Sergio Durigan Junior <sergiodj@sergiodj.net> writes:
> >
> >> Yeah, I had the chance to look into it, and even though I don't remember
> >> the details now, I have a patch here that seems to work for me.  I'm
> >> attaching it to this message; can you check if it fixes the problem for
> >> you, please?
> >>
> >> It seems strange that the extra whitespace was added by mistake there.
> >> I'm a bit afraid that there is a case which I haven't envisioned and
> >> which requires that whitespace, but I couldn't come up with a testing
> >> scenario that triggers the error.  I tested this by debugging a binary
> >> with and without arguments (i.e., "/bin/true" and "/bin/true --help"),
> >> and both worked fine.
>
> > Thanks for reporting back and providing a patch.  Could someone more
> > familiar with this code please help test and review this?
>
> I'm not very familiar with the code, but looking around, it seems quite
> likely that the extra " " was just due to a copy paste error.

Thanks.  Sergio has also tested this, and it worked for him.  If no
one objects perhaps we could go ahead and install his patch.

I'm assuming that we have his assignment on file since his
contributions already seem to exceed the 15 line limit for trivial
changes.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25488: 25.1; gdb package interpreter problem
  2019-09-23 13:18       ` Stefan Kangas
@ 2019-09-23 16:19         ` Eli Zaretskii
  2019-10-02 13:12         ` Stefan Kangas
  1 sibling, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2019-09-23 16:19 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: yates, 25488, randyy, sergiodj, npostavs

> From: Stefan Kangas <stefan@marxist.se>
> Date: Mon, 23 Sep 2019 15:18:56 +0200
> Cc: "yates@ieee.org" <yates@ieee.org>, 25488@debbugs.gnu.org,
>  Randy Yates <randyy@garnerundergroundinc.com>,
>  Sergio Durigan Junior <sergiodj@sergiodj.net>
> 
> I'm assuming that we have his assignment on file

We do.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25488: 25.1; gdb package interpreter problem
  2019-09-23 13:18       ` Stefan Kangas
  2019-09-23 16:19         ` Eli Zaretskii
@ 2019-10-02 13:12         ` Stefan Kangas
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Kangas @ 2019-10-02 13:12 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: yates@ieee.org, 25488, Randy Yates, Sergio Durigan Junior

close 25488 27.1
quit

> Thanks.  Sergio has also tested this, and it worked for him.  If no
> one objects perhaps we could go ahead and install his patch.

No objections in 9 days, so I've now pushed this as commit 77207ca841.  Closing.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-10-02 13:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-19 20:33 bug#25488: 25.1; gdb package interpreter problem Randy Yates
2017-01-20 19:24 ` Glenn Morris
2017-01-20 19:33   ` Sergio Durigan Junior
2019-09-15  1:21 ` Stefan Kangas
2019-09-16 13:32   ` Sergio Durigan Junior
2019-09-16 13:44     ` Stefan Kangas
2019-09-23 13:03     ` Noam Postavsky
2019-09-23 13:18       ` Stefan Kangas
2019-09-23 16:19         ` Eli Zaretskii
2019-10-02 13:12         ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).