From: Richard M. Stallman Date: Fri, 21 Jan 2005 00:30:56 +0000 (+0000) Subject: (xgetptr, xgetint, xgettype): Copy $arg0 into a temp variable. X-Git-Tag: ttn-vms-21-2-B4~2651 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0e73312bedf881fd3c7b6aa9306eacd1a3b966d3;p=emacs.git (xgetptr, xgetint, xgettype): Copy $arg0 into a temp variable. --- diff --git a/src/.gdbinit b/src/.gdbinit index 6adb9f3fa02..440fa858244 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -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.