aboutsummaryrefslogtreecommitdiff
path: root/gdb/defs.h
diff options
context:
space:
mode:
authorNicholas Duffek <nsd@redhat.com>2000-02-24 00:04:03 +0000
committerNicholas Duffek <nsd@redhat.com>2000-02-24 00:04:03 +0000
commit99eeeb0ff7898f8987188e510b2612de1fcfa454 (patch)
treec6dfb641a5501748c99f36b6448c00a5e372398a /gdb/defs.h
parenteaba1dd3fb01d2964da9695f159e82a3c4596e63 (diff)
downloadgdb-99eeeb0ff7898f8987188e510b2612de1fcfa454.zip
gdb-99eeeb0ff7898f8987188e510b2612de1fcfa454.tar.gz
gdb-99eeeb0ff7898f8987188e510b2612de1fcfa454.tar.bz2
* top.c (SIGJMP_BUF, SIGSETJMP, SIGLONGJMP): Update comments.
(error_return, quit_return): Merge into catch_return pointer. (return_to_top_level): Update comment. Longjmp to *catch_errors, and communicate reason to catch_errors via setjmp return value. (catch_errors): Always catch both quit and error, and if a catch wasn't requested by caller, throw it to the next catch_error. Replace dual longjmp buffer memcpy with single pointer change. Add FIXME for possibly adding new interface to tell caller what event was caught. Add extensive comments. * defs.h (enum return_reason): Reserve 0 for use as initial setjmp() return value. (RETURN_MASK): New public macro to generate RETURN_MASK_* from enum return_reason. (RETURN_MASK_QUIT, RETURN_MASK_ERROR): Define using RETURN_MASK.
Diffstat (limited to 'gdb/defs.h')
-rw-r--r--gdb/defs.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/defs.h b/gdb/defs.h
index fa9f540..c4756f1 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -801,21 +801,24 @@ extern NORETURN void internal_error (char *, ...) ATTR_NORETURN;
extern NORETURN void nomem (long) ATTR_NORETURN;
-/* Reasons for calling return_to_top_level. */
+/* Reasons for calling return_to_top_level. Note: enum value 0 is
+ reserved for internal use as the return value from an initial
+ setjmp(). */
enum return_reason
{
/* User interrupt. */
- RETURN_QUIT,
+ RETURN_QUIT = 1,
/* Any other error. */
RETURN_ERROR
};
#define ALL_CLEANUPS ((struct cleanup *)0)
-#define RETURN_MASK_QUIT (1 << (int)RETURN_QUIT)
-#define RETURN_MASK_ERROR (1 << (int)RETURN_ERROR)
-#define RETURN_MASK_ALL (RETURN_MASK_QUIT | RETURN_MASK_ERROR)
+#define RETURN_MASK(reason) (1 << (int)(reason))
+#define RETURN_MASK_QUIT RETURN_MASK (RETURN_QUIT)
+#define RETURN_MASK_ERROR RETURN_MASK (RETURN_ERROR)
+#define RETURN_MASK_ALL (RETURN_MASK_QUIT | RETURN_MASK_ERROR)
typedef int return_mask;
extern NORETURN void return_to_top_level (enum return_reason) ATTR_NORETURN;