From 42c8768134dcfaaf08637e36fe478605c1957517 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 17 Nov 2017 12:08:06 +0200 Subject: [PATCH] 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) --- src/.gdbinit | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/.gdbinit b/src/.gdbinit index 60f6348715c..48bb5dfadb8 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... -- 2.39.2