Move code out of 'between TRY and CATCH'
authorPedro Alves <palves@redhat.com>
Wed, 4 Oct 2017 10:07:28 +0000 (11:07 +0100)
committerPedro Alves <palves@redhat.com>
Wed, 4 Oct 2017 12:01:20 +0000 (13:01 +0100)
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
gdb/guile/scm-breakpoint.c

index bc58f51bcdeb020332725cdf2b93b160e20bc0a6..87f84ca31200a4d7abdddb3d0002183020fc16de 100644 (file)
@@ -1,3 +1,8 @@
+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.
index b6b68109f3059b42af3597986623a7bda58bb53b..ec75be589f0e004876b83aed7b4fedf57fd6fd30 100644 (file)
@@ -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;