aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 06f4168..e7e176d 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -2863,6 +2863,20 @@ ldirname (const char *filename)
return dirname;
}
+/* See utils.h. */
+
+void
+gdb_argv::reset (const char *s)
+{
+ char **argv = buildargv (s);
+
+ if (s != NULL && argv == NULL)
+ malloc_failure (0);
+
+ freeargv (m_argv);
+ m_argv = argv;
+}
+
/* Call libiberty's buildargv, and return the result.
If buildargv fails due to out-of-memory, call nomem.
Therefore, the returned value is guaranteed to be non-NULL,