summaryrefslogtreecommitdiff
path: root/gdb/dwarf2-frame.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-08-11 20:36:48 +0000
committerTom Tromey <tromey@redhat.com>2009-08-11 20:36:48 +0000
commit3a4a1cd00493e6df57c6d04dd256c85df36f5e15 (patch)
tree2867c8fcf374cf98f8288be8492f6ebac600a2c1 /gdb/dwarf2-frame.c
parent057cd711e007579f6ec8e33566ec1528da7f71c9 (diff)
downloadgdb-3a4a1cd00493e6df57c6d04dd256c85df36f5e15.tar.gz
* 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/dwarf2-frame.c')
-rw-r--r--gdb/dwarf2-frame.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 0f6da4052b4..427f58f5cd4 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -352,8 +352,11 @@ execute_stack_op (gdb_byte *exp, ULONGEST len, int addr_size,
{
struct dwarf_expr_context *ctx;
CORE_ADDR result;
+ struct cleanup *old_chain;
ctx = new_dwarf_expr_context ();
+ old_chain = make_cleanup_free_dwarf_expr_context (ctx);
+
ctx->gdbarch = get_frame_arch (this_frame);
ctx->addr_size = addr_size;
ctx->baton = this_frame;
@@ -369,7 +372,7 @@ execute_stack_op (gdb_byte *exp, ULONGEST len, int addr_size,
if (ctx->in_reg)
result = read_reg (this_frame, result);
- free_dwarf_expr_context (ctx);
+ do_cleanups (old_chain);
return result;
}