From: Paul Eggert Date: Mon, 28 Aug 2017 15:38:05 +0000 (-0700) Subject: Don’t assume -g3 in .gdbinit X-Git-Tag: emacs-26.0.90~326 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b93a5f197e67f75f36f442060fe8fd72c6a8f888;p=emacs.git Don’t assume -g3 in .gdbinit * src/.gdbinit (EMACS_INT_WIDTH, USE_LSB_TAG): Use reasonable defaults if not in the symbol table. --- 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