]> git.eshelyaron.com Git - emacs.git/commitdiff
(xgetptr, xgetint, xgettype): Copy $arg0 into a temp variable.
authorRichard M. Stallman <rms@gnu.org>
Fri, 21 Jan 2005 00:30:56 +0000 (00:30 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 21 Jan 2005 00:30:56 +0000 (00:30 +0000)
src/.gdbinit

index 6adb9f3fa02d1be09600dc52327f07dfa45651bb..440fa85824458689cab5b4389524fb775d6f3764 100644 (file)
@@ -35,20 +35,23 @@ handle 2 noprint pass
 # debugging.
 handle SIGALRM ignore
 
-# Set up a mask to use.
-# This should be EMACS_INT, but in some cases that is a macro.
-# long ought to work in all cases right now.
+# $valmask and $tagmask are mask values set up by the xreload macro below.
 
+# Use $bugfix so that the value isn't a constant.
+# Using a constant runs into GDB bugs sometimes.
 define xgetptr
-  set $ptr = (gdb_use_union ? $arg0.u.val : $arg0 & $valmask) | gdb_data_seg_bits
+  set $bugfix = $arg0
+  set $ptr = (gdb_use_union ? $bugfix.u.val : $bugfix & $valmask) | gdb_data_seg_bits
 end
 
 define xgetint
-  set $int = gdb_use_union ? $arg0.s.val : (gdb_use_lsb ? $arg0 : $arg0 << gdb_gctypebits) >> gdb_gctypebits
+  set $bugfix = $arg0
+  set $int = gdb_use_union ? $bugfix.s.val : (gdb_use_lsb ? $bugfix : $bugfix << gdb_gctypebits) >> gdb_gctypebits
 end
 
 define xgettype
-  set $type = gdb_use_union ? $arg0.s.type : (enum Lisp_Type) (gdb_use_lsb ? $arg0 & $tagmask : $arg0 >> gdb_valbits)
+  set $bugfix = $arg0
+  set $type = gdb_use_union ? $bugfix.s.type : (enum Lisp_Type) (gdb_use_lsb ? $bugfix & $tagmask : $bugfix >> gdb_valbits)
 end
 
 # Set up something to print out s-expressions.