From 595d2e303c0ef1a5cd5af8868c1d41db0050eb29 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 25 Sep 2016 16:48:47 -0600 Subject: Convert DWARF expr functions to methods This converts various DWARF expr functions to be members on dwarf_expr_context, then fixes up the various users. This results in somewhat less wordy code and sets the stage for the next patch. 2016-10-21 Tom Tromey * dwarf2loc.c (per_cu_dwarf_call) (dwarf_expr_push_dwarf_reg_entry_value) (dwarf2_evaluate_loc_desc_full, dwarf2_locexpr_baton_eval) (needs_dwarf_reg_entry_value) (dwarf2_loc_desc_get_symbol_read_needs): Update. * dwarf2expr.h (dwarf_expr_context) : New method declarations. (dwarf_expr_push_address, dwarf_expr_eval, dwarf_expr_fetch) (dwarf_expr_fetch_address, dwarf_expr_fetch_in_stack_memory): Don't declare. * dwarf2expr.c (address_type, grow_stack, push, push_address) (pop, fetch, fetch_address, fetch_in_stack_memory) (stack_empty_p, add_piece, eval, get_base_type) (execute_stack_op): Rename. Turn into methods. * dwarf2-frame.c (execute_stack_op): Update. --- gdb/dwarf2-frame.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gdb/dwarf2-frame.c') diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index 48963de3835..c93c362cb01 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -382,14 +382,14 @@ execute_stack_op (const gdb_byte *exp, ULONGEST len, int addr_size, ctx.baton = this_frame; ctx.funcs = &dwarf2_frame_ctx_funcs; - dwarf_expr_push_address (&ctx, initial, initial_in_stack_memory); - dwarf_expr_eval (&ctx, exp, len); + ctx.push_address (initial, initial_in_stack_memory); + ctx.eval (exp, len); if (ctx.location == DWARF_VALUE_MEMORY) - result = dwarf_expr_fetch_address (&ctx, 0); + result = ctx.fetch_address (0); else if (ctx.location == DWARF_VALUE_REGISTER) result = read_addr_from_reg (this_frame, - value_as_long (dwarf_expr_fetch (&ctx, 0))); + value_as_long (ctx.fetch (0))); else { /* This is actually invalid DWARF, but if we ever do run across -- cgit v1.2.1