Re: [PATCH 09/13] gdb/testsuite: DWARF assembler: add context parameters to _location

Zoran Zaric via Gdb-patches
2021-01-28T16:30:35Z

> From: Simon Marchi <simon.marchi@efficios.com>
>
> The _location proc is used to assemble a location description. It needs
> to know some contextual information:
>
> - size of an address
> - size of an offset (into another DWARF section)
> - DWARF version
>
> It currently get all this directly from global variables holding the
> compilation unit information. This is fine because as of now, all
> location descriptions are generated in the context of creating a
> compilation unit. However, a subsequent patch will generate location
> descriptions while generating a .debug_loclists section. _location
> should therefore no longer rely on the current compilation unit's
> properties.
>
> Change it to accept these values as parameters instead of accessing the
> values for the CU.
>
> No functional changes intended.
>

Agreed.

This seems like a necessary step for the new conditions that the DWARF 5
standard introduces.

Zoran