[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master b93a5f1: Don’t assume -g3 in .gdbinit
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master b93a5f1: Don’t assume -g3 in .gdbinit |
Date: |
Mon, 28 Aug 2017 11:38:33 -0400 (EDT) |
branch: master
commit b93a5f197e67f75f36f442060fe8fd72c6a8f888
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Don’t assume -g3 in .gdbinit
* 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 b5a974b..21cdca5 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master b93a5f1: Don’t assume -g3 in .gdbinit,
Paul Eggert <=