Re: [PATCH 10/13] gdb/testsuite: add .debug_loclists tests

Simon Marchi via Gdb-patches
2021-01-29T17:37:51Z

On 2021-01-29 11:58 a.m., Zoran Zaric wrote:
>
> This all depends of ones view of what is convenient and what is not.
>
> From this discussion it sounds like the DIE relationship was the main
> motivation for developing the DWARF assembler. I always though that it
> was for general convenience of writing debug information in one test.
>
> While I agree that writing DIE relationships in a raw byte format is
> daunting, so is writing a really complex DWARF expression. This will
> get even more daunting when lane masking, address spaces and large
> vector registers come into play.
>
> I have seen DWARF expression with over 15 operations and those are not
> fun to write in a byte format.

So I imagined that if the compiler supports emitting CFI that uses
complex expressions, then the assembler would support a notation for
it. So you wouldn't write bytes, but something like:

.cfi_expr OP_CONST 1, OP_CONST 2, OP_ADD

where ".cfi_expr" is a directive I made up. However, that's perhaps not
true. I see that GAS has this ".cfi_escape" directive where you
directly pass bytes, perhaps the compiler would use that. If so, then
it indeed sounds desirable to be able to write the expressions using
a higher level notation, in TCL.

Simon