]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove make_cleanup_freeargv and gdb_buildargv
authorTom Tromey <tom@tromey.com>
Sun, 23 Jul 2017 21:52:59 +0000 (15:52 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 3 Aug 2017 13:59:10 +0000 (07:59 -0600)
After the previous patches in this series, make_cleanup_freeargv and
gdb_buildargv are now unused and can be removed.

ChangeLog
2017-08-03  Tom Tromey  <tom@tromey.com>

* utils.c (make_cleanup_freeargv, do_freeargv, gdb_buildargv):
Remove.
* utils.h (make_cleanup_freeargv, gdb_buildargv): Remove.

gdb/ChangeLog
gdb/utils.c
gdb/utils.h

index 074491c7824f06b56bd3575f5a203e615cdda7c7..92c573d76b752a7eab4b4186e6cb89228c955d46 100644 (file)
@@ -1,3 +1,9 @@
+2017-08-03  Tom Tromey  <tom@tromey.com>
+
+       * utils.c (make_cleanup_freeargv, do_freeargv, gdb_buildargv):
+       Remove.
+       * utils.h (make_cleanup_freeargv, gdb_buildargv): Remove.
+
 2017-08-03  Tom Tromey  <tom@tromey.com>
 
        * python/py-param.c (compute_enum_values): Use gdb_argv.
index e7e176da8ca39f1692e645a7114c87482bafe35c..96ae709fb23be66b752ac58c7f067d1fef3699d2 100644 (file)
@@ -136,18 +136,6 @@ show_pagination_enabled (struct ui_file *file, int from_tty,
    because while they use the "cleanup API" they are not part of the
    "cleanup API".  */
 
-static void
-do_freeargv (void *arg)
-{
-  freeargv ((char **) arg);
-}
-
-struct cleanup *
-make_cleanup_freeargv (char **arg)
-{
-  return make_cleanup (do_freeargv, arg);
-}
-
 /* Helper function for make_cleanup_ui_out_redirect_pop.  */
 
 static void
@@ -2877,21 +2865,6 @@ gdb_argv::reset (const char *s)
   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,
-   unless the parameter itself is NULL.  */
-
-char **
-gdb_buildargv (const char *s)
-{
-  char **argv = buildargv (s);
-
-  if (s != NULL && argv == NULL)
-    malloc_failure (0);
-  return argv;
-}
-
 int
 compare_positive_ints (const void *ap, const void *bp)
 {
index 88cab4b93072a61af8ab1f723af4cd11c307e346..c922a22ffad7259b8a09117ea6aa0c301e7e05b7 100644 (file)
@@ -85,8 +85,6 @@ extern int parse_pid_to_attach (const char *args);
 
 extern int parse_escape (struct gdbarch *, const char **);
 
-char **gdb_buildargv (const char *);
-
 /* A wrapper for an array of char* that was allocated in the way that
    'buildargv' does, and should be freed with 'freeargv'.  */
 
@@ -207,8 +205,6 @@ private:
 \f
 /* Cleanup utilities.  */
 
-extern struct cleanup *make_cleanup_freeargv (char **);
-
 struct ui_out;
 extern struct cleanup *
   make_cleanup_ui_out_redirect_pop (struct ui_out *uiout);