# emacs-buffer.gdb --- gdb macros for recovering buffers from emacs coredumps
-# Copyright (C) 2005, 06, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2005-2012 Free Software Foundation, Inc.
# Maintainer: Noah Friedman <friedman@splode.com>
# Created: 2005-04-28
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