aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2013-10-16 20:08:59 -0700
committerPaul Eggert2013-10-16 20:08:59 -0700
commitbb9937df2db9129cdc248532a93f406221a2f65c (patch)
tree2f667dad6e953d2d5f49c5ed886c61b8ac2d7a30
parentf2752e013d24133b645d60b226579f8ae9f1587d (diff)
downloademacs-bb9937df2db9129cdc248532a93f406221a2f65c.tar.gz
emacs-bb9937df2db9129cdc248532a93f406221a2f65c.zip
Make VALMASK visible to GDB even if clang is used.
* emacs.c (MAIN_PROGRAM): New macro. * lisp.h (DEFINE_GDB_SYMBOL_BEGIN, DEFINE_GDB_SYMBOL_END): New macros. (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Use them. Fixes: debbugs:15574
-rw-r--r--src/ChangeLog5
-rw-r--r--src/emacs.c1
-rw-r--r--src/lisp.h35
3 files changed, 33 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2e175a723dc..f95ee3384bf 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
12013-10-17 Paul Eggert <eggert@cs.ucla.edu> 12013-10-17 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Make VALMASK visible to GDB even if clang is used (Bug#15574).
4 * emacs.c (MAIN_PROGRAM): New macro.
5 * lisp.h (DEFINE_GDB_SYMBOL_BEGIN, DEFINE_GDB_SYMBOL_END): New macros.
6 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Use them.
7
3 bool vector int width fixes 8 bool vector int width fixes
4 * data.c (bool_vector_spare_mask, Fbool_vector_count_matches) 9 * data.c (bool_vector_spare_mask, Fbool_vector_count_matches)
5 (Fbool_vector_count_matches_at): 10 (Fbool_vector_count_matches_at):
diff --git a/src/emacs.c b/src/emacs.c
index 79f759cd5b5..06b8d290cae 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -30,6 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30 30
31#include <close-stream.h> 31#include <close-stream.h>
32 32
33#define MAIN_PROGRAM
33#include "lisp.h" 34#include "lisp.h"
34 35
35#ifdef WINDOWSNT 36#ifdef WINDOWSNT
diff --git a/src/lisp.h b/src/lisp.h
index d25904be379..4e141c71319 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -35,6 +35,24 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
35 35
36INLINE_HEADER_BEGIN 36INLINE_HEADER_BEGIN
37 37
38/* Define a TYPE constant ID as an externally visible name. Use like this:
39
40 DEFINE_GDB_SYMBOL_BEGIN (TYPE, ID)
41 #define ID something
42 DEFINE_GDB_SYMBOL_END (ID)
43
44 This hack is for the benefit of compilers that do not make macro
45 definitions visible to the debugger. It's used for symbols that
46 .gdbinit needs, symbols whose values may not fit in 'int' (where an
47 enum would suffice). */
48#ifdef MAIN_PROGRAM
49# define DEFINE_GDB_SYMBOL_BEGIN(type, id) type const id EXTERNALLY_VISIBLE
50# define DEFINE_GDB_SYMBOL_END(id) = id;
51#else
52# define DEFINE_GDB_SYMBOL_BEGIN(type, id)
53# define DEFINE_GDB_SYMBOL_END(val)
54#endif
55
38/* The ubiquitous max and min macros. */ 56/* The ubiquitous max and min macros. */
39#undef min 57#undef min
40#undef max 58#undef max
@@ -533,15 +551,15 @@ LISP_MACRO_DEFUN (XIL, Lisp_Object, (EMACS_INT i), (i))
533 551
534/* In the size word of a vector, this bit means the vector has been marked. */ 552/* In the size word of a vector, this bit means the vector has been marked. */
535 553
536static ptrdiff_t const ARRAY_MARK_FLAG 554DEFINE_GDB_SYMBOL_BEGIN (ptrdiff_t, ARRAY_MARK_FLAG)
537#define ARRAY_MARK_FLAG PTRDIFF_MIN 555#define ARRAY_MARK_FLAG PTRDIFF_MIN
538 = ARRAY_MARK_FLAG; 556DEFINE_GDB_SYMBOL_END (ARRAY_MARK_FLAG)
539 557
540/* In the size word of a struct Lisp_Vector, this bit means it's really 558/* In the size word of a struct Lisp_Vector, this bit means it's really
541 some other vector-like object. */ 559 some other vector-like object. */
542static ptrdiff_t const PSEUDOVECTOR_FLAG 560DEFINE_GDB_SYMBOL_BEGIN (ptrdiff_t, PSEUDOVECTOR_FLAG)
543#define PSEUDOVECTOR_FLAG (PTRDIFF_MAX - PTRDIFF_MAX / 2) 561#define PSEUDOVECTOR_FLAG (PTRDIFF_MAX - PTRDIFF_MAX / 2)
544 = PSEUDOVECTOR_FLAG; 562DEFINE_GDB_SYMBOL_END (PSEUDOVECTOR_FLAG)
545 563
546/* In a pseudovector, the size field actually contains a word with one 564/* In a pseudovector, the size field actually contains a word with one
547 PSEUDOVECTOR_FLAG bit set, and one of the following values extracted 565 PSEUDOVECTOR_FLAG bit set, and one of the following values extracted
@@ -603,12 +621,13 @@ enum More_Lisp_Bits
603 }; 621 };
604 622
605/* These functions extract various sorts of values from a Lisp_Object. 623/* These functions extract various sorts of values from a Lisp_Object.
606 For example, if tem is a Lisp_Object whose type is Lisp_Cons, 624 For example, if tem is a Lisp_Object whose type is Lisp_Cons,
607 XCONS (tem) is the struct Lisp_Cons * pointing to the memory for that cons. */ 625 XCONS (tem) is the struct Lisp_Cons * pointing to the memory for
626 that cons. */
608 627
609static EMACS_INT const VALMASK 628DEFINE_GDB_SYMBOL_BEGIN (EMACS_INT, VALMASK)
610#define VALMASK (USE_LSB_TAG ? - (1 << GCTYPEBITS) : VAL_MAX) 629#define VALMASK (USE_LSB_TAG ? - (1 << GCTYPEBITS) : VAL_MAX)
611 = VALMASK; 630DEFINE_GDB_SYMBOL_END (VALMASK)
612 631
613/* Largest and smallest representable fixnum values. These are the C 632/* Largest and smallest representable fixnum values. These are the C
614 values. They are macros for use in static initializers. */ 633 values. They are macros for use in static initializers. */