From b93a5f197e67f75f36f442060fe8fd72c6a8f888 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 28 Aug 2017 08:38:05 -0700 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20assume=20-g3=20in=20.gdbinit?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/.gdbinit (EMACS_INT_WIDTH, USE_LSB_TAG): Use reasonable defaults if not in the symbol table. --- src/.gdbinit | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/.gdbinit b/src/.gdbinit index b5a974bb38d..21cdca5b2c0 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -1303,8 +1303,21 @@ if hasattr(gdb, 'printing'): # This implementation should work regardless of C compiler, and # it should not attempt to run any code in the inferior. - EMACS_INT_WIDTH = int(gdb.lookup_symbol("EMACS_INT_WIDTH")[0].value()) - USE_LSB_TAG = int(gdb.lookup_symbol("USE_LSB_TAG")[0].value()) + + # If the macros EMACS_INT_WIDTH and USE_LSB_TAG are not in the + # symbol table, guess reasonable defaults. + sym = gdb.lookup_symbol ("EMACS_INT_WIDTH")[0] + if sym: + EMACS_INT_WIDTH = int (sym.value ()) + else: + sym = gdb.lookup_symbol ("EMACS_INT")[0] + EMACS_INT_WIDTH = 8 * sym.type.sizeof + sym = gdb.lookup_symbol ("USE_LSB_TAG")[0] + if sym: + USE_LSB_TAG = int (sym.value ()) + else: + USE_LSB_TAG = 1 + GCTYPEBITS = 3 VALBITS = EMACS_INT_WIDTH - GCTYPEBITS Lisp_Int0 = 2 -- 2.39.2