1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-16 02:50:26 -08:00

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)
This commit is contained in:
Eli Zaretskii 2017-11-17 12:08:06 +02:00
parent 720322aab8
commit 42c8768134

View file

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