Make insert_breakpoints return void.
authorVladimir Prus <vladimir@codesourcery.com>
Fri, 30 Nov 2007 10:00:26 +0000 (10:00 +0000)
committerVladimir Prus <vladimir@codesourcery.com>
Fri, 30 Nov 2007 10:00:26 +0000 (10:00 +0000)
* breakpoint.h (insert_breakpoints): Change
return type to void.
* breakpoint.c (insert_breakpoints): Change
return type to void.  Rename local return_val
variable to error.
* infrun.c (keep_going): Instead of checking
return value from insert_breakpoints, catch exception.

gdb/ChangeLog
gdb/breakpoint.c
gdb/breakpoint.h
gdb/infrun.c

index bc33f1ed853c53c67fccfb6d9a98c2b49346d841..6e257fe97b40186035a6aa0abe67d5202ff91d8f 100644 (file)
@@ -1,3 +1,14 @@
+2007-11-30  Vladimir Prus  <vladimir@codesourcery.com>
+
+       Make insert_breakpoints return void.    
+       * breakpoint.h (insert_breakpoints): Change
+       return type to void.
+       * breakpoint.c (insert_breakpoints): Change
+       return type to void.  Rename local return_val
+       variable to error.
+       * infrun.c (keep_going): Instead of checking
+       return value from insert_breakpoints, catch exception.
+
 2007-11-29  Vladimir Prus  <vladimir@codesourcery.com>
 
        Stop infrun from tracking breakpoint insertion status.
index 49958e699d4152ffa38c9fd9a94060c2e1a5ca69..0f96997ec184bc42ea3624e52d79c6e5f0e8a2f9 100644 (file)
@@ -1220,11 +1220,11 @@ in which its expression is valid.\n"),
    Both return zero if successful,
    or an `errno' value if could not write the inferior.  */
 
-int
+void
 insert_breakpoints (void)
 {
   struct bp_location *b, *temp;
-  int return_val = 0;  /* return success code. */
+  int error = 0;
   int val = 0;
   int disabled_breaks = 0;
   int hw_breakpoint_error = 0;
@@ -1265,10 +1265,10 @@ insert_breakpoints (void)
                                    &disabled_breaks, &process_warning,
                                    &hw_breakpoint_error);
       if (val)
-       return_val = val;
+       error = val;
     }
 
-  if (return_val)
+  if (error)
     {
       /* If a hardware breakpoint or watchpoint was inserted, add a
          message about possibly exhausted resources.  */
@@ -1286,7 +1286,6 @@ You may have requested too many hardware breakpoints/watchpoints.\n");
       target_terminal_ours_for_output ();
       error_stream (tmp_error_stream);
     }
-  return return_val;
 }
 
 int
index 4b8450255ba14709e0b3a405e7be5fc212f91504..56b9a6ee46fc521cb268e79fbe347758903ce52e 100644 (file)
@@ -717,7 +717,7 @@ extern void awatch_command_wrapper (char *, int);
 extern void rwatch_command_wrapper (char *, int);
 extern void tbreak_command (char *, int);
 
-extern int insert_breakpoints (void);
+extern void insert_breakpoints (void);
 
 extern int remove_breakpoints (void);
 
index ad1de6b35d91c1006790ea6e203754c16929cb98..62d6d1e3a4bb200d04977b0e0598d61a7b606c4a 100644 (file)
@@ -2948,9 +2948,14 @@ keep_going (struct execution_control_state *ecs)
       
       if (!ecs->another_trap)
        {
+         struct gdb_exception e;
          /* Stop stepping when inserting breakpoints
             has failed.  */
-         if (insert_breakpoints () != 0)
+         TRY_CATCH (e, RETURN_MASK_ERROR)
+           {
+             insert_breakpoints ();
+           }
+         if (e.reason < 0)
            {
              stop_stepping (ecs);
              return;