GNU bug report logs - #1490
23.0.60; C-d sends "\n" while debugging with gdb in Emacs

Previous Next

Package: emacs;

Reported by: "Joseph Yen" <joseph.yen <at> gmail.com>

Date: Thu, 4 Dec 2008 14:30:02 UTC

Severity: normal

Tags: wontfix

Found in version 23.0.60

Done: Chong Yidong <cyd <at> gnu.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 1490 in the body.
You can then email your comments to 1490 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-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1490; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Joseph Yen" <joseph.yen <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Joseph Yen" <joseph.yen <at> gmail.com>
To: emacs-pretest-bug <at> gnu.org
Cc: rfrancoise <at> debian.org
Subject: 23.0.60; C-d sends "\n" while debugging with gdb in Emacs
Date: Thu, 4 Dec 2008 22:21:49 +0800
While in the gdb of Emacs ...
  (gdb) set var retp = fgets(buf, 32, stdin)
                                          <--- I typed C-d here
without typing RETURN
  (gdb) p retp
  $4 = 0xffe1e58c "\n"
  (gdb) set var reti = getchar()
                                          <--- I typed C-d here
without typing RETURN
  (gdb) p reti
  $6 = 10

But in pure gdb
  (gdb) set var retp = fgets(buf, 32, stdin)
  (gdb) p retp
  $1 = 0x0
  (gdb) set var reti = getchar()
  (gdb) p reti
  $2 = -1
  (gdb)

Emacs sends extra '\n' character when i type C-d in debugger mode


In GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11)
 of 2008-11-30 on elegiac, modified by Debian
 (emacs-snapshot package, version 1:20081129-1)
configured using `configure  '--build' 'i486-linux-gnu' '--host'
'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib'
'--libexecdir=/usr/lib' '--localstatedir=/var' '--\
infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes'
'--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.60/site-lisp:/usr/local/s\
hare/emacs/site-lisp:/usr/share/emacs/23.0.60/site-lisp:/usr/share/emacs/site-lisp'
'--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu'
'host_alias=i486-linux-gn\
u' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g
-Wl,--as-needed' 'CPPFLAGS=''
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t
Major mode: Debugger
Minor modes in effect:
  show-paren-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t


--
joseph.yen <at> gmail.com




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1490; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "richardeng" <richardeng <at> foxmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #10 received at 1490 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "richardeng" <richardeng <at> foxmail.com>
To: "Joseph Yen" <joseph.yen <at> gmail.com>,
        "1490" <1490 <at> debbugs.gnu.org>
Subject: Re: bug#1490: 23.0.60; C-d sends "\n" while debugging with gdb in Emacs
Date: Fri, 5 Dec 2008 11:25:20 +0800
Package: emacs
Version: 23.0.60
Severity: minor
Tags: patch

--- gdb-ui.el.~1.253.~  2008-07-16 16:02:52.000000000 -0700                                                    
+++ gdb-ui.el   2008-11-03 03:51:32.000000000 -0800                                                            
@@ -1248,7 +1248,9 @@
            (remove-text-properties (point-min) (point-max) '(face))))                                         
        (if gud-running                                                                                        
            (progn                                                                                             
-             (let ((item (concat string "\n")))                                                               
+             (let ((item ""))                                                                                 
+               (unless (equal string "")                                                                      
+                 (setq item (concat string "\n")))                                                            
                (if gdb-enable-debug (push (cons 'send item) gdb-debug-log))                                   
                (process-send-string proc item)))                                                              
          (if (string-match "\\\\\\'" string)      






Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1490; Package emacs. (Thu, 16 Apr 2009 04:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 16 Apr 2009 04:30:03 GMT) Full text and rfc822 format available.

Message #15 received at 1490 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Nick Roberts  <nickrob <at> snap.net.nz>
Cc: 1490 <at> debbugs.gnu.org
Subject: Re: Re: bug#1490: 23.0.60; C-d sends "\n" while debugging with gdb in Emacs
Date: Thu, 16 Apr 2009 00:23:34 -0400
Hi Nick,

Could you review the patch in Bug#1490?  Thanks.

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1490




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1490; Package emacs. (Thu, 16 Apr 2009 09:25:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to nickrob <at> snap.net.nz (Nick Roberts):
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 16 Apr 2009 09:25:04 GMT) Full text and rfc822 format available.

Message #20 received at 1490 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: nickrob <at> snap.net.nz (Nick Roberts)
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 1490 <at> debbugs.gnu.org
Subject: Re: Re: bug#1490: 23.0.60; C-d sends "\n" while debugging with gdb in Emacs
Date: Thu, 16 Apr 2009 21:15:24 +1200
I can't begin to imagine where one would do something like:

  (gdb) set var retp = fgets(buf, 32, stdin)

in GDB.  If I do this from the command line I get:

  Program received signal SIGSEGV, Segmentation fault.
  0x00007ffff7852522 in fgets () from /lib/libc.so.6
  0x00007ffff7852522 <fgets+50>:	mov    (%rdx),%eax
  ...

I can get

  (gdb) set var reti = getchar()

to work as described.  The proposed patch might be the right thing to do but,
unless Joseph Yen can give a compelling reason as to why someone would
generally type something like this, I intend to leave it as it is until after
the release as I am unsure whether it will have unintended side effects.

-- 
Nick




Tags added: wontfix Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> emacsbugs.donarmstrong.com. (Tue, 11 Aug 2009 04:55:05 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 1490 <at> debbugs.gnu.org and "Joseph Yen" <joseph.yen <at> gmail.com> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 20 Apr 2012 06:46: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. (Fri, 18 May 2012 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 36 days ago.

Previous Next


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