Remove make_cleanup_free_so
make_cleanup_free_so is used in a single spot. This patch introduces a unique pointer wrapper for struct so_list, and changes this spot to use it. ChangeLog 2017-08-03 Tom Tromey <tom@tromey.com> * utils.h (make_cleanup_free_so): Remove. * utils.c (do_free_so, make_cleanup_free_so): Remove. * solist.h (struct so_deleter): New. (so_list_up): New typedef. * solib-svr4.c (svr4_read_so_list): Use so_list_up.
This commit is contained in:
parent
e3ad2841b1
commit
b3bc84537b
5 changed files with 26 additions and 39 deletions
18
gdb/utils.c
18
gdb/utils.c
|
@ -268,24 +268,6 @@ make_cleanup_value_free (struct value *value)
|
|||
return make_cleanup (do_value_free, value);
|
||||
}
|
||||
|
||||
/* Helper for make_cleanup_free_so. */
|
||||
|
||||
static void
|
||||
do_free_so (void *arg)
|
||||
{
|
||||
struct so_list *so = (struct so_list *) arg;
|
||||
|
||||
free_so (so);
|
||||
}
|
||||
|
||||
/* Make cleanup handler calling free_so for SO. */
|
||||
|
||||
struct cleanup *
|
||||
make_cleanup_free_so (struct so_list *so)
|
||||
{
|
||||
return make_cleanup (do_free_so, so);
|
||||
}
|
||||
|
||||
/* Helper function for make_cleanup_clear_parser_state. */
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue