aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c19
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 *))