]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/tracepoint.c
Introduce gdb_argv, a class wrapper for buildargv
[thirdparty/binutils-gdb.git] / gdb / tracepoint.c
index 6721e22773007bebe9479fbf0f48eb6018f0cc87..86acdbe5cc88032b847e1d3bca088d6066f090a2 100644 (file)
@@ -447,10 +447,6 @@ trace_variable_command (char *args, int from_tty)
 static void
 delete_trace_variable_command (char *args, int from_tty)
 {
-  int ix;
-  char **argv;
-  struct cleanup *back_to;
-
   if (args == NULL)
     {
       if (query (_("Delete all trace state variables? ")))
@@ -460,19 +456,16 @@ delete_trace_variable_command (char *args, int from_tty)
       return;
     }
 
-  argv = gdb_buildargv (args);
-  back_to = make_cleanup_freeargv (argv);
+  gdb_argv argv (args);
 
-  for (ix = 0; argv[ix] != NULL; ix++)
+  for (char *arg : argv)
     {
-      if (*argv[ix] == '$')
-       delete_trace_state_variable (argv[ix] + 1);
+      if (*arg == '$')
+       delete_trace_state_variable (arg + 1);
       else
-       warning (_("Name \"%s\" not prefixed with '$', ignoring"), argv[ix]);
+       warning (_("Name \"%s\" not prefixed with '$', ignoring"), arg);
     }
 
-  do_cleanups (back_to);
-
   dont_repeat ();
 }