]> git.eshelyaron.com Git - emacs.git/commitdiff
In GDB scripts, don't assume that EMACS_INT fits in long.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 21 Feb 2012 00:07:53 +0000 (16:07 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 21 Feb 2012 00:07:53 +0000 (16:07 -0800)
* etc/emacs-buffer.gdb ($valmask): Don't assume EMACS_INT fits in 'long'.
* src/.gdbinit (xreload): Likewise.

etc/ChangeLog
etc/emacs-buffer.gdb
src/.gdbinit
src/ChangeLog

index 1f1190b19d966dba325da1341cf147b3ff13ea85..7e71eca54b9bd97cc5ddb4af594105bedb57362f 100644 (file)
@@ -1,3 +1,7 @@
+2012-02-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * emacs-buffer.gdb ($valmask): Don't assume EMACS_INT fits in 'long'.
+
 2012-02-10  Leo Liu  <sdl.web@gmail.com>
 
        * NEWS: Change condition-case-no-debug to
index 2bd2fa23794834a1eb466eff8adaee18920ed015..80f69c585dcf9a13f050f4c2b4ced00563b60b45 100644 (file)
@@ -78,7 +78,9 @@ set $yverbose = 1
 set $yfile_buffers_only = 0
 
 set $tagmask = (((long)1 << gdb_gctypebits) - 1)
-set $valmask = gdb_use_lsb ? ~($tagmask) : ((long)1 << gdb_valbits) - 1
+# The consing_since_gc business widens the 1 to EMACS_INT,
+# a symbol not directly visible to GDB.
+set $valmask = gdb_use_lsb ? ~($tagmask) : ((consing_since_gc - consing_since_gc + 1) << gdb_valbits) - 1
 
 define ygetptr
   set $ptr = $arg0
index 74dbd7a4197c0300cf6aa308b34a8808df962c97..7cd828733b102a853acb038830289b6af8f35205 100644 (file)
@@ -1259,7 +1259,9 @@ end
 
 define xreload
   set $tagmask = (((long)1 << gdb_gctypebits) - 1)
-  set $valmask = gdb_use_lsb ? ~($tagmask) : ((long)1 << gdb_valbits) - 1
+  # The consing_since_gc business widens the 1 to EMACS_INT,
+  # a symbol not directly visible to GDB.
+  set $valmask = gdb_use_lsb ? ~($tagmask) : ((consing_since_gc - consing_since_gc + 1) << gdb_valbits) - 1
 end
 document xreload
   When starting Emacs a second time in the same gdb session under
index 911799b2bd2cb1a19807d507620c72ff654b44d0..bd376e9b85533cef643a311da83a2fdc1be97798 100644 (file)
@@ -1,5 +1,8 @@
 2012-02-20  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
+       when computing $valmask.
+
        Fix crash due to non-contiguous EMACS_INT (Bug#10780).
        * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
        (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.