diff options
Diffstat (limited to 'gdb/dwarf2expr.c')
-rw-r--r-- | gdb/dwarf2expr.c | 16 |
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. */ |