* infcmd.c (finish_command_continuation): Wrap print_return_value
authorTom Tromey <tromey@redhat.com>
Thu, 18 Mar 2010 18:02:00 +0000 (18:02 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 18 Mar 2010 18:02:00 +0000 (18:02 +0000)
in TRY_CATCH.

gdb/ChangeLog
gdb/infcmd.c

index 576eb185a74105dc1d7f8628599423afca483413..746af2914c6ceb83b674e57d92a164dba11321e3 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-18  Tom Tromey  <tromey@redhat.com>
+
+       * infcmd.c (finish_command_continuation): Wrap print_return_value
+       in TRY_CATCH.
+
 2010-03-18  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * mi/mi-main.c (mi_cmd_list_thread_groups): Use get_current_arch
index e2235db2de0ff7babf170e35b2eee61f6444fb3c..174acde8da7e70833a54a0b5b259104abdbfcbeb 100644 (file)
@@ -1439,7 +1439,19 @@ finish_command_continuation (void *arg)
                        _("finish_command: function has no target type"));
 
       if (TYPE_CODE (value_type) != TYPE_CODE_VOID)
-       print_return_value (SYMBOL_TYPE (a->function), value_type);
+       {
+         volatile struct gdb_exception ex;
+
+         TRY_CATCH (ex, RETURN_MASK_ALL)
+           {
+             /* print_return_value can throw an exception in some
+                circumstances.  We need to catch this so that we still
+                delete the breakpoint.  */
+             print_return_value (SYMBOL_TYPE (a->function), value_type);
+           }
+         if (ex.reason < 0)
+           exception_print (gdb_stdout, ex);
+       }
     }
 
   /* We suppress normal call of normal_stop observer and do it here so