diff options
author | Tom Tromey <tom@tromey.com> | 2016-10-30 20:45:08 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2016-11-02 16:01:38 -0600 |
commit | 7d5697f9e27f79e1decc1215f33088cee9f7d863 (patch) | |
tree | 7ed7870c449ffcde146aaa2f559a1a72c82698ab /gdb/dwarf2expr.h | |
parent | 47acf0bd9faef8634d242e19ec3b7f784d10ba76 (diff) | |
download | binutils-gdb-7d5697f9e27f79e1decc1215f33088cee9f7d863.tar.gz |
Fix dwarf_expr_context method regressions
This fixes some regressions found in the patch to convert
dwarf_expr_context to use methods. Specifically:
* get_base_type could erroneously throw; this was rewritten to move
the size checks into the only spot needing them.
* Previously the "symbol needs frame" implementation reused th
"cfa" function for the get_frame_pc slot; this reimplements
it under the correct name.
* Not enough members were saved and restored in one implementation
of push_dwarf_reg_entry_value; this patch fixes this oversight
and also takes the opportunity to remove an extraneous structure
definition.
2016-11-02 Tom Tromey <tom@tromey.com>
* dwarf2loc.c (dwarf_evaluate_loc_desc::get_base_type): Rename
from impl_get_base_type. Rewrite.
(struct dwarf_expr_baton): Remove.
(dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value): Save and
restore more fields.
(symbol_needs_eval_context::get_frame_pc): New method.
* dwarf2expr.h (dwarf_expr_context::get_base_type): Now public,
virtual.
(dwarf_expr_context::impl_get_base_type): Remove.
* dwarf2expr.c (dwarf_expr_context::get_base_type): Remove.
Diffstat (limited to 'gdb/dwarf2expr.h')
-rw-r--r-- | gdb/dwarf2expr.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h index 3d081202dbd..883c54c3043 100644 --- a/gdb/dwarf2expr.h +++ b/gdb/dwarf2expr.h @@ -179,10 +179,9 @@ struct dwarf_expr_context /* Return the base type given by the indicated DIE. This can throw an exception if the DIE is invalid or does not represent a base - type. If can also be NULL in the special case where the - callbacks are not performing evaluation, and thus it is - meaningful to substitute a stub type of the correct size. */ - virtual struct type *impl_get_base_type (cu_offset die) + type. SIZE is non-zero if this function should verify that the + resulting type has the correct size. */ + virtual struct type *get_base_type (cu_offset die, int size) { /* Anything will do. */ return builtin_type (this->gdbarch)->builtin_int; @@ -210,7 +209,6 @@ private: 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 (); }; |