diff options
author | Keith Seitz <keiths@redhat.com> | 2002-05-28 23:47:02 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2002-05-28 23:47:02 +0000 |
commit | 9102d64fc2e0d586430ee78205f979a79a3cc01b (patch) | |
tree | a1d84a52034520345137ba9c2735d5e6477faf7e /gdb/wrapper.c | |
parent | 0d49dda2de4c1fd23c87348f08a022bfd3ee3334 (diff) | |
download | gdb-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.c | 26 |
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); +} |