Use std::string rather than dyn-string
This patch changes some code in cli-cmds.c to use std::string rather than dyn-string, removing some cleanups. Since this was the last use of dyn-string in gdb, this patch also removes make_cleanup_dyn_string_delete. 2016-09-23 Tom Tromey <tom@tromey.com> * utils.h (make_cleanup_dyn_string_delete): Remove declaration. * utils.c: Don't include dyn-string.h. (do_dyn_string_delete, make_cleanup_dyn_string_delete): Remove. * cli/cli-cmds.c: Include <string>. Don't include dyn-string.h. (argv_to_string): Rename. Change return type to std::string. (alias_command): Use std::string.
This commit is contained in:
parent
cfe826d45e
commit
a97e29d248
4 changed files with 27 additions and 39 deletions
13
gdb/utils.c
13
gdb/utils.c
|
@ -18,7 +18,6 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "defs.h"
|
||||
#include "dyn-string.h"
|
||||
#include <ctype.h>
|
||||
#include "gdb_wait.h"
|
||||
#include "event-top.h"
|
||||
|
@ -154,18 +153,6 @@ make_cleanup_freeargv (char **arg)
|
|||
return make_cleanup (do_freeargv, arg);
|
||||
}
|
||||
|
||||
static void
|
||||
do_dyn_string_delete (void *arg)
|
||||
{
|
||||
dyn_string_delete ((dyn_string_t) arg);
|
||||
}
|
||||
|
||||
struct cleanup *
|
||||
make_cleanup_dyn_string_delete (dyn_string_t arg)
|
||||
{
|
||||
return make_cleanup (do_dyn_string_delete, arg);
|
||||
}
|
||||
|
||||
static void
|
||||
do_bfd_close_cleanup (void *arg)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue