diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-10-14 07:55:26 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-10-14 07:55:26 +0000 |
commit | cb08cc53a94b7b878df56545bddfff940bb90d20 (patch) | |
tree | be3cbbdd73116b585c372f635e88c35cb9647ed0 /gdb/utils.c | |
parent | 970d488d05590ebfea5804e5a58e5fa7c85ac0b4 (diff) | |
download | gdb-cb08cc53a94b7b878df56545bddfff940bb90d20.zip gdb-cb08cc53a94b7b878df56545bddfff940bb90d20.tar.gz gdb-cb08cc53a94b7b878df56545bddfff940bb90d20.tar.bz2 |
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.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r-- | gdb/utils.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index 4a0b5a2..5c03e71 100644 --- a/gdb/utils.c +++ b/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 *)) |