diff options
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/ada-imported.c | 2 | ||||
-rw-r--r-- | gdb/dwarf2/call-site.h | 4 | ||||
-rw-r--r-- | gdb/dwarf2/expr.c | 8 | ||||
-rw-r--r-- | gdb/dwarf2/expr.h | 4 | ||||
-rw-r--r-- | gdb/dwarf2/frame-tailcall.c | 23 | ||||
-rw-r--r-- | gdb/dwarf2/frame-tailcall.h | 4 | ||||
-rw-r--r-- | gdb/dwarf2/frame.c | 40 | ||||
-rw-r--r-- | gdb/dwarf2/frame.h | 25 | ||||
-rw-r--r-- | gdb/dwarf2/loc.c | 51 | ||||
-rw-r--r-- | gdb/dwarf2/loc.h | 26 |
10 files changed, 94 insertions, 93 deletions
diff --git a/gdb/dwarf2/ada-imported.c b/gdb/dwarf2/ada-imported.c index 1a0bc1d..065e2b9 100644 --- a/gdb/dwarf2/ada-imported.c +++ b/gdb/dwarf2/ada-imported.c @@ -32,7 +32,7 @@ get_imported_name (const struct symbol *sym) /* Implement the read_variable method from symbol_computed_ops. */ static struct value * -ada_imported_read_variable (struct symbol *symbol, frame_info_ptr frame) +ada_imported_read_variable (struct symbol *symbol, const frame_info_ptr &frame) { const char *name = get_imported_name (symbol); bound_minimal_symbol minsym = lookup_minimal_symbol_linkage (name, false); diff --git a/gdb/dwarf2/call-site.h b/gdb/dwarf2/call-site.h index 5434c84..0a0c7e8 100644 --- a/gdb/dwarf2/call-site.h +++ b/gdb/dwarf2/call-site.h @@ -94,7 +94,7 @@ struct call_site_target void iterate_over_addresses (struct gdbarch *call_site_gdbarch, const struct call_site *call_site, - frame_info_ptr caller_frame, + const frame_info_ptr &caller_frame, iterate_ftype callback) const; private: @@ -201,7 +201,7 @@ struct call_site throw NO_ENTRY_VALUE_ERROR. */ void iterate_over_addresses (struct gdbarch *call_site_gdbarch, - frame_info_ptr caller_frame, + const frame_info_ptr &caller_frame, call_site_target::iterate_ftype callback) const { diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c index 9cfae10..d0256e7 100644 --- a/gdb/dwarf2/expr.c +++ b/gdb/dwarf2/expr.c @@ -49,7 +49,7 @@ static const registry<gdbarch>::key<dwarf_gdbarch_types> dwarf_arch_cookie; /* Ensure that a FRAME is defined, throw an exception otherwise. */ static void -ensure_have_frame (frame_info_ptr frame, const char *op_name) +ensure_have_frame (const frame_info_ptr &frame, const char *op_name) { if (frame == nullptr) throw_error (GENERIC_ERROR, @@ -78,7 +78,7 @@ bits_to_bytes (ULONGEST start, ULONGEST n_bits) /* See expr.h. */ CORE_ADDR -read_addr_from_reg (frame_info_ptr frame, int reg) +read_addr_from_reg (const frame_info_ptr &frame, int reg) { struct gdbarch *gdbarch = get_frame_arch (frame); int regnum = dwarf_reg_to_regnum_or_error (gdbarch, reg); @@ -112,7 +112,7 @@ static piece_closure * allocate_piece_closure (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, std::vector<dwarf_expr_piece> &&pieces, - frame_info_ptr frame) + const frame_info_ptr &frame) { piece_closure *c = new piece_closure; @@ -1076,7 +1076,7 @@ dwarf_expr_context::fetch_result (struct type *type, struct type *subobj_type, value * dwarf_expr_context::evaluate (const gdb_byte *addr, size_t len, bool as_lval, - dwarf2_per_cu_data *per_cu, frame_info_ptr frame, + dwarf2_per_cu_data *per_cu, const frame_info_ptr &frame, const struct property_addr_info *addr_info, struct type *type, struct type *subobj_type, LONGEST subobj_offset) diff --git a/gdb/dwarf2/expr.h b/gdb/dwarf2/expr.h index 6acd078..b02cc53 100644 --- a/gdb/dwarf2/expr.h +++ b/gdb/dwarf2/expr.h @@ -137,7 +137,7 @@ struct dwarf_expr_context The ADDR_INFO property can be specified to override the range of memory addresses with the passed in buffer. */ value *evaluate (const gdb_byte *addr, size_t len, bool as_lval, - dwarf2_per_cu_data *per_cu, frame_info_ptr frame, + dwarf2_per_cu_data *per_cu, const frame_info_ptr &frame, const struct property_addr_info *addr_info = nullptr, struct type *type = nullptr, struct type *subobj_type = nullptr, @@ -256,7 +256,7 @@ private: /* Return the value of register number REG (a DWARF register number), read as an address in a given FRAME. */ -CORE_ADDR read_addr_from_reg (frame_info_ptr frame, int reg); +CORE_ADDR read_addr_from_reg (const frame_info_ptr &frame, int reg); void dwarf_expr_require_composition (const gdb_byte *, const gdb_byte *, const char *); diff --git a/gdb/dwarf2/frame-tailcall.c b/gdb/dwarf2/frame-tailcall.c index 27a820a..2f6400d 100644 --- a/gdb/dwarf2/frame-tailcall.c +++ b/gdb/dwarf2/frame-tailcall.c @@ -90,7 +90,7 @@ cache_eq (const void *arg1, const void *arg2) tailcall_cache. */ static struct tailcall_cache * -cache_new_ref1 (frame_info_ptr next_bottom_frame) +cache_new_ref1 (const frame_info_ptr &next_bottom_frame) { struct tailcall_cache *cache = XCNEW (struct tailcall_cache); void **slot; @@ -137,7 +137,7 @@ cache_unref (struct tailcall_cache *cache) return 0. */ static int -frame_is_tailcall (frame_info_ptr fi) +frame_is_tailcall (const frame_info_ptr &fi) { return frame_unwinder_is (fi, &dwarf2_tailcall_frame_unwind); } @@ -146,12 +146,13 @@ frame_is_tailcall (frame_info_ptr fi) call chain. Otherwise return NULL. No new reference is created. */ static struct tailcall_cache * -cache_find (frame_info_ptr fi) +cache_find (const frame_info_ptr &initial_fi) { struct tailcall_cache *cache; struct tailcall_cache search; void **slot; + frame_info_ptr fi = initial_fi; while (frame_is_tailcall (fi)) { fi = get_next_frame (fi); @@ -173,7 +174,7 @@ cache_find (frame_info_ptr fi) If THIS_FRAME is CACHE-> NEXT_BOTTOM_FRAME return -1. */ static int -existing_next_levels (frame_info_ptr this_frame, +existing_next_levels (const frame_info_ptr &this_frame, struct tailcall_cache *cache) { int retval = (frame_relative_level (this_frame) @@ -210,7 +211,7 @@ pretended_chain_levels (struct call_site_chain *chain) Specific virtual tail call frames are tracked by INLINE_DEPTH. */ static void -tailcall_frame_this_id (frame_info_ptr this_frame, void **this_cache, +tailcall_frame_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { struct tailcall_cache *cache = (struct tailcall_cache *) *this_cache; @@ -232,7 +233,7 @@ tailcall_frame_this_id (frame_info_ptr this_frame, void **this_cache, CACHE. */ static CORE_ADDR -pretend_pc (frame_info_ptr this_frame, struct tailcall_cache *cache) +pretend_pc (const frame_info_ptr &this_frame, struct tailcall_cache *cache) { int next_levels = existing_next_levels (this_frame, cache); struct call_site_chain *chain = cache->chain; @@ -264,7 +265,7 @@ pretend_pc (frame_info_ptr this_frame, struct tailcall_cache *cache) frames unwind the NULL case differently. */ struct value * -dwarf2_tailcall_prev_register_first (frame_info_ptr this_frame, +dwarf2_tailcall_prev_register_first (const frame_info_ptr &this_frame, void **tailcall_cachep, int regnum) { struct gdbarch *this_gdbarch = get_frame_arch (this_frame); @@ -294,7 +295,7 @@ dwarf2_tailcall_prev_register_first (frame_info_ptr this_frame, dwarf2_tailcall_prev_register_first. */ static struct value * -tailcall_frame_prev_register (frame_info_ptr this_frame, +tailcall_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, int regnum) { struct tailcall_cache *cache = (struct tailcall_cache *) *this_cache; @@ -316,7 +317,7 @@ tailcall_frame_prev_register (frame_info_ptr this_frame, static int tailcall_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, void **this_cache) + const frame_info_ptr &this_frame, void **this_cache) { frame_info_ptr next_frame; int next_levels; @@ -363,7 +364,7 @@ tailcall_frame_sniffer (const struct frame_unwind *self, address pushed on the stack. */ void -dwarf2_tailcall_sniffer_first (frame_info_ptr this_frame, +dwarf2_tailcall_sniffer_first (const frame_info_ptr &this_frame, void **tailcall_cachep, const LONGEST *entry_cfa_sp_offsetp) { @@ -458,7 +459,7 @@ tailcall_frame_dealloc_cache (frame_info *self, void *this_cache) call frames have gdbarch of the bottom (callee) frame. */ static struct gdbarch * -tailcall_frame_prev_arch (frame_info_ptr this_frame, +tailcall_frame_prev_arch (const frame_info_ptr &this_frame, void **this_prologue_cache) { struct tailcall_cache *cache = (struct tailcall_cache *) *this_prologue_cache; diff --git a/gdb/dwarf2/frame-tailcall.h b/gdb/dwarf2/frame-tailcall.h index b0809c8..3f49487 100644 --- a/gdb/dwarf2/frame-tailcall.h +++ b/gdb/dwarf2/frame-tailcall.h @@ -26,12 +26,12 @@ struct frame_unwind; /* The tail call frame unwinder. */ extern void - dwarf2_tailcall_sniffer_first (frame_info_ptr this_frame, + dwarf2_tailcall_sniffer_first (const frame_info_ptr &this_frame, void **tailcall_cachep, const LONGEST *entry_cfa_sp_offsetp); extern struct value * - dwarf2_tailcall_prev_register_first (frame_info_ptr this_frame, + dwarf2_tailcall_prev_register_first (const frame_info_ptr &this_frame, void **tailcall_cachep, int regnum); extern const struct frame_unwind dwarf2_tailcall_frame_unwind; diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c index fc6704f..530513c 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -233,7 +233,7 @@ register %s (#%d) at %s"), static CORE_ADDR execute_stack_op (const gdb_byte *exp, ULONGEST len, int addr_size, - frame_info_ptr this_frame, CORE_ADDR initial, + const frame_info_ptr &this_frame, CORE_ADDR initial, int initial_in_stack_memory, dwarf2_per_objfile *per_objfile) { dwarf_expr_context ctx (per_objfile, addr_size); @@ -589,17 +589,17 @@ execute_cfa_program_test (struct gdbarch *gdbarch) static void dwarf2_frame_default_init_reg (struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, - frame_info_ptr this_frame); + const frame_info_ptr &this_frame); struct dwarf2_frame_ops { /* Pre-initialize the register state REG for register REGNUM. */ void (*init_reg) (struct gdbarch *, int, struct dwarf2_frame_state_reg *, - frame_info_ptr) + const frame_info_ptr &) = dwarf2_frame_default_init_reg; /* Check whether the THIS_FRAME is a signal trampoline. */ - int (*signal_frame_p) (struct gdbarch *, frame_info_ptr) = nullptr; + int (*signal_frame_p) (struct gdbarch *, const frame_info_ptr &) = nullptr; /* Convert .eh_frame register number to DWARF register number, or adjust .debug_frame register number. */ @@ -625,7 +625,7 @@ get_frame_ops (struct gdbarch *gdbarch) static void dwarf2_frame_default_init_reg (struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, - frame_info_ptr this_frame) + const frame_info_ptr &this_frame) { /* If we have a register that acts as a program counter, mark it as a destination for the return address. If we have a register that @@ -666,7 +666,7 @@ void dwarf2_frame_set_init_reg (struct gdbarch *gdbarch, void (*init_reg) (struct gdbarch *, int, struct dwarf2_frame_state_reg *, - frame_info_ptr)) + const frame_info_ptr &)) { struct dwarf2_frame_ops *ops = get_frame_ops (gdbarch); @@ -678,7 +678,7 @@ dwarf2_frame_set_init_reg (struct gdbarch *gdbarch, static void dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, - frame_info_ptr this_frame) + const frame_info_ptr &this_frame) { struct dwarf2_frame_ops *ops = get_frame_ops (gdbarch); @@ -691,7 +691,7 @@ dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, void dwarf2_frame_set_signal_frame_p (struct gdbarch *gdbarch, int (*signal_frame_p) (struct gdbarch *, - frame_info_ptr)) + const frame_info_ptr &)) { struct dwarf2_frame_ops *ops = get_frame_ops (gdbarch); @@ -703,7 +703,7 @@ dwarf2_frame_set_signal_frame_p (struct gdbarch *gdbarch, static int dwarf2_frame_signal_frame_p (struct gdbarch *gdbarch, - frame_info_ptr this_frame) + const frame_info_ptr &this_frame) { struct dwarf2_frame_ops *ops = get_frame_ops (gdbarch); @@ -890,7 +890,7 @@ struct dwarf2_frame_cache }; static struct dwarf2_frame_cache * -dwarf2_frame_cache (frame_info_ptr this_frame, void **this_cache) +dwarf2_frame_cache (const frame_info_ptr &this_frame, void **this_cache) { struct gdbarch *gdbarch = get_frame_arch (this_frame); const int num_regs = gdbarch_num_cooked_regs (gdbarch); @@ -1120,7 +1120,7 @@ incomplete CFI data; unspecified registers (e.g., %s) at %s"), } static enum unwind_stop_reason -dwarf2_frame_unwind_stop_reason (frame_info_ptr this_frame, +dwarf2_frame_unwind_stop_reason (const frame_info_ptr &this_frame, void **this_cache) { struct dwarf2_frame_cache *cache @@ -1136,7 +1136,7 @@ dwarf2_frame_unwind_stop_reason (frame_info_ptr this_frame, } static void -dwarf2_frame_this_id (frame_info_ptr this_frame, void **this_cache, +dwarf2_frame_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { struct dwarf2_frame_cache *cache = @@ -1151,7 +1151,7 @@ dwarf2_frame_this_id (frame_info_ptr this_frame, void **this_cache, } static struct value * -dwarf2_frame_prev_register (frame_info_ptr this_frame, void **this_cache, +dwarf2_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, int regnum) { struct gdbarch *gdbarch = get_frame_arch (this_frame); @@ -1253,7 +1253,7 @@ dwarf2_frame_prev_register (frame_info_ptr this_frame, void **this_cache, /* See frame.h. */ void * -dwarf2_frame_get_fn_data (frame_info_ptr this_frame, void **this_cache, +dwarf2_frame_get_fn_data (const frame_info_ptr &this_frame, void **this_cache, fn_prev_register cookie) { struct dwarf2_frame_fn_data *fn_data = nullptr; @@ -1271,7 +1271,7 @@ dwarf2_frame_get_fn_data (frame_info_ptr this_frame, void **this_cache, /* See frame.h. */ void * -dwarf2_frame_allocate_fn_data (frame_info_ptr this_frame, void **this_cache, +dwarf2_frame_allocate_fn_data (const frame_info_ptr &this_frame, void **this_cache, fn_prev_register cookie, unsigned long size) { struct dwarf2_frame_fn_data *fn_data = nullptr; @@ -1307,7 +1307,7 @@ dwarf2_frame_dealloc_cache (frame_info *self, void *this_cache) static int dwarf2_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, void **this_cache) + const frame_info_ptr &this_frame, void **this_cache) { if (!dwarf2_frame_unwinders_enabled_p) return 0; @@ -1383,7 +1383,7 @@ dwarf2_append_unwinders (struct gdbarch *gdbarch) response to the "info frame" command. */ static CORE_ADDR -dwarf2_frame_base_address (frame_info_ptr this_frame, void **this_cache) +dwarf2_frame_base_address (const frame_info_ptr &this_frame, void **this_cache) { struct dwarf2_frame_cache *cache = dwarf2_frame_cache (this_frame, this_cache); @@ -1400,7 +1400,7 @@ static const struct frame_base dwarf2_frame_base = }; const struct frame_base * -dwarf2_frame_base_sniffer (frame_info_ptr this_frame) +dwarf2_frame_base_sniffer (const frame_info_ptr &this_frame) { CORE_ADDR block_addr = get_frame_address_in_block (this_frame); @@ -1415,8 +1415,10 @@ dwarf2_frame_base_sniffer (frame_info_ptr this_frame) DW_OP_call_frame_cfa. */ CORE_ADDR -dwarf2_frame_cfa (frame_info_ptr this_frame) +dwarf2_frame_cfa (const frame_info_ptr &initial_this_frame) { + frame_info_ptr this_frame = initial_this_frame; + if (frame_unwinder_is (this_frame, &record_btrace_tailcall_frame_unwind) || frame_unwinder_is (this_frame, &record_btrace_frame_unwind)) throw_error (NOT_AVAILABLE_ERROR, diff --git a/gdb/dwarf2/frame.h b/gdb/dwarf2/frame.h index 1ef35ee..2167310 100644 --- a/gdb/dwarf2/frame.h +++ b/gdb/dwarf2/frame.h @@ -66,7 +66,7 @@ enum dwarf2_frame_reg_rule /* Register state. */ -typedef struct value *(*fn_prev_register) (frame_info_ptr this_frame, +typedef struct value *(*fn_prev_register) (const frame_info_ptr &this_frame, void **this_cache, int regnum); struct dwarf2_frame_state_reg @@ -207,18 +207,17 @@ extern bool dwarf2_frame_unwinders_enabled_p; /* Set the architecture-specific register state initialization function for GDBARCH to INIT_REG. */ -extern void dwarf2_frame_set_init_reg (struct gdbarch *gdbarch, - void (*init_reg) (struct gdbarch *, int, - struct dwarf2_frame_state_reg *, - frame_info_ptr)); +extern void dwarf2_frame_set_init_reg ( + gdbarch *gdbarch, void (*init_reg) (struct gdbarch *, int, + dwarf2_frame_state_reg *, + const frame_info_ptr &)); /* Set the architecture-specific signal trampoline recognition function for GDBARCH to SIGNAL_FRAME_P. */ -extern void - dwarf2_frame_set_signal_frame_p (struct gdbarch *gdbarch, - int (*signal_frame_p) (struct gdbarch *, - frame_info_ptr)); +extern void dwarf2_frame_set_signal_frame_p + (gdbarch *gdbarch, int (*signal_frame_p) (struct gdbarch *, + const frame_info_ptr &)); /* Set the architecture-specific adjustment of .eh_frame and .debug_frame register numbers. */ @@ -236,11 +235,11 @@ void dwarf2_append_unwinders (struct gdbarch *gdbarch); NULL if it can't be handled by the DWARF CFI frame unwinder. */ extern const struct frame_base * - dwarf2_frame_base_sniffer (frame_info_ptr this_frame); + dwarf2_frame_base_sniffer (const frame_info_ptr &this_frame); /* Compute the DWARF CFA for a frame. */ -CORE_ADDR dwarf2_frame_cfa (frame_info_ptr this_frame); +CORE_ADDR dwarf2_frame_cfa (const frame_info_ptr &this_frame); /* Find the CFA information for PC. @@ -276,7 +275,7 @@ extern int dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc, COOKIE is the key for the prev_function implementation. SIZE is the size of the custom data object to allocate. */ -extern void *dwarf2_frame_allocate_fn_data (frame_info_ptr this_frame, +extern void *dwarf2_frame_allocate_fn_data (const frame_info_ptr &this_frame, void **this_cache, fn_prev_register cookie, unsigned long size); @@ -291,7 +290,7 @@ extern void *dwarf2_frame_allocate_fn_data (frame_info_ptr this_frame, THIS_CACHE is the dwarf2 cache object to store the pointer on. COOKIE is the key for the prev_function implementation. */ -extern void *dwarf2_frame_get_fn_data (frame_info_ptr this_frame, +extern void *dwarf2_frame_get_fn_data (const frame_info_ptr &this_frame, void **this_cache, fn_prev_register cookie); diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 0f0d14f..203ad53 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -48,7 +48,7 @@ #include "gdbsupport/byte-vector.h" static struct value *dwarf2_evaluate_loc_desc_full - (struct type *type, frame_info_ptr frame, const gdb_byte *data, + (struct type *type, const frame_info_ptr &frame, const gdb_byte *data, size_t size, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, struct type *subobj_type, LONGEST subobj_byte_offset, bool as_lval = true); @@ -503,7 +503,7 @@ locexpr_find_frame_base_location (struct symbol *framefunc, CORE_ADDR pc, LOC_BLOCK functions using a DWARF expression as its DW_AT_frame_base. */ static CORE_ADDR -locexpr_get_frame_base (struct symbol *framefunc, frame_info_ptr frame) +locexpr_get_frame_base (struct symbol *framefunc, const frame_info_ptr &frame) { struct gdbarch *gdbarch; struct type *type; @@ -561,7 +561,7 @@ loclist_find_frame_base_location (struct symbol *framefunc, CORE_ADDR pc, LOC_BLOCK functions using a DWARF location list as its DW_AT_frame_base. */ static CORE_ADDR -loclist_get_frame_base (struct symbol *framefunc, frame_info_ptr frame) +loclist_get_frame_base (struct symbol *framefunc, const frame_info_ptr &frame) { struct gdbarch *gdbarch; struct type *type; @@ -649,11 +649,10 @@ show_entry_values_debug (struct ui_file *file, int from_tty, /* See gdbtypes.h. */ void -call_site_target::iterate_over_addresses - (struct gdbarch *call_site_gdbarch, - const struct call_site *call_site, - frame_info_ptr caller_frame, - iterate_ftype callback) const +call_site_target::iterate_over_addresses (gdbarch *call_site_gdbarch, + const call_site *call_site, + const frame_info_ptr &caller_frame, + iterate_ftype callback) const { switch (m_loc_kind) { @@ -1138,9 +1137,9 @@ call_site_parameter_matches (struct call_site_parameter *parameter, /* See loc.h. */ struct call_site_parameter * -dwarf_expr_reg_to_entry_parameter (frame_info_ptr frame, - enum call_site_parameter_kind kind, - union call_site_parameter_u kind_u, +dwarf_expr_reg_to_entry_parameter (const frame_info_ptr &initial_frame, + call_site_parameter_kind kind, + call_site_parameter_u kind_u, dwarf2_per_cu_data **per_cu_return, dwarf2_per_objfile **per_objfile_return) { @@ -1152,6 +1151,7 @@ dwarf_expr_reg_to_entry_parameter (frame_info_ptr frame, /* Initialize it just to avoid a GCC false warning. */ struct call_site_parameter *parameter = NULL; CORE_ADDR target_addr; + frame_info_ptr frame = initial_frame; while (get_frame_type (frame) == INLINE_FRAME) { @@ -1263,7 +1263,7 @@ dwarf_expr_reg_to_entry_parameter (frame_info_ptr frame, static struct value * dwarf_entry_parameter_to_value (struct call_site_parameter *parameter, CORE_ADDR deref_size, struct type *type, - frame_info_ptr caller_frame, + const frame_info_ptr &caller_frame, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile) { @@ -1339,7 +1339,7 @@ static const struct lval_funcs entry_data_value_funcs = /* See dwarf2/loc.h. */ struct value * -value_of_dwarf_reg_entry (struct type *type, frame_info_ptr frame, +value_of_dwarf_reg_entry (struct type *type, const frame_info_ptr &frame, enum call_site_parameter_kind kind, union call_site_parameter_u kind_u) { @@ -1395,7 +1395,7 @@ value_of_dwarf_reg_entry (struct type *type, frame_info_ptr frame, cannot resolve the parameter for any reason. */ static struct value * -value_of_dwarf_block_entry (struct type *type, frame_info_ptr frame, +value_of_dwarf_block_entry (struct type *type, const frame_info_ptr &frame, const gdb_byte *block, size_t block_len) { union call_site_parameter_u kind_u; @@ -1456,7 +1456,7 @@ struct value * indirect_synthetic_pointer (sect_offset die, LONGEST byte_offset, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, - frame_info_ptr frame, struct type *type, + const frame_info_ptr &frame, struct type *type, bool resolve_abstract_p) { /* Fetch the location expression of the DIE we're pointing to. */ @@ -1496,7 +1496,7 @@ indirect_synthetic_pointer (sect_offset die, LONGEST byte_offset, SUBOBJ_BYTE_OFFSET within the variable of type TYPE. */ static struct value * -dwarf2_evaluate_loc_desc_full (struct type *type, frame_info_ptr frame, +dwarf2_evaluate_loc_desc_full (struct type *type, const frame_info_ptr &frame, const gdb_byte *data, size_t size, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, @@ -1561,7 +1561,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, frame_info_ptr frame, passes 0 as the byte_offset. */ struct value * -dwarf2_evaluate_loc_desc (struct type *type, frame_info_ptr frame, +dwarf2_evaluate_loc_desc (struct type *type, const frame_info_ptr &frame, const gdb_byte *data, size_t size, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, bool as_lval) @@ -1584,7 +1584,7 @@ dwarf2_evaluate_loc_desc (struct type *type, frame_info_ptr frame, static int dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton, - frame_info_ptr frame, + const frame_info_ptr &frame, const struct property_addr_info *addr_stack, CORE_ADDR *valp, gdb::array_view<CORE_ADDR> push_values, @@ -1644,9 +1644,9 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton, /* See dwarf2/loc.h. */ bool -dwarf2_evaluate_property (const struct dynamic_prop *prop, - frame_info_ptr frame, - const struct property_addr_info *addr_stack, +dwarf2_evaluate_property (const dynamic_prop *prop, + const frame_info_ptr &initial_frame, + const property_addr_info *addr_stack, CORE_ADDR *value, gdb::array_view<CORE_ADDR> push_values) { @@ -1657,6 +1657,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, Without this here this could happen if the code below selects a frame. */ scoped_restore_current_language save_language; + frame_info_ptr frame = initial_frame; if (frame == NULL && has_stack_frames ()) frame = get_selected_frame (NULL); @@ -3051,7 +3052,7 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc, /* Return the value of SYMBOL in FRAME using the DWARF-2 expression evaluator to calculate the location. */ static struct value * -locexpr_read_variable (struct symbol *symbol, frame_info_ptr frame) +locexpr_read_variable (struct symbol *symbol, const frame_info_ptr &frame) { struct dwarf2_locexpr_baton *dlbaton = (struct dwarf2_locexpr_baton *) SYMBOL_LOCATION_BATON (symbol); @@ -3069,7 +3070,7 @@ locexpr_read_variable (struct symbol *symbol, frame_info_ptr frame) will be thrown. */ static struct value * -locexpr_read_variable_at_entry (struct symbol *symbol, frame_info_ptr frame) +locexpr_read_variable_at_entry (struct symbol *symbol, const frame_info_ptr &frame) { struct dwarf2_locexpr_baton *dlbaton = (struct dwarf2_locexpr_baton *) SYMBOL_LOCATION_BATON (symbol); @@ -3884,7 +3885,7 @@ const struct symbol_computed_ops dwarf2_locexpr_funcs = { /* Return the value of SYMBOL in FRAME using the DWARF-2 expression evaluator to calculate the location. */ static struct value * -loclist_read_variable (struct symbol *symbol, frame_info_ptr frame) +loclist_read_variable (struct symbol *symbol, const frame_info_ptr &frame) { struct dwarf2_loclist_baton *dlbaton = (struct dwarf2_loclist_baton *) SYMBOL_LOCATION_BATON (symbol); @@ -3909,7 +3910,7 @@ loclist_read_variable (struct symbol *symbol, frame_info_ptr frame) if it cannot resolve the parameter for any reason. */ static struct value * -loclist_read_variable_at_entry (struct symbol *symbol, frame_info_ptr frame) +loclist_read_variable_at_entry (struct symbol *symbol, const frame_info_ptr &frame) { struct dwarf2_loclist_baton *dlbaton = (struct dwarf2_loclist_baton *) SYMBOL_LOCATION_BATON (symbol); diff --git a/gdb/dwarf2/loc.h b/gdb/dwarf2/loc.h index fb98e26..4fb7436 100644 --- a/gdb/dwarf2/loc.h +++ b/gdb/dwarf2/loc.h @@ -65,9 +65,9 @@ value *compute_var_value (const char *name); Function always returns non-NULL, it throws NO_ENTRY_VALUE_ERROR otherwise. */ -struct call_site_parameter *dwarf_expr_reg_to_entry_parameter - (frame_info_ptr frame, enum call_site_parameter_kind kind, - union call_site_parameter_u kind_u, dwarf2_per_cu_data **per_cu_return, +call_site_parameter *dwarf_expr_reg_to_entry_parameter + (const frame_info_ptr &frame, call_site_parameter_kind kind, + call_site_parameter_u kind_u, dwarf2_per_cu_data **per_cu_return, dwarf2_per_objfile **per_objfile_return); @@ -76,13 +76,11 @@ struct call_site_parameter *dwarf_expr_reg_to_entry_parameter of FRAME. AS_LVAL defines if the resulting struct value is expected to be a value or a location description. */ -struct value *dwarf2_evaluate_loc_desc (struct type *type, - frame_info_ptr frame, - const gdb_byte *data, - size_t size, - dwarf2_per_cu_data *per_cu, - dwarf2_per_objfile *per_objfile, - bool as_lval = true); +value *dwarf2_evaluate_loc_desc (type *type, const frame_info_ptr &frame, + const gdb_byte *data, size_t size, + dwarf2_per_cu_data *per_cu, + dwarf2_per_objfile *per_objfile, + bool as_lval = true); /* A chain of addresses that might be needed to resolve a dynamic property. */ @@ -121,8 +119,8 @@ struct property_addr_info bottom of the stack. */ bool dwarf2_evaluate_property (const struct dynamic_prop *prop, - frame_info_ptr frame, - const struct property_addr_info *addr_stack, + const frame_info_ptr &frame, + const property_addr_info *addr_stack, CORE_ADDR *value, gdb::array_view<CORE_ADDR> push_values = {}); @@ -296,7 +294,7 @@ extern void invalid_synthetic_pointer (); extern struct value *indirect_synthetic_pointer (sect_offset die, LONGEST byte_offset, dwarf2_per_cu_data *per_cu, - dwarf2_per_objfile *per_objfile, frame_info_ptr frame, + dwarf2_per_objfile *per_objfile, const frame_info_ptr &frame, struct type *type, bool resolve_abstract_p = false); /* Read parameter of TYPE at (callee) FRAME's function entry. KIND and KIND_U @@ -307,7 +305,7 @@ extern struct value *indirect_synthetic_pointer it cannot resolve the parameter for any reason. */ extern struct value *value_of_dwarf_reg_entry (struct type *type, - struct frame_info_ptr frame, + const frame_info_ptr &frame, enum call_site_parameter_kind kind, union call_site_parameter_u kind_u); #endif /* DWARF2LOC_H */ |