Subject: bug#29332: closed (Re: bug#29332: 27.0.50; running under gdb)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 17 Nov 2017 10:11:03 +0000

Your bug report

#29332: 27.0.50; running under gdb

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
29332: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=29332
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#29332: 27.0.50; running under gdb
From: Eli Zaretskii <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Fri, 17 Nov 2017 12:10:04 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Richard Stallman <[email-masked]>
> Date: Thu, 16 Nov 2017 22:17:55 -0500
> 
> I cd to src and type
> 
>    gdb emacs
> 
>    r
> 
> and I get the error message
> 
>    there is no member named name
> 
> I am using GDB version 7.7.1 which is in Trisquel 7.
> In principle I could install the latest GDB, but it would be a lot of work
> and I doubt it would make a difference.  I think the bug is in src/.gdbinit.

You are right.  Fixed on the release branch with the changes below.

commit 42c8768134dcfaaf08637e36fe478605c1957517
Author:     Eli Zaretskii <[email-masked]>
AuthorDate: Fri Nov 17 12:08:06 2017 +0200
Commit:     Eli Zaretskii <[email-masked]>
CommitDate: Fri Nov 17 12:08:06 2017 +0200

    Fix .gdbinit following lisp.h changes
    
    * src/.gdbinit (xsymname, pwinx, pgx, xbuffer, xcar, xcdr, xlist)
    (xprintstr): Adapt to latest changes in Lisp object C structures.
    (Bug#29332)

diff --git a/src/.gdbinit b/src/.gdbinit
index 60f6348..48bb5df 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -78,7 +78,7 @@ end
 # Access the name of a symbol
 define xsymname
   xgetsym $arg0
-  set $symname = $ptr->name
+  set $symname = $ptr->u.s.name
 end
 
 # Set up something to print out s-expressions.
@@ -376,7 +376,7 @@ define pwinx
   xgetptr $w->buffer
   set $tem = (struct buffer *) $ptr
   xgetptr $tem->name_
-  printf "%s", ((struct Lisp_String *) $ptr)->data
+  printf "%s", ((struct Lisp_String *) $ptr)->u.s.data
   printf "\n"
   xgetptr $w->start
   set $tem = (struct Lisp_Marker *) $ptr
@@ -504,7 +504,7 @@ define pgx
   xgettype ($g.object)
   if ($type == Lisp_String)
     xgetptr $g.object
-    printf " str=0x%x[%d]", ((struct Lisp_String *)$ptr)->data, $g.charpos
+    printf " str=0x%x[%d]", ((struct Lisp_String *)$ptr)->u.s.data, $g.charpos
   else
     printf " pos=%d", $g.charpos
   end
@@ -896,7 +896,7 @@ define xbuffer
   xgetptr $
   print (struct buffer *) $ptr
   xgetptr $->name_
-  output ((struct Lisp_String *) $ptr)->data
+  output ((struct Lisp_String *) $ptr)->u.s.data
   echo \n
 end
 document xbuffer
@@ -935,7 +935,7 @@ end
 define xcar
   xgetptr $
   xgettype $
-  print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->car : 0)
+  print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.s.car : 0)
 end
 document xcar
 Assume that $ is an Emacs Lisp pair and print its car.
@@ -944,7 +944,7 @@ end
 define xcdr
   xgetptr $
   xgettype $
-  print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.cdr : 0)
+  print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.s.u.cdr : 0)
 end
 document xcdr
 Assume that $ is an Emacs Lisp pair and print its cdr.
@@ -957,9 +957,9 @@ define xlist
   set $nil = $ptr
   set $i = 0
   while $cons != $nil && $i < 10
-    p/x $cons->car
+    p/x $cons->u.s.car
     xpr
-    xgetptr $cons->u.cdr
+    xgetptr $cons->u.s.u.cdr
     set $cons = (struct Lisp_Cons *) $ptr
     set $i = $i + 1
     printf "---\n"
@@ -1072,13 +1072,13 @@ Print $ as a lisp object of any type.
 end
 
 define xprintstr
-  set $data = (char *) $arg0->data
-  set $strsize = ($arg0->size_byte < 0) ? ($arg0->size & ~ARRAY_MARK_FLAG) : $arg0->size_byte
+  set $data = (char *) $arg0->u.s.data
+  set $strsize = ($arg0->u.s.size_byte < 0) ? ($arg0->u.s.size & ~ARRAY_MARK_FLAG) : $arg0->u.s.size_byte
   # GDB doesn't like zero repetition counts
   if $strsize == 0
     output ""
   else
-    output ($arg0->size > 1000) ? 0 : ($data[0])@($strsize)
+    output ($arg0->u.s.size > 1000) ? 0 : ($data[0])@($strsize)
   end
 end
 
@@ -1255,7 +1255,7 @@ commands
   xsymname globals.f_Vinitial_window_system
   xgetptr $symname
   set $tem = (struct Lisp_String *) $ptr
-  set $tem = (char *) $tem->data
+  set $tem = (char *) $tem->u.s.data
   # If we are running in synchronous mode, we want a chance to look
   # around before Emacs exits.  Perhaps we should put the break
   # somewhere else instead...

Subject: 27.0.50; running under gdb
From: Richard Stallman <[email-masked]>
To: [email-masked]
Date: Thu, 16 Nov 2017 22:17:55 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

I cd to src and type

   gdb emacs

   r

and I get the error message

   there is no member named name

I am using GDB version 7.7.1 which is in Trisquel 7.
In principle I could install the latest GDB, but it would be a lot of work
and I doubt it would make a difference.  I think the bug is in src/.gdbinit.

In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.23)
 of 2017-11-15 built on freetop
Repository revision: 52d822f31bc7cb57694c1e209b2d02e5efb8f48c
System Description:	Trisquel GNU/Linux 7.0, Belenos

Recent messages:
Loading paren...done
Loading view...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Note: file is write protected [4 times]
Counting messages...done
(No new mail has arrived)
0 new messages read
~/emacs-git/build-nov-15/src 

Configured using:
 'configure 'CFLAGS=-O0 -g' --with-gnutls=no'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS NOTIFY LIBXML2
FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11

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

Major mode: RMAIL

Minor modes in effect:
  shell-dirtrack-mode: t
  gpm-mouse-mode: t
  tooltip-mode: t
  global-eldoc-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
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Load-path shadows:
None found.

Features:
(shadow emacsbug mailalias pcmpl-unix shell pcomplete comint
ansi-color ring rmailmm message sendmail rmc puny format-spec rfc822
mml mml-sec epa epg gnus-util mm-decode mm-bodies mm-encode mailabbrev
gmm-utils mailheader mail-parse rfc2231 rmail rmail-loaddefs rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils dired dired-loaddefs
t-mouse term/linux elec-pair view derived time-date paren cus-start
cus-load advice finder-inf package easymenu epg-config url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv
cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd 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
dbusbind inotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 241663 17158)
 (symbols 48 22882 2)
 (miscs 40 1971 1937)
 (strings 32 36389 2268)
 (string-bytes 1 980507)
 (vectors 16 15625)
 (vector-slots 8 491132 19474)
 (floats 8 66 295)
 (intervals 56 56888 41)
 (buffers 992 32)
 (heap 1024 17980 1513))
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
Skype: No way! See https://stallman.org/skype.html.