aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorEli Zaretskii2024-09-07 11:15:43 +0300
committerEli Zaretskii2024-09-07 11:15:43 +0300
commit358208dfaa374cc71c4a1c081c2d5bff9127c55a (patch)
treecb5ab9295656f1bf7a643fde8534aef890522a60 /src/alloc.c
parente2154c63761add6063a719ba6253c8e6e8133814 (diff)
downloademacs-358208dfaa374cc71c4a1c081c2d5bff9127c55a.tar.gz
emacs-358208dfaa374cc71c4a1c081c2d5bff9127c55a.zip
Remove low-level keyboard hook when attaching GDB to Emacs on Windows
This fixes the problem whereby attaching GDB to a running Emacs on MS-Windows would slow down keyboard input, because the low-level keyboard hook installed by Emacs at startup was still installed, but with Emacs stopped, the hook code couldn't run, and therefore the OS would time-out waiting for the hook to return. Now when GDB is attached to Emacs, it will remove the hook right away. * src/.gdbinit: Call 'remove_w32_kbdhook' if the keyboard hook is already installed. * src/alloc.c (defined_WINDOWSNT): New enum. (gdb_make_enums_visible): Add 'defined_WINDOWSNT'.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c
index c22a5a787e4..066ec9fefe5 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -8297,6 +8297,9 @@ N should be nonnegative. */);
8297 DEFSYM (QCemergency, ":emergency"); 8297 DEFSYM (QCemergency, ":emergency");
8298} 8298}
8299 8299
8300/* The below is for being able to do platform-specific stuff in .gdbinit
8301 without risking error messages from GDB about missing types and
8302 variables on other platforms. */
8300#ifdef HAVE_X_WINDOWS 8303#ifdef HAVE_X_WINDOWS
8301enum defined_HAVE_X_WINDOWS { defined_HAVE_X_WINDOWS = true }; 8304enum defined_HAVE_X_WINDOWS { defined_HAVE_X_WINDOWS = true };
8302#else 8305#else
@@ -8309,6 +8312,12 @@ enum defined_HAVE_PGTK { defined_HAVE_PGTK = true };
8309enum defined_HAVE_PGTK { defined_HAVE_PGTK = false }; 8312enum defined_HAVE_PGTK { defined_HAVE_PGTK = false };
8310#endif 8313#endif
8311 8314
8315#ifdef WINDOWSNT
8316enum defined_WINDOWSNT { defined_WINDOWSNT = true };
8317#else
8318enum defined_WINDOWSNT { defined_WINDOWSNT = false };
8319#endif
8320
8312/* When compiled with GCC, GDB might say "No enum type named 8321/* When compiled with GCC, GDB might say "No enum type named
8313 pvec_type" if we don't have at least one symbol with that type, and 8322 pvec_type" if we don't have at least one symbol with that type, and
8314 then xbacktrace could fail. Similarly for the other enums and 8323 then xbacktrace could fail. Similarly for the other enums and
@@ -8329,6 +8338,7 @@ extern union enums_for_gdb
8329 enum pvec_type pvec_type; 8338 enum pvec_type pvec_type;
8330 enum defined_HAVE_X_WINDOWS defined_HAVE_X_WINDOWS; 8339 enum defined_HAVE_X_WINDOWS defined_HAVE_X_WINDOWS;
8331 enum defined_HAVE_PGTK defined_HAVE_PGTK; 8340 enum defined_HAVE_PGTK defined_HAVE_PGTK;
8341 enum defined_WINDOWSNT defined_WINDOWSNT;
8332} const gdb_make_enums_visible; 8342} const gdb_make_enums_visible;
8333union enums_for_gdb const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0}; 8343union enums_for_gdb const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0};
8334#endif /* __GNUC__ */ 8344#endif /* __GNUC__ */