]> git.eshelyaron.com Git - emacs.git/commitdiff
Simpler way to export HAVE_X_WINDOWS to GDB
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 28 Mar 2019 04:51:39 +0000 (21:51 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 28 Mar 2019 04:51:57 +0000 (21:51 -0700)
* 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.

src/.gdbinit
src/alloc.c

index 7553f07845ceac71f2bf9de933ac063e6704bdec..b8b303104f5507866c9a865ccdc8c7763b391ee2 100644 (file)
@@ -1219,24 +1219,12 @@ show environment TERM
 # terminate_due_to_signal when an assertion failure is non-fatal.
 break terminate_due_to_signal
 
-# x_error_quitter is defined only on X.  But window-system is set up
-# only at run time, during Emacs startup, so we need to defer setting
-# the breakpoint.  init_sys_modes is the first function called on
-# every platform after init_display, where window-system is set.
-tbreak init_sys_modes
-commands
-  silent
-  xsymname globals.f_Vinitial_window_system
-  xgetptr $symname
-  set $tem = (struct Lisp_String *) $ptr
-  set $tem = (char *) $tem->u.s.data
-  # If we are running in synchronous mode, we want a chance to look
-  # around before Emacs exits.  Perhaps we should put the break
-  # somewhere else instead...
-  if $tem[0] == 'x' && $tem[1] == '\0'
-    break x_error_quitter
-  end
-  continue
+# x_error_quitter is defined only if defined_HAVE_X_WINDOWS.
+# If we are running in synchronous mode, we want a chance to look
+# around before Emacs exits.  Perhaps we should put the break
+# somewhere else instead...
+if defined_HAVE_X_WINDOWS
+  break x_error_quitter
 end
 
 
index 3a8bd30c34b08e44a0c57f2c41c2d791567c0f47..e48807c49ad0022ef021e4ada9451b476f39cfcc 100644 (file)
@@ -7649,6 +7649,12 @@ than 2**N, where N is this variable's value.  N should be nonnegative.  */);
   defsubr (&Ssuspicious_object);
 }
 
+#ifdef HAVE_X_WINDOWS
+enum defined_HAVE_X_WINDOWS { defined_HAVE_X_WINDOWS = true };
+#else
+enum defined_HAVE_X_WINDOWS { defined_HAVE_X_WINDOWS = false };
+#endif
+
 /* When compiled with GCC, GDB might say "No enum type named
    pvec_type" if we don't have at least one symbol with that type, and
    then xbacktrace could fail.  Similarly for the other enums and
@@ -7667,5 +7673,6 @@ union
   enum MAX_ALLOCA MAX_ALLOCA;
   enum More_Lisp_Bits More_Lisp_Bits;
   enum pvec_type pvec_type;
+  enum defined_HAVE_X_WINDOWS defined_HAVE_X_WINDOWS;
 } const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0};
 #endif /* __GNUC__ */