Re: [PATCH 4/6] gdb/dwarf: when in dwarf2_cu, read addr_size from dwarf2_cu::header

Tom Tromey
2025-11-19T16:13:16Z

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> I would prefer to not reintroduce the behavior of overwriting the
Simon> section info in dwarf2_per_cu, because:

Simon> 1. I find it confusing, I like the invariant of dwarf2_per_cu::section
Simon> points to the stub, and dwarf2_cu::section points to where we
Simon> actually read the debug info from.

The "overwrite" behavior was super messy and hard to untangle, so +1 to
getting rid of that.

I was wondering if the new invariant is sufficiently documented. I
somewhat think the comments in dwarf2_per_cu should be updated to
explain it. Also while dwarf2_cu::section has a comment, I'm left
wondering about dwarf2_cu::header.

Tom