changeset 59660:5ee7eaad2958

(xgetptr, xgetint, xgettype): Copy $arg0 into a temp variable.
author Richard M. Stallman <rms@gnu.org>
date Fri, 21 Jan 2005 00:30:56 +0000
parents 030542bf12bf
children e7a8549bb201
files src/.gdbinit
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/.gdbinit	Fri Jan 21 00:26:39 2005 +0000
+++ b/src/.gdbinit	Fri Jan 21 00:30:56 2005 +0000
@@ -35,20 +35,23 @@
 # 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.