Re: [PATCH v2 23/42] Add dwarf2_per_objfile to dwarf_expr_context and dwarf2_frame_cache

Tom Tromey
2020-05-22T21:04:53Z

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> *Note*, there's one spot I'm particularly unsure about. In
Simon> dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value, we would save and
Simon> overwrite the offset value in the context, along with a bunch of other
Simon> state. This is because we might be about to evaluate something in a
Simon> different CU that the current one. If the two CUs are in the same
Simon> objfile, then the text_offset is the same, as it's a property of the
Simon> objfile. However, if the two CUs are possibly in different objfiles,
Simon> then it means the text_offsets are different. It would also mean we
Simon> would need to save and restore the dwarf2_per_objfile in the context.
Simon> Is that even possible?

Unfortunately I don't know for sure.
However, call_site_for_pc doesn't distinguish between objfiles. So, I
suppose I would assume it is possible.

Tom