mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-31 10:09:16 +08:00
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 <tom@tromey.com> * 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) <push_address, eval, fetch, fetch_address, fetch_in_stack_memory, address_type, grow_stack, push, stack_empty_p, add_piece, get_base_type, execute_stack_op, pop>: 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.
This commit is contained in:
@ -133,6 +133,12 @@ struct dwarf_expr_context
|
||||
dwarf_expr_context ();
|
||||
~dwarf_expr_context ();
|
||||
|
||||
void push_address (CORE_ADDR value, int in_stack_memory);
|
||||
void eval (const gdb_byte *addr, size_t len);
|
||||
struct value *fetch (int n);
|
||||
CORE_ADDR fetch_address (int n);
|
||||
int fetch_in_stack_memory (int n);
|
||||
|
||||
/* The stack of values, allocated with xmalloc. */
|
||||
struct dwarf_stack_value *stack;
|
||||
|
||||
@ -203,6 +209,17 @@ struct dwarf_expr_context
|
||||
two cases need to be handled separately.) */
|
||||
int num_pieces;
|
||||
struct dwarf_expr_piece *pieces;
|
||||
|
||||
private:
|
||||
|
||||
struct type *address_type () const;
|
||||
void grow_stack (size_t need);
|
||||
void push (struct value *value, int in_stack_memory);
|
||||
int stack_empty_p () const;
|
||||
void add_piece (ULONGEST size, ULONGEST offset);
|
||||
struct type *get_base_type (cu_offset die, int size);
|
||||
void execute_stack_op (const gdb_byte *op_ptr, const gdb_byte *op_end);
|
||||
void pop ();
|
||||
};
|
||||
|
||||
|
||||
@ -253,15 +270,6 @@ struct dwarf_expr_piece
|
||||
ULONGEST offset;
|
||||
};
|
||||
|
||||
void dwarf_expr_push_address (struct dwarf_expr_context *ctx,
|
||||
CORE_ADDR value,
|
||||
int in_stack_memory);
|
||||
void dwarf_expr_eval (struct dwarf_expr_context *ctx, const gdb_byte *addr,
|
||||
size_t len);
|
||||
struct value *dwarf_expr_fetch (struct dwarf_expr_context *ctx, int n);
|
||||
CORE_ADDR dwarf_expr_fetch_address (struct dwarf_expr_context *ctx, int n);
|
||||
int dwarf_expr_fetch_in_stack_memory (struct dwarf_expr_context *ctx, int n);
|
||||
|
||||
void dwarf_expr_require_composition (const gdb_byte *, const gdb_byte *,
|
||||
const char *);
|
||||
|
||||
|
Reference in New Issue
Block a user