aboutsummaryrefslogtreecommitdiff
path: root/gdb/interps.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2017-08-17 13:58:01 -0700
committerKeith Seitz <keiths@redhat.com>2017-08-17 13:58:01 -0700
commitb5f28d7abc02ca509e389fa932d725cf111e4b40 (patch)
tree57a0dc0feaff890630a6ba2c9fab811d56b1f9cf /gdb/interps.c
parent2a95a158fae932f758d75a1178a40d4cc4804ff0 (diff)
parent1a457753cfad05989574c671a221ffce2d5df703 (diff)
downloadbinutils-users/pmuldoon/c++compile.zip
binutils-users/pmuldoon/c++compile.tar.gz
binutils-users/pmuldoon/c++compile.tar.bz2
Problems: gdb/compile/compile.c gdb/cp-support.c gdb/cp-support.h gdb/gdbtypes.h gdb/language.c gdb/linespec.c
Diffstat (limited to 'gdb/interps.c')
-rw-r--r--gdb/interps.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/gdb/interps.c b/gdb/interps.c
index af86390..1e59034 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -407,21 +407,14 @@ interpreter_exec_cmd (char *args, int from_tty)
{
struct ui_interp_info *ui_interp = get_current_interp_info ();
struct interp *old_interp, *interp_to_use;
- char **prules = NULL;
- char **trule = NULL;
unsigned int nrules;
unsigned int i;
- struct cleanup *cleanup;
if (args == NULL)
error_no_arg (_("interpreter-exec command"));
- prules = gdb_buildargv (args);
- cleanup = make_cleanup_freeargv (prules);
-
- nrules = 0;
- for (trule = prules; *trule != NULL; trule++)
- nrules++;
+ gdb_argv prules (args);
+ nrules = prules.count ();
if (nrules < 2)
error (_("usage: interpreter-exec <interpreter> [ <command> ... ]"));
@@ -446,19 +439,17 @@ interpreter_exec_cmd (char *args, int from_tty)
}
interp_set (old_interp, 0);
-
- do_cleanups (cleanup);
}
/* See interps.h. */
-VEC (char_ptr) *
+void
interpreter_completer (struct cmd_list_element *ignore,
+ completion_tracker &tracker,
const char *text, const char *word)
{
struct interp_factory *interp;
int textlen;
- VEC (char_ptr) *matches = NULL;
int ix;
textlen = strlen (text);
@@ -485,11 +476,9 @@ interpreter_completer (struct cmd_list_element *ignore,
match[text - word] = '\0';
strcat (match, interp->name);
}
- VEC_safe_push (char_ptr, matches, match);
+ tracker.add_completion (gdb::unique_xmalloc_ptr<char> (match));
}
}
-
- return matches;
}
struct interp *