* defs.h (struct so_list): New forward declaration.
	(make_cleanup_free_so): New declaration.
	* solib-svr4.c (ignore_first_link_map_entry): Remove.
	(svr4_free_so): Move the function here from downwards.  Handle NULL
	so->lm_info.
	(svr4_free_library_list): New.
	(svr4_read_so_list): New, moved here code from svr4_current_sos.
	Use more cleanups.  Use new parameter ignore_first instead of
	ignore_first_link_map_entry.
	(svr4_current_sos): New variable ignore_first, initialize it.  New
	variable back_to, use it for svr4_free_library_list protection.
	(svr4_free_so): Remove - move upwards.
	* utils.c: Include solist.h.
	(do_free_so, make_cleanup_free_so): New functions.
This commit is contained in:
Jan Kratochvil 2011-10-14 07:55:26 +00:00
parent 970d488d05
commit cb08cc53a9
4 changed files with 171 additions and 105 deletions

View file

@ -60,6 +60,7 @@
#include "gdbcore.h"
#include "top.h"
#include "main.h"
#include "solist.h"
#include "inferior.h" /* for signed_pointer_to_address */
@ -495,6 +496,24 @@ make_cleanup_value_free (struct value *value)
return make_my_cleanup (&cleanup_chain, do_value_free, value);
}
/* Helper for make_cleanup_free_so. */
static void
do_free_so (void *arg)
{
struct so_list *so = arg;
free_so (so);
}
/* Make cleanup handler calling free_so for SO. */
struct cleanup *
make_cleanup_free_so (struct so_list *so)
{
return make_my_cleanup (&cleanup_chain, do_free_so, so);
}
struct cleanup *
make_my_cleanup2 (struct cleanup **pmy_chain, make_cleanup_ftype *function,
void *arg, void (*free_arg) (void *))