aboutsummaryrefslogtreecommitdiff
path: root/gdb/common/common-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/common/common-utils.c')
-rw-r--r--gdb/common/common-utils.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/common/common-utils.c b/gdb/common/common-utils.c
index e94fdc4..793ab3b 100644
--- a/gdb/common/common-utils.c
+++ b/gdb/common/common-utils.c
@@ -18,6 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common-defs.h"
+#include "common-utils.h"
#include "host-defs.h"
#include <ctype.h>
@@ -328,3 +329,26 @@ free_vector_argv (std::vector<char *> &v)
v.clear ();
}
+
+/* See common/common-utils.h. */
+
+std::string
+stringify_argv (const std::vector<char *> &args)
+{
+ std::string ret;
+
+ if (!args.empty ())
+ {
+ for (auto s : args)
+ if (s != NULL)
+ {
+ ret += s;
+ ret += ' ';
+ }
+
+ /* Erase the last whitespace. */
+ ret.erase (ret.end () - 1);
+ }
+
+ return ret;
+}