[gdb/testsuite] Add pseudo line number program instruction: line
There's an idiom in dwarf assembly test-cases:
...
set line1 [gdb_get_line_number "line 1"]
set line2 [gdb_get_line_number "line 2"]
set line3 [gdb_get_line_number "line 3"]
...
{DW_LNS_advance_line [expr $line1 - 1]}
...
{DW_LNS_advance_line [expr $line2 - $line1]}
...
{DW_LNS_advance_line [expr $line3 - $line2]}
...
Add a pseudo line number program instruction "line", such that we can simply
write:
...
{line $line1}
...
{line $line2}
...
{line $line3}
...
Build and reg-tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2020-07-16 Tom de Vries <tdevries@suse.de>
* lib/dwarf.exp (program): Initialize _line.
(DW_LNE_end_sequence): Reinitialize _line.
(DW_LNS_advance_line): Update _line.
(line): New proc.
* gdb.dwarf2/dw2-inline-many-frames.exp: Use line.
* gdb.dwarf2/dw2-inline-small-func.exp: Same.
* gdb.dwarf2/dw2-inline-stepping.exp: Same.
* gdb.dwarf2/dw2-is-stmt-2.exp: Same.
* gdb.dwarf2/dw2-is-stmt.exp: Same.
* gdb.dwarf2/dw2-ranges-func.exp: Same.