aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Nicolaescu2010-11-23 10:47:23 -0800
committerDan Nicolaescu2010-11-23 10:47:23 -0800
commit42c8bc9b87388258d1de6a714b051330570f0ff4 (patch)
tree3da9eae14b91e4c2d469b1cfe122c607f4f78d65 /src
parent2e8a479790905675fea870ac73f1deebd6889eea (diff)
downloademacs-42c8bc9b87388258d1de6a714b051330570f0ff4.tar.gz
emacs-42c8bc9b87388258d1de6a714b051330570f0ff4.zip
Mark debugger related variables and functions as EXTERNALLY_VISIBLE
so that they do not get optimized away. * configure.in (EXTERNALLY_VISIBLE): New definition. * src/emacs.c (gdb_use_union, gdb_valbits,gdb_gctypebits) (gdb_data_seg_bits, gdb_array_mark_flag, PVEC_FLAG) (gdb_pvec_type): * src/print.c (print_output_debug_flag): * src/lisp.h (debug_print): Mark as EXTERNALLY_VISIBLE. (safe_debug_print): New declaration.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/config.in6
-rw-r--r--src/emacs.c22
-rw-r--r--src/lisp.h3
-rw-r--r--src/print.c2
5 files changed, 27 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 75a141dabc6..d8518e5cdda 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
12010-11-23 Dan Nicolaescu <dann@ics.uci.edu> 12010-11-23 Dan Nicolaescu <dann@ics.uci.edu>
2 2
3 * emacs.c (gdb_use_union, gdb_valbits,gdb_gctypebits)
4 (gdb_data_seg_bits, gdb_array_mark_flag, PVEC_FLAG)
5 (gdb_pvec_type):
6 * print.c (print_output_debug_flag):
7 * lisp.h (debug_print): Mark as EXTERNALLY_VISIBLE.
8 (safe_debug_print): New declaration.
9
3 * xterm.c: 10 * xterm.c:
4 * systty.h: 11 * systty.h:
5 * sound.c: Include <sys/ioctl.h> unconditionally. 12 * sound.c: Include <sys/ioctl.h> unconditionally.
diff --git a/src/config.in b/src/config.in
index b9e9d7c720d..487009b4511 100644
--- a/src/config.in
+++ b/src/config.in
@@ -1197,6 +1197,12 @@ typedef unsigned size_t;
1197#define NO_INLINE 1197#define NO_INLINE
1198#endif 1198#endif
1199 1199
1200#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
1201#define EXTERNALLY_VISIBLE __attribute__((externally_visible))
1202#else
1203#define EXTERNALLY_VISIBLE
1204#endif
1205
1200/* Some versions of GNU/Linux define noinline in their headers. */ 1206/* Some versions of GNU/Linux define noinline in their headers. */
1201#ifdef noinline 1207#ifdef noinline
1202#undef noinline 1208#undef noinline
diff --git a/src/emacs.c b/src/emacs.c
index 0d3b37ae27c..49716c7eb4a 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -100,27 +100,27 @@ static const char emacs_version[] = "24.0.50";
100/* Make these values available in GDB, which doesn't see macros. */ 100/* Make these values available in GDB, which doesn't see macros. */
101 101
102#ifdef USE_LSB_TAG 102#ifdef USE_LSB_TAG
103int gdb_use_lsb = 1; 103int gdb_use_lsb EXTERNALLY_VISIBLE = 1;
104#else 104#else
105int gdb_use_lsb = 0; 105int gdb_use_lsb EXTERNALLY_VISIBLE = 0;
106#endif 106#endif
107#ifndef USE_LISP_UNION_TYPE 107#ifndef USE_LISP_UNION_TYPE
108int gdb_use_union = 0; 108int gdb_use_union EXTERNALLY_VISIBLE = 0;
109#else 109#else
110int gdb_use_union = 1; 110int gdb_use_union EXTERNALLY_VISIBLE = 1;
111#endif 111#endif
112EMACS_INT gdb_valbits = VALBITS; 112EMACS_INT gdb_valbits EXTERNALLY_VISIBLE = VALBITS;
113EMACS_INT gdb_gctypebits = GCTYPEBITS; 113EMACS_INT gdb_gctypebits EXTERNALLY_VISIBLE = GCTYPEBITS;
114#if defined (DATA_SEG_BITS) && ! defined (USE_LSB_TAG) 114#if defined (DATA_SEG_BITS) && ! defined (USE_LSB_TAG)
115EMACS_INT gdb_data_seg_bits = DATA_SEG_BITS; 115EMACS_INT gdb_data_seg_bits EXTERNALLY_VISIBLE = DATA_SEG_BITS;
116#else 116#else
117EMACS_INT gdb_data_seg_bits = 0; 117EMACS_INT gdb_data_seg_bits EXTERNALLY_VISIBLE = 0;
118#endif 118#endif
119EMACS_INT PVEC_FLAG = PSEUDOVECTOR_FLAG; 119EMACS_INT PVEC_FLAG EXTERNALLY_VISIBLE = PSEUDOVECTOR_FLAG;
120EMACS_INT gdb_array_mark_flag = ARRAY_MARK_FLAG; 120EMACS_INT gdb_array_mark_flag EXTERNALLY_VISIBLE = ARRAY_MARK_FLAG;
121/* GDB might say "No enum type named pvec_type" if we don't have at 121/* GDB might say "No enum type named pvec_type" if we don't have at
122 least one symbol with that type, and then xbacktrace could fail. */ 122 least one symbol with that type, and then xbacktrace could fail. */
123enum pvec_type gdb_pvec_type = PVEC_TYPE_MASK; 123enum pvec_type gdb_pvec_type EXTERNALLY_VISIBLE = PVEC_TYPE_MASK;
124 124
125/* Command line args from shell, as list of strings. */ 125/* Command line args from shell, as list of strings. */
126Lisp_Object Vcommand_line_args; 126Lisp_Object Vcommand_line_args;
diff --git a/src/lisp.h b/src/lisp.h
index 117e810e565..623ba5382eb 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2832,7 +2832,8 @@ extern void syms_of_chartab (void);
2832/* Defined in print.c */ 2832/* Defined in print.c */
2833extern Lisp_Object Vprin1_to_string_buffer; 2833extern Lisp_Object Vprin1_to_string_buffer;
2834extern Lisp_Object Vprint_level, Vprint_length; 2834extern Lisp_Object Vprint_level, Vprint_length;
2835extern void debug_print (Lisp_Object); 2835extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
2836extern void safe_debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
2836EXFUN (Fprin1, 2); 2837EXFUN (Fprin1, 2);
2837EXFUN (Fprin1_to_string, 2); 2838EXFUN (Fprin1_to_string, 2);
2838EXFUN (Fprinc, 2); 2839EXFUN (Fprinc, 2);
diff --git a/src/print.c b/src/print.c
index ea88ba72f65..a95498ae668 100644
--- a/src/print.c
+++ b/src/print.c
@@ -163,7 +163,7 @@ Lisp_Object Vprint_number_table;
163void print_interval (INTERVAL interval, Lisp_Object printcharfun); 163void print_interval (INTERVAL interval, Lisp_Object printcharfun);
164 164
165/* GDB resets this to zero on W32 to disable OutputDebugString calls. */ 165/* GDB resets this to zero on W32 to disable OutputDebugString calls. */
166int print_output_debug_flag = 1; 166int print_output_debug_flag EXTERNALLY_VISIBLE = 1;
167 167
168 168
169/* Low level output routines for characters and strings */ 169/* Low level output routines for characters and strings */