+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Emacs.
+#
+# GNU Emacs is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Emacs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
# Force loading of symbols, enough to give us gdb_valbits etc.
set main
define xsymbol
print (struct Lisp_Symbol *) ((((int) $) & $valmask) | gdb_data_seg_bits)
-output (char*)$->name->data
-echo \n
+xprintsym $
end
document xsymbol
Print the name and address of the symbol $.
define xbuffer
print (struct buffer *) (($ & $valmask) | gdb_data_seg_bits)
-output &((struct Lisp_String *) ((($->name) & $valmask) | gdb_data_seg_bits))->data
+output ((struct Lisp_String *) ((($->name) & $valmask) | gdb_data_seg_bits))->data
echo \n
end
document xbuffer
define xprintsym
set $sym = (struct Lisp_Symbol *) ((((int) $arg0) & $valmask) | gdb_data_seg_bits)
- output (char*)$sym->name->data
+ set $sym_name = ((struct Lisp_String *)(($sym->xname & $valmask) | gdb_data_seg_bits))
+ output ($sym_name->data[0])@($sym_name->size_byte < 0 ? $sym_name->size : $sym_name->size_byte)
echo \n
end
document xprintsym
define xbacktrace
set $bt = backtrace_list
- while $bt
+ while $bt
set $type = (enum Lisp_Type) ((*$bt->function >> gdb_valbits) & 0x7)
if $type == Lisp_Symbol
xprintsym *$bt->function
end
document xbacktrace
Print a backtrace of Lisp function calls from backtrace_list.
- Set a breakpoint at Fsignal and call this to see from where
+ Set a breakpoint at Fsignal and call this to see from where
an error was signaled.
end
xreload
end
+# Call xreload if a new Emacs executable is loaded.
+define hookpost-run
+ xreload
+end
+
set print pretty on
set print sevenbit-strings