aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2expr.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-09-25 16:48:47 -0600
committerTom Tromey <tom@tromey.com>2016-10-21 14:17:38 -0600
commit595d2e303c0ef1a5cd5af8868c1d41db0050eb29 (patch)
tree6c6504c480d5a8507f2f4c0013419b0c5f733a8f /gdb/dwarf2expr.h
parent718b962660007c529f4ff4c5e940119da21e05a7 (diff)
downloadgdb-595d2e303c0ef1a5cd5af8868c1d41db0050eb29.zip
gdb-595d2e303c0ef1a5cd5af8868c1d41db0050eb29.tar.gz
gdb-595d2e303c0ef1a5cd5af8868c1d41db0050eb29.tar.bz2
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.
Diffstat (limited to 'gdb/dwarf2expr.h')
-rw-r--r--gdb/dwarf2expr.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h
index 0f94f1e..4706bb3 100644
--- a/gdb/dwarf2expr.h
+++ b/gdb/dwarf2expr.h
@@ -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 *);