Improve GDB symbol export.
[bpt/emacs.git] / src / .gdbinit
index c044b40..25b555b 100644 (file)
@@ -46,17 +46,29 @@ handle SIGALRM ignore
 # Use $bugfix so that the value isn't a constant.
 # Using a constant runs into GDB bugs sometimes.
 define xgetptr
-  set $bugfix = CHECK_LISP_OBJECT_TYPE ? $arg0.i : $arg0
+  if (CHECK_LISP_OBJECT_TYPE)
+    set $bugfix = $arg0.i
+  else
+    set $bugfix = $arg0
+  end
   set $ptr = ($bugfix & VALMASK) | DATA_SEG_BITS
 end
 
 define xgetint
-  set $bugfix = CHECK_LISP_OBJECT_TYPE ? $arg0.i : $arg0
-  set $int = USE_LSB_TAG ? $bugfix >> INTTYPEBITS : $bugfix << INTTYPEBITS >> INTTYPEBITS
+  if (CHECK_LISP_OBJECT_TYPE)
+    set $bugfix = $arg0.i
+  else
+    set $bugfix = $arg0
+  end
+  set $int = $bugfix << (USE_LSB_TAG ? 0 : INTTYPEBITS) >> INTTYPEBITS
 end
 
 define xgettype
-  set $bugfix = CHECK_LISP_OBJECT_TYPE ? $arg0.i : $arg0
+  if (CHECK_LISP_OBJECT_TYPE)
+    set $bugfix = $arg0.i
+  else
+    set $bugfix = $arg0
+  end
   set $type = (enum Lisp_Type) (USE_LSB_TAG ? $bugfix & (1 << GCTYPEBITS) - 1 : $bugfix >> VALBITS)
 end