Commit 42c87681 authored by Eli Zaretskii's avatar Eli Zaretskii

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)
parent 720322aa
......@@ -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...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment