gdb: make "maintenance info line-table" show relocated addresses again
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 16 Mar 2023 20:30:34 +0000 (16:30 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Wed, 22 Mar 2023 01:33:00 +0000 (21:33 -0400)
commit904d9b02a185c9048cf17bf7295b89d7380cea3d
treec0f727efb0fbb3e54d111dd20b62abc7323921f0
parentbcefc6be9754d45fb9391993e6daaf01a68d9bd5
gdb: make "maintenance info line-table" show relocated addresses again

Commit 1acc9dca423f ("Change linetables to be objfile-independent")
changed "maintenance info line-table" to print unrelocated addresses
instead of relocated.  This breaks a few tests on systems where that
matters.  The ones I see are:

    Running /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.base/consecutive.exp ...
    FAIL: gdb.base/consecutive.exp: stopped at bp, 2nd instr (missing hex prefix)
    Running /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.base/async.exp ...
    FAIL: gdb.base/async.exp: stepi&
    FAIL: gdb.base/async.exp: nexti&
    FAIL: gdb.base/async.exp: finish&

These tests run "maintenance info line-table" to record the address of
some lines, and then use these addresses in expected patterns.  It
therefore expects these addresses to match the runtime addresses,
therefore the relocated addresses.

Add back the relocated addresses, next to the unrelocated addresses,
like so:

    INDEX  LINE   REL-ADDRESS        UNREL-ADDRESS      IS-STMT PROLOGUE-END
    0      6      0x0000555555555119 0x0000000000001119 Y
    1      7      0x000055555555511d 0x000000000000111d Y
    2      8      0x0000555555555123 0x0000000000001123 Y
    3      END    0x0000555555555125 0x0000000000001125 Y

The unrelocated addresses can always be useful trying to map this
information with a DWARF info dump.

Adjust the is_stmt_addresses proc in the testsuite to match the new
output.

Change-Id: I59558f167e13e63421c9e0f2cad192e7c95c10cf
gdb/symmisc.c
gdb/testsuite/lib/gdb.exp