emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114691: Make VALMASK visible to GDB even if clang i


From: Paul Eggert
Subject: [Emacs-diffs] trunk r114691: Make VALMASK visible to GDB even if clang is used.
Date: Thu, 17 Oct 2013 03:09:02 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114691
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15574
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Wed 2013-10-16 20:08:59 -0700
message:
  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.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/emacs.c                    emacs.c-20091113204419-o5vbwnq5f7feedwu-241
  src/lisp.h                     lisp.h-20091113204419-o5vbwnq5f7feedwu-253
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-10-17 01:02:32 +0000
+++ b/src/ChangeLog     2013-10-17 03:08:59 +0000
@@ -1,5 +1,10 @@
 2013-10-17  Paul Eggert  <address@hidden>
 
+       Make VALMASK visible to GDB even if clang is used (Bug#15574).
+       * 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.
+
        bool vector int width fixes
        * data.c (bool_vector_spare_mask, Fbool_vector_count_matches)
        (Fbool_vector_count_matches_at):

=== modified file 'src/emacs.c'
--- a/src/emacs.c       2013-09-20 15:34:36 +0000
+++ b/src/emacs.c       2013-10-17 03:08:59 +0000
@@ -30,6 +30,7 @@
 
 #include <close-stream.h>
 
+#define MAIN_PROGRAM
 #include "lisp.h"
 
 #ifdef WINDOWSNT

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2013-10-14 07:12:49 +0000
+++ b/src/lisp.h        2013-10-17 03:08:59 +0000
@@ -35,6 +35,24 @@
 
 INLINE_HEADER_BEGIN
 
+/* Define a TYPE constant ID as an externally visible name.  Use like this:
+
+      DEFINE_GDB_SYMBOL_BEGIN (TYPE, ID)
+      #define ID something
+      DEFINE_GDB_SYMBOL_END (ID)
+
+   This hack is for the benefit of compilers that do not make macro
+   definitions visible to the debugger.  It's used for symbols that
+   .gdbinit needs, symbols whose values may not fit in 'int' (where an
+   enum would suffice).  */
+#ifdef MAIN_PROGRAM
+# define DEFINE_GDB_SYMBOL_BEGIN(type, id) type const id EXTERNALLY_VISIBLE
+# define DEFINE_GDB_SYMBOL_END(id) = id;
+#else
+# define DEFINE_GDB_SYMBOL_BEGIN(type, id)
+# define DEFINE_GDB_SYMBOL_END(val)
+#endif
+
 /* The ubiquitous max and min macros.  */
 #undef min
 #undef max
@@ -533,15 +551,15 @@
 
 /* In the size word of a vector, this bit means the vector has been marked.  */
 
-static ptrdiff_t const ARRAY_MARK_FLAG
+DEFINE_GDB_SYMBOL_BEGIN (ptrdiff_t, ARRAY_MARK_FLAG)
 #define ARRAY_MARK_FLAG PTRDIFF_MIN
-      = ARRAY_MARK_FLAG;
+DEFINE_GDB_SYMBOL_END (ARRAY_MARK_FLAG)
 
 /* In the size word of a struct Lisp_Vector, this bit means it's really
    some other vector-like object.  */
-static ptrdiff_t const PSEUDOVECTOR_FLAG
+DEFINE_GDB_SYMBOL_BEGIN (ptrdiff_t, PSEUDOVECTOR_FLAG)
 #define PSEUDOVECTOR_FLAG (PTRDIFF_MAX - PTRDIFF_MAX / 2)
-      = PSEUDOVECTOR_FLAG;
+DEFINE_GDB_SYMBOL_END (PSEUDOVECTOR_FLAG)
 
 /* In a pseudovector, the size field actually contains a word with one
    PSEUDOVECTOR_FLAG bit set, and one of the following values extracted
@@ -603,12 +621,13 @@
   };
 
 /* These functions extract various sorts of values from a Lisp_Object.
- For example, if tem is a Lisp_Object whose type is Lisp_Cons,
- XCONS (tem) is the struct Lisp_Cons * pointing to the memory for that cons.  
*/
+   For example, if tem is a Lisp_Object whose type is Lisp_Cons,
+   XCONS (tem) is the struct Lisp_Cons * pointing to the memory for
+   that cons.  */
 
-static EMACS_INT const VALMASK
+DEFINE_GDB_SYMBOL_BEGIN (EMACS_INT, VALMASK)
 #define VALMASK (USE_LSB_TAG ? - (1 << GCTYPEBITS) : VAL_MAX)
-      = VALMASK;
+DEFINE_GDB_SYMBOL_END (VALMASK)
 
 /* Largest and smallest representable fixnum values.  These are the C
    values.  They are macros for use in static initializers.  */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]