mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-05 15:17:13 +08:00
gdb/
* 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:
19
gdb/utils.c
19
gdb/utils.c
@ -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 *))
|
||||
|
Reference in New Issue
Block a user