aboutsummaryrefslogtreecommitdiff
path: root/gdb/wrapper.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2002-05-28 23:47:02 +0000
committerKeith Seitz <keiths@redhat.com>2002-05-28 23:47:02 +0000
commit9102d64fc2e0d586430ee78205f979a79a3cc01b (patch)
treea1d84a52034520345137ba9c2735d5e6477faf7e /gdb/wrapper.c
parent0d49dda2de4c1fd23c87348f08a022bfd3ee3334 (diff)
downloadgdb-9102d64fc2e0d586430ee78205f979a79a3cc01b.zip
gdb-9102d64fc2e0d586430ee78205f979a79a3cc01b.tar.gz
gdb-9102d64fc2e0d586430ee78205f979a79a3cc01b.tar.bz2
Initial check-in of interpreter support from Apple. (Slightly massaged and
modified by me.)
Diffstat (limited to 'gdb/wrapper.c')
-rw-r--r--gdb/wrapper.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/gdb/wrapper.c b/gdb/wrapper.c
index 6c9c6d6..4d39008 100644
--- a/gdb/wrapper.c
+++ b/gdb/wrapper.c
@@ -19,8 +19,9 @@
#include "defs.h"
#include "value.h"
#include "wrapper.h"
+#include "top.h" /* for execute_command */
-/* Use this struct to pass arguments to wrapper routines. We assume
+/* use this struct to pass arguments to wrapper routines. We assume
(arbitrarily) that no gdb function takes more than ten arguments. */
struct gdb_wrapper_arguments
{
@@ -51,6 +52,12 @@ struct captured_value_struct_elt_args
struct value **result_ptr;
};
+struct captured_execute_command_args
+{
+ char *command;
+ int from_tty;
+};
+
static int wrap_parse_exp_1 (char *);
static int wrap_evaluate_expression (char *);
@@ -331,3 +338,20 @@ do_captured_value_struct_elt (struct ui_out *uiout, void *data)
return GDB_RC_OK;
}
+static int
+do_captured_execute_command (struct ui_out *uiout, void *data)
+{
+ struct captured_execute_command_args *args = data;
+ execute_command (args->command, args->from_tty);
+ return GDB_RC_OK;
+}
+
+enum gdb_rc
+gdb_execute_command (struct ui_out *uiout, char *command, int from_tty)
+{
+ struct captured_execute_command_args args;
+ args.command = command;
+ args.from_tty = from_tty;
+ return catch_exceptions (uiout, do_captured_execute_command, &args,
+ NULL, RETURN_MASK_ALL);
+}