diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2017-07-14 12:47:40 +0200 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2017-07-14 12:47:40 +0200 |
commit | 40f4af2873b0631bc5f1d4ded2070abe2de2217c (patch) | |
tree | 5769d83c4809ba2814dc3576a7655d0f87a1dcae /gdb/dwarf2loc.c | |
parent | 053f805718fb3a77169afebba83cc665e9509e7b (diff) | |
download | gdb-40f4af2873b0631bc5f1d4ded2070abe2de2217c.zip gdb-40f4af2873b0631bc5f1d4ded2070abe2de2217c.tar.gz gdb-40f4af2873b0631bc5f1d4ded2070abe2de2217c.tar.bz2 |
ax-gdb: Remove unnecessary gdbarch parameters
In multiple places, we pass the gdbarch as an argument to some
functions, even though it's available in the agent_expr structure also
passed to the same functions. Remove these arguments and replace their
usage with accesses to agent_expr::gdbarch.
gdb/ChangeLog:
* dwarf2loc.h (dwarf2_compile_expr_to_ax): Remove gdbarch
parameter.
* symtab.h (struct symbol_computed_ops::tracepoint_var_ref):
Likewise.
* dwarf2loc.c (dwarf2_compile_expr_to_ax): Remove gdbarch
parameter, use agent_expr::gdbarch instead, update function
calls.
(locexpr_tracepoint_var_ref): Likewise.
(loclist_tracepoint_var_ref): Likewise.
* ax-gdb.c (gen_trace_static_fields): Likewise.
(gen_traced_pop): Likewise.
(gen_frame_args_address): Likewise.
(gen_frame_locals_address): Likewise.
(gen_var_ref): Likewise.
(gen_struct_ref_recursive): Likewise.
(gen_static_field): Likewise.
(gen_maybe_namespace_elt): Likewise.
(gen_expr): Likewise.
(gen_trace_for_var): Likewise.
(gen_trace_for_expr): Likewise.
(gen_trace_for_return_address): Likewise.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r-- | gdb/dwarf2loc.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index d33c83e..927d950 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -3018,10 +3018,11 @@ get_ax_pc (void *baton) void dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc, - struct gdbarch *arch, unsigned int addr_size, - const gdb_byte *op_ptr, const gdb_byte *op_end, + unsigned int addr_size, const gdb_byte *op_ptr, + const gdb_byte *op_end, struct dwarf2_per_cu_data *per_cu) { + gdbarch *arch = expr->gdbarch; int i; std::vector<int> dw_labels, patches; const gdb_byte * const base = op_ptr; @@ -3297,7 +3298,7 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc, &datastart, &datalen); op_ptr = safe_read_sleb128 (op_ptr, op_end, &offset); - dwarf2_compile_expr_to_ax (expr, loc, arch, addr_size, datastart, + dwarf2_compile_expr_to_ax (expr, loc, addr_size, datastart, datastart + datalen, per_cu); if (loc->kind == axs_lvalue_register) require_rvalue (expr, loc); @@ -3523,8 +3524,8 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc, { /* Another expression. */ ax_const_l (expr, text_offset); - dwarf2_compile_expr_to_ax (expr, loc, arch, addr_size, - cfa_start, cfa_end, per_cu); + dwarf2_compile_expr_to_ax (expr, loc, addr_size, cfa_start, + cfa_end, per_cu); } loc->kind = axs_lvalue_memory; @@ -3648,9 +3649,8 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc, /* DW_OP_call_ref is currently not supported. */ gdb_assert (block.per_cu == per_cu); - dwarf2_compile_expr_to_ax (expr, loc, arch, addr_size, - block.data, block.data + block.size, - per_cu); + dwarf2_compile_expr_to_ax (expr, loc, addr_size, block.data, + block.data + block.size, per_cu); } break; @@ -4407,8 +4407,8 @@ locexpr_describe_location (struct symbol *symbol, CORE_ADDR addr, any necessary bytecode in AX. */ static void -locexpr_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, - struct agent_expr *ax, struct axs_value *value) +locexpr_tracepoint_var_ref (struct symbol *symbol, struct agent_expr *ax, + struct axs_value *value) { struct dwarf2_locexpr_baton *dlbaton = (struct dwarf2_locexpr_baton *) SYMBOL_LOCATION_BATON (symbol); @@ -4417,9 +4417,8 @@ locexpr_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, if (dlbaton->size == 0) value->optimized_out = 1; else - dwarf2_compile_expr_to_ax (ax, value, gdbarch, addr_size, - dlbaton->data, dlbaton->data + dlbaton->size, - dlbaton->per_cu); + dwarf2_compile_expr_to_ax (ax, value, addr_size, dlbaton->data, + dlbaton->data + dlbaton->size, dlbaton->per_cu); } /* symbol_computed_ops 'generate_c_location' method. */ @@ -4615,8 +4614,8 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr, /* Describe the location of SYMBOL as an agent value in VALUE, generating any necessary bytecode in AX. */ static void -loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, - struct agent_expr *ax, struct axs_value *value) +loclist_tracepoint_var_ref (struct symbol *symbol, struct agent_expr *ax, + struct axs_value *value) { struct dwarf2_loclist_baton *dlbaton = (struct dwarf2_loclist_baton *) SYMBOL_LOCATION_BATON (symbol); @@ -4628,7 +4627,7 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, if (size == 0) value->optimized_out = 1; else - dwarf2_compile_expr_to_ax (ax, value, gdbarch, addr_size, data, data + size, + dwarf2_compile_expr_to_ax (ax, value, addr_size, data, data + size, dlbaton->per_cu); } |