aboutsummaryrefslogtreecommitdiff
path: root/gdb/exceptions.h
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2014-08-07 15:53:21 +0100
committerGary Benson <gbenson@redhat.com>2014-08-29 10:53:36 +0100
commite9bcb6585201ab674d90d714295f63b40da41f16 (patch)
tree0f9c692937bd00e832170a137fed9eb17c4e188d /gdb/exceptions.h
parente31806255fe0cf49a1eeb14a51788473eaaa6310 (diff)
downloadgdb-e9bcb6585201ab674d90d714295f63b40da41f16.zip
gdb-e9bcb6585201ab674d90d714295f63b40da41f16.tar.gz
gdb-e9bcb6585201ab674d90d714295f63b40da41f16.tar.bz2
Introduce common/gdb_setjmp.h
This commit creates a new file, common/gdb_setjmp.h, to hold some portability macros for setjmp/longjmp et al. that are used by the exceptions subsystem and by the demangler crash catcher. gdb/ChangeLog: * common/gdb_setjmp.h: New file. * Makefile.in (HFILES_NO_SRCDIR): Add common/gdb_setjmp.h. * configure.ac: Move sigsetjmp check... * common/common.m4: ...here. * configure: Regenerate. * cp-support.c (SIGJMP_BUF): Delete. (SIGSETJMP): Likewise. (SIGLONGJMP): Likewise. * exceptions.h (gdb_setjmp.h): Include. (setjmp.h): Do not include. (EXCEPTIONS_SIGJMP_BUF): Delete. (EXCEPTIONS_SIGSETJMP): Likewise. (EXCEPTIONS_SIGLONGJMP): Likewise. Replace all uses of EXCEPTIONS_SIG* macros with SIG* macros from gdb_setjmp.h. * exceptions.c: Likewise. gdb/gdbserver/ChangeLog: * config.in: Regenerate. * configure: Likewise.
Diffstat (limited to 'gdb/exceptions.h')
-rw-r--r--gdb/exceptions.h25
1 files changed, 6 insertions, 19 deletions
diff --git a/gdb/exceptions.h b/gdb/exceptions.h
index be74ad5..e3ff672 100644
--- a/gdb/exceptions.h
+++ b/gdb/exceptions.h
@@ -21,7 +21,7 @@
#define EXCEPTIONS_H
#include "ui-out.h"
-#include <setjmp.h>
+#include "gdb_setjmp.h"
/* Reasons for calling throw_exceptions(). NOTE: all reason values
must be less than zero. enum value 0 is reserved for internal use
@@ -114,24 +114,11 @@ struct gdb_exception
/* A pre-defined non-exception. */
extern const struct gdb_exception exception_none;
-/* Wrap set/long jmp so that it's more portable (internal to
- exceptions). */
-
-#if defined(HAVE_SIGSETJMP)
-#define EXCEPTIONS_SIGJMP_BUF sigjmp_buf
-#define EXCEPTIONS_SIGSETJMP(buf) sigsetjmp((buf), 1)
-#define EXCEPTIONS_SIGLONGJMP(buf,val) siglongjmp((buf), (val))
-#else
-#define EXCEPTIONS_SIGJMP_BUF jmp_buf
-#define EXCEPTIONS_SIGSETJMP(buf) setjmp(buf)
-#define EXCEPTIONS_SIGLONGJMP(buf,val) longjmp((buf), (val))
-#endif
-
/* Functions to drive the exceptions state m/c (internal to
exceptions). */
-EXCEPTIONS_SIGJMP_BUF *exceptions_state_mc_init (volatile struct
- gdb_exception *exception,
- return_mask mask);
+SIGJMP_BUF *exceptions_state_mc_init (volatile struct
+ gdb_exception *exception,
+ return_mask mask);
int exceptions_state_mc_action_iter (void);
int exceptions_state_mc_action_iter_1 (void);
@@ -159,9 +146,9 @@ int exceptions_state_mc_action_iter_1 (void);
#define TRY_CATCH(EXCEPTION,MASK) \
{ \
- EXCEPTIONS_SIGJMP_BUF *buf = \
+ SIGJMP_BUF *buf = \
exceptions_state_mc_init (&(EXCEPTION), (MASK)); \
- EXCEPTIONS_SIGSETJMP (*buf); \
+ SIGSETJMP (*buf); \
} \
while (exceptions_state_mc_action_iter ()) \
while (exceptions_state_mc_action_iter_1 ())