aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-04-22 16:18:33 +0100
committerPedro Alves <palves@redhat.com>2016-04-22 16:20:49 +0100
commit6290672f89d5638a9da5ce10b2f4ba793dcc6396 (patch)
treeab4650df1085115ea5ee7987511303968871128e
parent89525768cd086a0798a504c81fdf7ebcd4c904e1 (diff)
downloadgdb-6290672f89d5638a9da5ce10b2f4ba793dcc6396.zip
gdb-6290672f89d5638a9da5ce10b2f4ba793dcc6396.tar.gz
gdb-6290672f89d5638a9da5ce10b2f4ba793dcc6396.tar.bz2
Switch gdb's TRY/CATCH to C++ try/catch
The exceptions-across-readline issue was fixed by the previous commit. Let's try this again. gdb/ChangeLog: 2016-04-22 Pedro Alves <palves@redhat.com> * common/common-exceptions.h (GDB_XCPT_TRY): Remove mention of the foreign frames issue. [__cplusplus] (GDB_XCPT): Define as GDB_XCPT_TRY.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/common/common-exceptions.h11
2 files changed, 12 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 408a179..828d390 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2016-04-22 Pedro Alves <palves@redhat.com>
+ * common/common-exceptions.h (GDB_XCPT_TRY): Remove mention of
+ the foreign frames issue.
+ [__cplusplus] (GDB_XCPT): Define as GDB_XCPT_TRY.
+
+2016-04-22 Pedro Alves <palves@redhat.com>
+
* common/common-exceptions.c (enum catcher_state, struct catcher)
(current_catcher): Define in C++ mode too.
(exceptions_state_mc_catch): Call throw_exception_sjlj instead of
diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h
index 84abcae..c494de2 100644
--- a/gdb/common/common-exceptions.h
+++ b/gdb/common/common-exceptions.h
@@ -122,9 +122,7 @@ struct gdb_exception
the only mode supported when GDB is built as a C program. */
#define GDB_XCPT_SJMP 1
-/* Make GDB exceptions use try/catch behind the scenes. Can't be made
- the default until we handle exceptions crossing foreign frames
- (gdb -> readline callback -> gdb -> error). */
+/* Make GDB exceptions use try/catch behind the scenes. */
#define GDB_XCPT_TRY 2
/* Specify this mode to build with TRY/CATCH mapped directly to raw
@@ -133,8 +131,11 @@ struct gdb_exception
spurious code between the TRY and the CATCH block. */
#define GDB_XCPT_RAW_TRY 3
-/* Always use setjmp/longmp, even in C++ mode. */
-#define GDB_XCPT GDB_XCPT_SJMP
+#ifdef __cplusplus
+# define GDB_XCPT GDB_XCPT_TRY
+#else
+# define GDB_XCPT GDB_XCPT_SJMP
+#endif
/* Functions to drive the sjlj-based exceptions state machine. Though
declared here by necessity, these functions should be considered