* 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.
This commit is contained in:
Tom Tromey
2009-08-11 20:36:49 +00:00
parent 0d8f9b2ced
commit 4a22739830
5 changed files with 39 additions and 3 deletions

View File

@@ -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. */