From: Simon Marchi <simark@simark.ca>
To: Andrew Burgess <aburgess@redhat.com>,
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH] gdb: make "maintenance info line-table" show relocated addresses again
Date: Mon, 20 Mar 2023 21:18:22 -0400 [thread overview]
Message-ID: <c886409e-4db8-c5b2-5b4b-ecfd5dc4b932@simark.ca> (raw)
In-Reply-To: <87y1nrcdim.fsf@redhat.com>
On 3/20/23 17:35, Andrew Burgess via Gdb-patches wrote:
> Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>
>> 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.
>>
>> For the time being, I suggest simply reverting the command to show
>> relocated addresses.
>
> This makes sense to me. When I use 'maint info line-table' it's usually
> because I want to try and match up the line table with the code being
> executed, so having the relocated addresses would be far more useful.
>
> Reviewed-By: Andrew Burgess <aburgess@redhat.com>
What would you think about showing both, like this?
(gdb) maintenance info line-table
objfile: /home/simark/build/binutils-gdb/gdb/a.out ((struct objfile *) 0x614000007240)
compunit_symtab: test.c ((struct compunit_symtab *) 0x621000123890)
symtab: /home/simark/build/binutils-gdb/gdb/test.c ((struct symtab *) 0x621000123910)
linetable: ((struct linetable *) 0x62100015fc20):
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
I think it could be useful to match the unrelocated address with what
you see in the DWARF info. If the objfile is not position-independent,
or not relocated yet, the two columns show the same values.
Simon
next prev parent reply other threads:[~2023-03-21 1:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-20 16:30 Simon Marchi
2023-03-20 21:35 ` Andrew Burgess
2023-03-21 1:18 ` Simon Marchi [this message]
2023-03-21 9:23 ` Andrew Burgess
2023-03-22 1:35 ` Simon Marchi
2023-03-22 10:26 ` [PATCH 0/1] gdb: Update doc of the "maintenance info line-table" Lancelot SIX
2023-03-22 10:26 ` [PATCH 1/1] " Lancelot SIX
2023-03-22 13:59 ` Simon Marchi
2023-03-22 16:48 ` Lancelot SIX
2023-03-22 17:20 ` [PATCH v2] " Lancelot SIX
2023-03-22 14:58 ` [PATCH 1/1] " Eli Zaretskii
2023-03-22 13:46 ` [PATCH] gdb: make "maintenance info line-table" show relocated addresses again Tom de Vries
2023-03-22 13:47 ` Simon Marchi
2023-03-22 15:17 ` [PATCH] gdb/testsuite: adjust test cases to previous "maintenance info line-table" change Simon Marchi
2023-03-22 18:01 ` Tom de Vries
2023-03-22 19:14 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c886409e-4db8-c5b2-5b4b-ecfd5dc4b932@simark.ca \
--to=simark@simark.ca \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).