]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Add dwarf2_per_objfile member to DWARF batons
authorTom Tromey <tom@tromey.com>
Sat, 22 Feb 2020 00:47:36 +0000 (17:47 -0700)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 12 May 2020 19:24:49 +0000 (15:24 -0400)
commit93f68a2429937a2170ad1d4096deb89fa60f5a8e
tree129c2d08ec933ca893ddbbeab56c0da535221134
parent1b9f401923a87167a2c92ea7d4d94f3fb1c853d6
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.

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): Set
per_objfile member.
* dwarf2/loc.h (struct dwarf2_locexpr_baton) <per_objfile>: New
member.
(struct dwarf2_loclist_baton) <per_objfile>: New member.
gdb/dwarf2/loc.c
gdb/dwarf2/loc.h
gdb/dwarf2/read.c