diff options
| author | Paul Eggert | 2019-03-27 21:51:39 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-03-27 21:51:57 -0700 |
| commit | 7f129f2ecfbdded5c31e9d9fc8bf11ce0e017000 (patch) | |
| tree | e9631b8b6bebb4b1315c7fbacd5b81d1264ca8fb | |
| parent | 81795bb71394aac6d7f6f7fd2656b2eb79a39a4d (diff) | |
| download | emacs-7f129f2ecfbdded5c31e9d9fc8bf11ce0e017000.tar.gz emacs-7f129f2ecfbdded5c31e9d9fc8bf11ce0e017000.zip | |
Simpler way to export HAVE_X_WINDOWS to GDB
* src/.gdbinit: Simplify by removing dependency on globals
implementation. This is useful for a future performance
improvement that I have in mind.
* src/alloc.c (enum defined_HAVE_X_WINDOWS, defined_HAVE_X_WINDOWS):
New enum and constant.
(gdb_make_enums_visible) [__GNUC__]: Use it, to make
defined_HAVE_X_WINDOWS visible to GDB.
| -rw-r--r-- | src/.gdbinit | 24 | ||||
| -rw-r--r-- | src/alloc.c | 7 |
2 files changed, 13 insertions, 18 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 7553f07845c..b8b303104f5 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -1219,24 +1219,12 @@ show environment TERM | |||
| 1219 | # terminate_due_to_signal when an assertion failure is non-fatal. | 1219 | # terminate_due_to_signal when an assertion failure is non-fatal. |
| 1220 | break terminate_due_to_signal | 1220 | break terminate_due_to_signal |
| 1221 | 1221 | ||
| 1222 | # x_error_quitter is defined only on X. But window-system is set up | 1222 | # x_error_quitter is defined only if defined_HAVE_X_WINDOWS. |
| 1223 | # only at run time, during Emacs startup, so we need to defer setting | 1223 | # If we are running in synchronous mode, we want a chance to look |
| 1224 | # the breakpoint. init_sys_modes is the first function called on | 1224 | # around before Emacs exits. Perhaps we should put the break |
| 1225 | # every platform after init_display, where window-system is set. | 1225 | # somewhere else instead... |
| 1226 | tbreak init_sys_modes | 1226 | if defined_HAVE_X_WINDOWS |
| 1227 | commands | 1227 | break x_error_quitter |
| 1228 | silent | ||
| 1229 | xsymname globals.f_Vinitial_window_system | ||
| 1230 | xgetptr $symname | ||
| 1231 | set $tem = (struct Lisp_String *) $ptr | ||
| 1232 | set $tem = (char *) $tem->u.s.data | ||
| 1233 | # If we are running in synchronous mode, we want a chance to look | ||
| 1234 | # around before Emacs exits. Perhaps we should put the break | ||
| 1235 | # somewhere else instead... | ||
| 1236 | if $tem[0] == 'x' && $tem[1] == '\0' | ||
| 1237 | break x_error_quitter | ||
| 1238 | end | ||
| 1239 | continue | ||
| 1240 | end | 1228 | end |
| 1241 | 1229 | ||
| 1242 | 1230 | ||
diff --git a/src/alloc.c b/src/alloc.c index 3a8bd30c34b..e48807c49ad 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -7649,6 +7649,12 @@ than 2**N, where N is this variable's value. N should be nonnegative. */); | |||
| 7649 | defsubr (&Ssuspicious_object); | 7649 | defsubr (&Ssuspicious_object); |
| 7650 | } | 7650 | } |
| 7651 | 7651 | ||
| 7652 | #ifdef HAVE_X_WINDOWS | ||
| 7653 | enum defined_HAVE_X_WINDOWS { defined_HAVE_X_WINDOWS = true }; | ||
| 7654 | #else | ||
| 7655 | enum defined_HAVE_X_WINDOWS { defined_HAVE_X_WINDOWS = false }; | ||
| 7656 | #endif | ||
| 7657 | |||
| 7652 | /* When compiled with GCC, GDB might say "No enum type named | 7658 | /* When compiled with GCC, GDB might say "No enum type named |
| 7653 | pvec_type" if we don't have at least one symbol with that type, and | 7659 | pvec_type" if we don't have at least one symbol with that type, and |
| 7654 | then xbacktrace could fail. Similarly for the other enums and | 7660 | then xbacktrace could fail. Similarly for the other enums and |
| @@ -7667,5 +7673,6 @@ union | |||
| 7667 | enum MAX_ALLOCA MAX_ALLOCA; | 7673 | enum MAX_ALLOCA MAX_ALLOCA; |
| 7668 | enum More_Lisp_Bits More_Lisp_Bits; | 7674 | enum More_Lisp_Bits More_Lisp_Bits; |
| 7669 | enum pvec_type pvec_type; | 7675 | enum pvec_type pvec_type; |
| 7676 | enum defined_HAVE_X_WINDOWS defined_HAVE_X_WINDOWS; | ||
| 7670 | } const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0}; | 7677 | } const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0}; |
| 7671 | #endif /* __GNUC__ */ | 7678 | #endif /* __GNUC__ */ |