]> code.delx.au - gnu-emacs/blobdiff - src/.gdbinit
(struct gl_state_s): New field `offset'.
[gnu-emacs] / src / .gdbinit
index 8546711155141cd18c207c12074800409125d130..1c9c57134e868483a0ffd6fe84cc930c4dc8433e 100644 (file)
@@ -1,12 +1,19 @@
 # Set up a mask to use.
 
-set $valmask = ((EMACS_INT)1 << gdb_valbits) - 1
+# Force loading of symbols, enough to give us gdb_valbits etc.
+set main
+
+# Find lwlib source files too.
+dir ../lwlib
+
+# This should be EMACS_INT, but in some cases that is a macro.
+# long ought to work in all cases right now.
+set $valmask = ((long)1 << gdb_valbits) - 1
 set $nonvalbits = gdb_emacs_intbits - gdb_valbits
 
 # Set up something to print out s-expressions.
 define pr
 set debug_print ($)
-echo \n
 end
 document pr
 Print the emacs s-expression which is $.
@@ -141,7 +148,7 @@ end
 
 define xsymbol
 print (struct Lisp_Symbol *) ((((int) $) & $valmask) | gdb_data_seg_bits)
-output &$->name->data
+output (char*)&$->name->data
 echo \n
 end
 document xsymbol
@@ -193,13 +200,22 @@ end
 
 define xcons
 print (struct Lisp_Cons *) (($ & $valmask) | gdb_data_seg_bits)
-output *$
+output/x *$
 echo \n
 end
 document xcons
 Print the contents of $, assuming it is an Emacs Lisp cons.
 end
 
+define nextcons
+p $.cdr
+xcons
+end
+document nextcons
+Print the contents of the next cell in a list.
+This assumes that the last thing you printed was a cons cell contents
+(type struct Lisp_Cons) or a pointer to one.
+end
 define xcar
 print ((($ >> gdb_valbits) & 0xf) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & $valmask) | gdb_data_seg_bits))->car : 0)
 end