From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 662E83858C52 for ; Tue, 21 Mar 2023 01:18:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 662E83858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 8335F1E0D3; Mon, 20 Mar 2023 21:18:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1679361503; bh=OUvsGRnHHZJCM5V2chu01w8OPyjtLR9yqor1u1CWruM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=EMQLWqtA0ojEZj86gDnbprMtraYKrDQJvjdcv/5QZXq7/9bDUyvx0Ty081MvOflPz rwJ8rp8Ov3+u2wb8F5dRI+/KBtq1oZ601FxkXiPoPv34ZAUxr75htGoHd9e4nRgHfU EBCTvK9kESQvdl8q/YkjcFjFwpj7CfL1qtArq5dk= Message-ID: Date: Mon, 20 Mar 2023 21:18:22 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] gdb: make "maintenance info line-table" show relocated addresses again Content-Language: en-US To: Andrew Burgess , Simon Marchi via Gdb-patches Cc: Simon Marchi References: <20230320163003.32960-1-simon.marchi@efficios.com> <87y1nrcdim.fsf@redhat.com> From: Simon Marchi In-Reply-To: <87y1nrcdim.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 3/20/23 17:35, Andrew Burgess via Gdb-patches wrote: > Simon Marchi via Gdb-patches 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 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