aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2013-08-09 13:18:48 +0300
committerEli Zaretskii2013-08-09 13:18:48 +0300
commit55902276706ea2db832ad5748a18ab392a0873f1 (patch)
treee58949701e4875e2282826282248ad21a101b87f /src
parent6e164c210a090beeaaf8682343982740b65133f9 (diff)
downloademacs-55902276706ea2db832ad5748a18ab392a0873f1.tar.gz
emacs-55902276706ea2db832ad5748a18ab392a0873f1.zip
Define a few variables of obscure types to aid debugging exceptions on Windows.
src/w32.c (PEXCEPTION_POINTERS, PEXCEPTION_RECORD, PCONTEXT): Define variables of these types so that GDB would know about them, as aid for debugging fatal exceptions. (Bug#15024) See also http://sourceware.org/ml/gdb/2013-08/msg00010.html for related discussions.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/w32.c15
2 files changed, 23 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d57086f7141..aa424d2ec06 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12013-08-09 Eli Zaretskii <eliz@gnu.org>
2
3 * w32.c (PEXCEPTION_POINTERS, PEXCEPTION_RECORD, PCONTEXT): Define
4 variables of these types so that GDB would know about them, as aid
5 for debugging fatal exceptions. (Bug#15024) See also
6 http://sourceware.org/ml/gdb/2013-08/msg00010.html for related
7 discussions.
8
12013-08-08 Jan Djärv <jan.h.d@swipnet.se> 92013-08-08 Jan Djärv <jan.h.d@swipnet.se>
2 10
3 * nsterm.m (ns_update_begin): Don't change clip path if it would be 11 * nsterm.m (ns_update_begin): Don't change clip path if it would be
diff --git a/src/w32.c b/src/w32.c
index bb2f0acd99a..9b87cfc8faa 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -89,6 +89,21 @@ typedef struct _MEMORY_STATUS_EX {
89 DWORDLONG ullAvailExtendedVirtual; 89 DWORDLONG ullAvailExtendedVirtual;
90} MEMORY_STATUS_EX,*LPMEMORY_STATUS_EX; 90} MEMORY_STATUS_EX,*LPMEMORY_STATUS_EX;
91 91
92/* These are here so that GDB would know about these data types. This
93 allows to attach GDB to Emacs when a fatal exception is triggered
94 and Windows pops up the "application needs to be closed" dialog.
95 At that point, _gnu_exception_handler, the top-level exception
96 handler installed by the MinGW startup code, is somewhere on the
97 call-stack of the main thread, so going to that call frame and
98 looking at the argument to _gnu_exception_handler, which is a
99 PEXCEPTION_POINTERS pointer, can reveal the exception code
100 (excptr->ExceptionRecord->ExceptionCode) and the address where the
101 exception happened (excptr->ExceptionRecord->ExceptionAddress), as
102 well as some additional information specific to the exception. */
103PEXCEPTION_POINTERS excptr;
104PEXCEPTION_RECORD excprec;
105PCONTEXT ctxrec;
106
92#include <lmcons.h> 107#include <lmcons.h>
93#include <shlobj.h> 108#include <shlobj.h>
94 109