aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2expr.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-08-11 20:36:49 +0000
committerTom Tromey <tromey@redhat.com>2009-08-11 20:36:49 +0000
commit4a22739830aea21ec5de7756676a9ce7c3821001 (patch)
treed940da935e83fa6c33d7d8b5a1a7a66db52667b1 /gdb/dwarf2expr.c
parent0d8f9b2ced3015b9857a2456dcde76e04f18121f (diff)
downloadgdb-4a22739830aea21ec5de7756676a9ce7c3821001.zip
gdb-4a22739830aea21ec5de7756676a9ce7c3821001.tar.gz
gdb-4a22739830aea21ec5de7756676a9ce7c3821001.tar.bz2
* dwarf2loc.c (dwarf2_evaluate_loc_desc): Make a cleanup.
(dwarf2_loc_desc_needs_frame): Likewise. * dwarf2expr.h (make_cleanup_free_dwarf_expr_context): Declare. * dwarf2expr.c (free_dwarf_expr_context_cleanup): New function. (make_cleanup_free_dwarf_expr_context): Likewise. * dwarf2-frame.c (execute_stack_op): Make a cleanup.
Diffstat (limited to 'gdb/dwarf2expr.c')
-rw-r--r--gdb/dwarf2expr.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index 8dbf976..2721065 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -61,6 +61,22 @@ free_dwarf_expr_context (struct dwarf_expr_context *ctx)
xfree (ctx);
}
+/* Helper for make_cleanup_free_dwarf_expr_context. */
+
+static void
+free_dwarf_expr_context_cleanup (void *arg)
+{
+ free_dwarf_expr_context (arg);
+}
+
+/* Return a cleanup that calls free_dwarf_expr_context. */
+
+struct cleanup *
+make_cleanup_free_dwarf_expr_context (struct dwarf_expr_context *ctx)
+{
+ return make_cleanup (free_dwarf_expr_context_cleanup, ctx);
+}
+
/* Expand the memory allocated to CTX's stack to contain at least
NEED more elements than are currently used. */