aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-02-01 16:24:47 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-02-01 16:24:47 +0000
commit98deb0daaefbe4fd9a2664a636aa71fb8aa678dd (patch)
tree048aa91c316f6f45b4eca253e52556f82ba36646 /gdb/mi
parentce0451adace70feabf93904e7a574fea21154073 (diff)
downloadgdb-98deb0daaefbe4fd9a2664a636aa71fb8aa678dd.zip
gdb-98deb0daaefbe4fd9a2664a636aa71fb8aa678dd.tar.gz
gdb-98deb0daaefbe4fd9a2664a636aa71fb8aa678dd.tar.bz2
* breakpoint.c (break_command_1): Return void.
(break_command_really): Return void. Rethrow exceptions instead of returning. (gdb_breakpoint): Remove the error_message parameter. Return void. Rename to set_breakpoint. * gdb.h (gdb_breakpoint): Rename and move to... * breakpoint.h (set_breakpoint): ...here. * mi/mi-cmb-break.c (mi_cmd_break_insert): Restore event hooks even if exception is thrown. Adjust to gdb_breakpoint interface changes.
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-cmd-break.c62
1 files changed, 32 insertions, 30 deletions
diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c
index c77b0dc..3a5faf3 100644
--- a/gdb/mi/mi-cmd-break.c
+++ b/gdb/mi/mi-cmd-break.c
@@ -26,6 +26,7 @@
#include "mi-getopt.h"
#include "gdb-events.h"
#include "gdb.h"
+#include "exceptions.h"
enum
{
@@ -69,7 +70,7 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
int ignore_count = 0;
char *condition = NULL;
int pending = 0;
- enum gdb_rc rc;
+ struct gdb_exception e;
struct gdb_events *old_hooks;
enum opt
{
@@ -132,41 +133,42 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
/* Now we have what we need, let's insert the breakpoint! */
old_hooks = deprecated_set_gdb_event_hooks (&breakpoint_hooks);
- switch (type)
+ /* Make sure we restore hooks even if exception is thrown. */
+ TRY_CATCH (e, RETURN_MASK_ALL)
{
- case REG_BP:
- rc = gdb_breakpoint (address, condition,
- 0 /*hardwareflag */ , temp_p,
- thread, ignore_count,
- pending,
- &mi_error_message);
- break;
- case HW_BP:
- rc = gdb_breakpoint (address, condition,
- 1 /*hardwareflag */ , temp_p,
- thread, ignore_count,
- pending,
- &mi_error_message);
- break;
+ switch (type)
+ {
+ case REG_BP:
+ set_breakpoint (address, condition,
+ 0 /*hardwareflag */ , temp_p,
+ thread, ignore_count,
+ pending);
+ break;
+ case HW_BP:
+ set_breakpoint (address, condition,
+ 1 /*hardwareflag */ , temp_p,
+ thread, ignore_count,
+ pending);
+ break;
#if 0
- case REGEXP_BP:
- if (temp_p)
- error (_("mi_cmd_break_insert: Unsupported tempoary regexp breakpoint"));
- else
- rbreak_command_wrapper (address, FROM_TTY);
- return MI_CMD_DONE;
- break;
+ case REGEXP_BP:
+ if (temp_p)
+ error (_("mi_cmd_break_insert: Unsupported tempoary regexp breakpoint"));
+ else
+ rbreak_command_wrapper (address, FROM_TTY);
+ return MI_CMD_DONE;
+ break;
#endif
- default:
- internal_error (__FILE__, __LINE__,
- _("mi_cmd_break_insert: Bad switch."));
+ default:
+ internal_error (__FILE__, __LINE__,
+ _("mi_cmd_break_insert: Bad switch."));
+ }
}
deprecated_set_gdb_event_hooks (old_hooks);
+ if (e.reason < 0)
+ throw_exception (e);
- if (rc == GDB_RC_FAIL)
- return MI_CMD_ERROR;
- else
- return MI_CMD_DONE;
+ return MI_CMD_DONE;
}
enum wp_type