aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-04-04 18:13:05 +0000
committerTom Tromey <tromey@redhat.com>2011-04-04 18:13:05 +0000
commit04bd08de86a7768754137e2c03fa92c3af0140b0 (patch)
treed275abdef7ef5a3c1f37ec246201f12e417d6f16 /gdb/cli
parent58438ac18761353e6d8461c914992071d4fcb1d3 (diff)
downloadgdb-04bd08de86a7768754137e2c03fa92c3af0140b0.zip
gdb-04bd08de86a7768754137e2c03fa92c3af0140b0.tar.gz
gdb-04bd08de86a7768754137e2c03fa92c3af0140b0.tar.bz2
* cli/cli-interp.c (struct captured_execute_command_args):
Remove. (do_captured_execute_command): Remove. (safe_execute_command): Use TRY_CATCH. * cli/cli-script.c (struct wrapped_read_command_file_args): Remove. (wrapped_read_command_file): Remove. (script_from_file): Use TRY_CATCH. * exceptions.c (catch_exception): Remove. * exceptions.h (catch_exception): Remove. (deprecated_throw_reason): Update comment. * mi/mi-main.c (captured_mi_execute_command): Change 'data' argument to 'context'. (mi_execute_command): Use TRY_CATCH. * remote.c (struct start_remote_args): Remove. (remote_start_remote): Update; change arguments. (remote_open_1): Use TRY_CATCH.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-interp.c26
-rw-r--r--gdb/cli/cli-script.c23
2 files changed, 10 insertions, 39 deletions
diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c
index 7a517e9..88a570c 100644
--- a/gdb/cli/cli-interp.c
+++ b/gdb/cli/cli-interp.c
@@ -37,12 +37,6 @@ struct ui_out *cli_uiout;
static struct gdb_exception safe_execute_command (struct ui_out *uiout,
char *command,
int from_tty);
-struct captured_execute_command_args
-{
- char *command;
- int from_tty;
-};
-
/* These implement the cli out interpreter: */
static void *
@@ -117,25 +111,15 @@ cli_interpreter_exec (void *data, const char *command_str)
return result;
}
-static void
-do_captured_execute_command (struct ui_out *uiout, void *data)
-{
- struct captured_execute_command_args *args =
- (struct captured_execute_command_args *) data;
-
- execute_command (args->command, args->from_tty);
-}
-
static struct gdb_exception
safe_execute_command (struct ui_out *uiout, char *command, int from_tty)
{
- struct gdb_exception e;
- struct captured_execute_command_args args;
+ volatile struct gdb_exception e;
- args.command = command;
- args.from_tty = from_tty;
- e = catch_exception (uiout, do_captured_execute_command, &args,
- RETURN_MASK_ALL);
+ TRY_CATCH (e, RETURN_MASK_ALL)
+ {
+ execute_command (command, from_tty);
+ }
/* FIXME: cagney/2005-01-13: This shouldn't be needed. Instead the
caller should print the exception. */
exception_print (gdb_stderr, e);
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 5903015..2d1afe5 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -1589,19 +1589,6 @@ source_cleanup_lines (void *args)
source_file_name = p->old_file;
}
-struct wrapped_read_command_file_args
-{
- FILE *stream;
-};
-
-static void
-wrapped_read_command_file (struct ui_out *uiout, void *data)
-{
- struct wrapped_read_command_file_args *args = data;
-
- read_command_file (args->stream);
-}
-
/* Used to implement source_command. */
void
@@ -1625,12 +1612,12 @@ script_from_file (FILE *stream, const char *file)
error_pre_print = "";
{
- struct gdb_exception e;
- struct wrapped_read_command_file_args args;
+ volatile struct gdb_exception e;
- args.stream = stream;
- e = catch_exception (uiout, wrapped_read_command_file, &args,
- RETURN_MASK_ERROR);
+ TRY_CATCH (e, RETURN_MASK_ERROR)
+ {
+ read_command_file (stream);
+ }
switch (e.reason)
{
case 0: