Add some error checking to DWARF assembler
I had written a DWARF location expression like
DW_OP_const1u
DW_OP_stack_value
... and was surprised to see that the DW_OP_stack_value didn't appear
in the "readelf" output.
The problem here is that DW_OP_const1u requires an operand, but
neither the DWARF assembler nor gas diagnosed this problem.
This patch adds some checking to Dwarf::_location to try to avoid this
in the future. The checking is done via a helper proc that also
dissects the argument list and sets an array in the caller's frame.
gdb/testsuite/ChangeLog
2021-03-31 Tom Tromey <tromey@adacore.com>
* lib/dwarf.exp (Dwarf::_get_args): New proc.
(Dwarf::_location): Use it.