diff options
author | Tom Tromey <tom@tromey.com> | 2020-05-27 11:13:50 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-27 11:13:50 -0400 |
commit | a50264baf57716993e701096fa6e466fb63e0301 (patch) | |
tree | e776c6ce6b5000d5bfaf252dbe4e817f28bdca91 /gdb/dwarf2/loc.h | |
parent | d3473f0c4b8e8d791ed87b1919a666bc368497dc (diff) | |
download | gdb-a50264baf57716993e701096fa6e466fb63e0301.zip gdb-a50264baf57716993e701096fa6e466fb63e0301.tar.gz gdb-a50264baf57716993e701096fa6e466fb63e0301.tar.bz2 |
Add dwarf2_per_objfile member to DWARF batons
Various DWARF callbacks expect to be able to fetch the objfile and / or
dwarf2_per_objfile from the DWARF CU object. However, this won't be
possible once sharing is implemented.
Because these objects are related to full symbols (e.g., they are used
to implement location expressions), they can simply store the
dwarf2_per_objfile they need.
This patch adds a per_objfile member to the various "baton" structures
and arranges to set this value when constructing the baton.
gdb/ChangeLog:
YYYY-MM-DD Tom Tromey <tom@tromey.com>
YYYY-MM-DD Simon Marchi <simon.marchi@efficios.com>
* dwarf2/loc.c (struct piece_closure) <per_objfile>: New member.
(allocate_piece_closure): Set "per_objfile" member.
(dwarf2_find_location_expression, dwarf2_locexpr_baton_eval)
(locexpr_describe_location, loclist_describe_location): Use new
member.
* dwarf2/read.c (read_call_site_scope)
(mark_common_block_symbol_computed, attr_to_dynamic_prop)
(dwarf2_const_value_attr, dwarf2_fetch_die_loc_sect_off)
(fill_in_loclist_baton, dwarf2_symbol_mark_computed,
handle_data_member_location): Set per_objfile member.
* dwarf2/loc.h (struct dwarf2_locexpr_baton) <per_objfile>: New
member.
(struct dwarf2_loclist_baton) <per_objfile>: New member.
Change-Id: If3aaa6a0f544be86710157c3adb68fde24d80037
Diffstat (limited to 'gdb/dwarf2/loc.h')
-rw-r--r-- | gdb/dwarf2/loc.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/dwarf2/loc.h b/gdb/dwarf2/loc.h index 9815368..51f242e 100644 --- a/gdb/dwarf2/loc.h +++ b/gdb/dwarf2/loc.h @@ -23,7 +23,7 @@ #include "dwarf2/expr.h" struct symbol_computed_ops; -struct objfile; +struct dwarf2_per_objfile; struct dwarf2_per_cu_data; struct dwarf2_loclist_baton; struct agent_expr; @@ -146,6 +146,9 @@ struct dwarf2_locexpr_baton directly. */ bool is_reference; + /* The objfile that was used when creating this. */ + dwarf2_per_objfile *per_objfile; + /* The compilation unit containing the symbol whose location we're computing. */ struct dwarf2_per_cu_data *per_cu; @@ -163,6 +166,9 @@ struct dwarf2_loclist_baton /* Length of the location list. */ size_t size; + /* The objfile that was used when creating this. */ + dwarf2_per_objfile *per_objfile; + /* The compilation unit containing the symbol whose location we're computing. */ struct dwarf2_per_cu_data *per_cu; |