This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[pushed] Move code out of 'between TRY and CATCH'


I tried building GDB with TRY/CATCH mapped to raw C++ try/catch (by
defining GDB_XCPT to GDB_XCPT_RAW_TRY in
gdb/common/common-exceptions.h), and that caught a case of code
written between try and catch.  This commit fixes it.

gdb/ChangeLog:
2017-10-04  Pedro Alves  <palves@redhat.com>

	* guile/scm-breakpoint.c (gdbscm_breakpoint_commands): Move code
	out of 'between TRY and CATCH'.
---
 gdb/ChangeLog              | 5 +++++
 gdb/guile/scm-breakpoint.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index bc58f51..87f84ca 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2017-10-04  Pedro Alves  <palves@redhat.com>
 
+	* guile/scm-breakpoint.c (gdbscm_breakpoint_commands): Move code
+	out of 'between TRY and CATCH'.
+
+2017-10-04  Pedro Alves  <palves@redhat.com>
+
 	* cli/cli-cmds.c (complete_command): Add missing END_CATCH.
 	* common/common-exceptions.h (TRY): Open an outermost scope.
 	Expand intro comment.
diff --git a/gdb/guile/scm-breakpoint.c b/gdb/guile/scm-breakpoint.c
index b6b6810..ec75be5 100644
--- a/gdb/guile/scm-breakpoint.c
+++ b/gdb/guile/scm-breakpoint.c
@@ -988,13 +988,14 @@ gdbscm_breakpoint_commands (SCM self)
     {
       print_command_lines (current_uiout, breakpoint_commands (bp), 0);
     }
-  current_uiout->redirect (NULL);
   CATCH (except, RETURN_MASK_ALL)
     {
+      current_uiout->redirect (NULL);
       gdbscm_throw_gdb_exception (except);
     }
   END_CATCH
 
+  current_uiout->redirect (NULL);
   result = gdbscm_scm_from_c_string (buf.c_str ());
 
   return result;
-- 
2.5.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]