aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/gdb/value.c b/gdb/value.c
index be01f0f..1fd9cc9 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -41,10 +41,7 @@
#include "cp-abi.h"
#include "user-regs.h"
#include <algorithm>
-
-/* Prototypes for exported functions. */
-
-void _initialize_values (void);
+#include "completer.h"
/* Definition of a user function. */
struct internal_function
@@ -2144,14 +2141,12 @@ lookup_only_internalvar (const char *name)
return NULL;
}
-/* Complete NAME by comparing it to the names of internal variables.
- Returns a vector of newly allocated strings, or NULL if no matches
- were found. */
+/* Complete NAME by comparing it to the names of internal
+ variables. */
-VEC (char_ptr) *
-complete_internalvar (const char *name)
+void
+complete_internalvar (completion_tracker &tracker, const char *name)
{
- VEC (char_ptr) *result = NULL;
struct internalvar *var;
int len;
@@ -2160,12 +2155,10 @@ complete_internalvar (const char *name)
for (var = internalvars; var; var = var->next)
if (strncmp (var->name, name, len) == 0)
{
- char *r = xstrdup (var->name);
+ gdb::unique_xmalloc_ptr<char> copy (xstrdup (var->name));
- VEC_safe_push (char_ptr, result, r);
+ tracker.add_completion (std::move (copy));
}
-
- return result;
}
/* Create an internal variable with name NAME and with a void value.