aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2005-01-14 22:59:36 +0000
committerAndrew Cagney <cagney@redhat.com>2005-01-14 22:59:36 +0000
commit9cbc821d4e761ccb7164c704f4299160e72b4d08 (patch)
tree0e5fafb2b596bfb20c0adf31b69f68af17cc9185 /gdb/breakpoint.c
parentdf227444e2db8b4acfe7cd64263580798bd9f4cc (diff)
downloadgdb-9cbc821d4e761ccb7164c704f4299160e72b4d08.zip
gdb-9cbc821d4e761ccb7164c704f4299160e72b4d08.tar.gz
gdb-9cbc821d4e761ccb7164c704f4299160e72b4d08.tar.bz2
2005-01-14 Andrew Cagney <cagney@gnu.org>
* exceptions.h (exception_fprintf): Declare. (exception_print): Drop pre_print parameter. * mi/mi-main.c (mi_execute_command): Update exception_print call. * cli/cli-interp.c (safe_execute_command): Update exception_print call. * remote.c (remote_open_1): Instead of passing an error prefix to catch_exceptions, use catch_exceptions and exception_fprintf. (remote_start_remote): Change return type to void. * breakpoint.c (insert_bp_location): Instead of passing an error prefix to catch_exceptions, use catch_exceptions and exception_fprintf. (insert_catchpoint): Change return type to void. (break_command_1): Update exception_print call. * exceptions.c (exception_fprintf): New function. (print_exception): New function. (exception_print): Use print_exception.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 75249f5..9b77543 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -709,7 +709,7 @@ deprecated_read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len)
/* A wrapper function for inserting catchpoints. */
-static int
+static void
insert_catchpoint (struct ui_out *uo, void *args)
{
struct breakpoint *b = (struct breakpoint *) args;
@@ -733,8 +733,6 @@ insert_catchpoint (struct ui_out *uo, void *args)
if (val < 0)
throw_reason (RETURN_ERROR);
-
- return 0;
}
/* Helper routine: free the value chain for a breakpoint (watchpoint). */
@@ -1073,13 +1071,11 @@ insert_bp_location (struct bp_location *bpt,
|| bpt->owner->type == bp_catch_vfork
|| bpt->owner->type == bp_catch_exec)
{
- char *prefix = xstrprintf ("warning: inserting catchpoint %d: ",
- bpt->owner->number);
- struct cleanup *cleanups = make_cleanup (xfree, prefix);
- val = catch_exceptions (uiout, insert_catchpoint, bpt->owner, prefix,
- RETURN_MASK_ERROR);
- do_cleanups (cleanups);
- if (val < 0)
+ struct exception e = catch_exception (uiout, insert_catchpoint,
+ bpt->owner, RETURN_MASK_ERROR);
+ exception_fprintf (gdb_stderr, e, "warning: inserting catchpoint %d: ",
+ bpt->owner->number);
+ if (e.reason < 0)
bpt->owner->enable_state = bp_disabled;
else
bpt->inserted = 1;
@@ -5134,7 +5130,7 @@ break_command_1 (char *arg, int flag, int from_tty, struct breakpoint *pending_b
switch (e.reason)
{
case RETURN_QUIT:
- exception_print (gdb_stderr, NULL, e);
+ exception_print (gdb_stderr, e);
return e.reason;
case RETURN_ERROR:
switch (e.error)
@@ -5145,7 +5141,7 @@ break_command_1 (char *arg, int flag, int from_tty, struct breakpoint *pending_b
if (pending_bp)
return e.reason;
- exception_print (gdb_stderr, NULL, e);
+ exception_print (gdb_stderr, e);
/* If pending breakpoint support is turned off, throw
error. */
@@ -5171,7 +5167,7 @@ break_command_1 (char *arg, int flag, int from_tty, struct breakpoint *pending_b
pending = 1;
break;
default:
- exception_print (gdb_stderr, NULL, e);
+ exception_print (gdb_stderr, e);
return e.reason;
}
default: