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 E21A03858C2F for ; Fri, 23 Jun 2023 17:44:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E21A03858C2F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1687542272; bh=emcwVs9yeMGEpXOZ1XfQGgANoKcinTSbxHvpg3tT8fQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SDFbaDHZWJFRFexgMuDhDh3c8cYdPbrQ4GbfkmIOaRNaqUSlOSJPgX0k3aO6NpZhS 9lhk5/WXA4G/1Anf1yaDORxuB27UibQ0jcslmcyKFTH2HK1smyGfmB76+WtmtM5ED6 MqX/q4MQLi+7018vz1DFKu+lh04rrk3w9cLlBImY= Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (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 8DCAB1E0AC; Fri, 23 Jun 2023 13:44:32 -0400 (EDT) Message-ID: <4ab1e3ff-eede-5573-f58f-63ff8b1e23bb@simark.ca> Date: Fri, 23 Jun 2023 13:44:32 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 1/2] Fix reverse stepping multiple contiguous PC ranges over the line table. Content-Language: en-US To: Carl Love , Bruno Larsen , gdb-patches@sourceware.org, UlrichWeigand , pedro@palves.net Cc: luis.machado@arm.com References: <74630f1ccb6e9258ae60682105ee5490726fb255.camel@us.ibm.com> <46d73c69-9168-44c6-b515-23dd893fc0eb@redhat.com> <86c65f2ad74caffc162f100e4e9c5be9062a7f59.camel@us.ibm.com> <0a2c4ebd-f01d-4b96-1b13-25d7276056a5@redhat.com> <956b8c3c9a7bdc3aa6f9a040619ec4778edc9c94.camel@us.ibm.com> <89b2fb027024f7e97de7196ee091a0ca11c0c2b3.camel@us.ibm.com> <0943e12c-049d-f8b0-c4c5-8816b1be1e45@simark.ca> <961a88a7-a820-fd32-c7ee-e707697e22a5@simark.ca> <60ba16fb9207f7e6313265aa0a118f65787b52f7.camel@us.ibm.com> <95df539fed378baea3dd679bb10d33c57260f318.camel@us.ibm.com> From: Simon Marchi In-Reply-To: <95df539fed378baea3dd679bb10d33c57260f318.camel@us.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 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,T_SCC_BODY_TEXT_LINE 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 6/22/23 12:52, Carl Love wrote: > > Simon: > > On Mon, 2023-06-19 at 13:11 -0400, Simon Marchi wrote: >>> --- a/gdb/testsuite/lib/gdb.exp >>> +++ b/gdb/testsuite/lib/gdb.exp >>> @@ -4794,6 +4794,8 @@ proc quote_for_host { args } { >>> # debug information >>> # - text_segment=addr: Tell the linker to place the text >>> segment at ADDR. >>> # - build-id: Ensure the final binary includes a build-id. >>> +# - no-column-info: Disable generation of column table >>> information. >>> +# - column-info: Enable generation of column table information. >>> # >>> # And here are some of the not too obscure options understood by >>> DejaGnu that >>> # influence the compilation: >>> @@ -5003,6 +5005,34 @@ proc gdb_compile {source dest type options} >>> { >>> } else { >>> error "Don't know how to handle text_segment >>> option." >>> } >>> + } elseif { $opt == "column-info" } { >>> + if {[test_compiler_info {gcc-*}]} { >>> + if {[test_compiler_info {gcc-[1-6]-*}]} { >>> + error "gdb_compile option no-column-info not >>> supported." >> >> I think this path should return the equivalent of "failed to >> compile", >> instead of throwing an error. Control will go back to the test, >> which >> will generally skip the portion of the test that requires that >> binary. > > Not entirely sure how to accomplish what you are looking for. > > I change: > error "gdb_compile option no-column-info not supported." > to > set result "option no-column-info not supported." > clone_output "gdb compile failed, $result" > return 1 > > When I force the if {[test_compiler_info...]} tp be true to test this, > I get: > > get_compiler_info: gcc-12-2-1 > gdb compile failed, option no-column-info not supported. > UNTESTED: gdb.reverse/func-map-to-same-line.exp: > with_column_info=yes: failed t\ > o prepare > testcase /home/carll/GDB/build-reverse-multiple- > contiguous/gdb/testsuite/../../\ > ../binutils-gdb-reverse-multiple- > contiguous/gdb/testsuite/gdb.reverse/func-map-\ > to-same-line.exp completed in 0 seconds > > === gdb Summary === > > # of untested testcases 1 > > The test case doesn't have any part of the test that doesn't require > compiling so it is not clear if that would work with this fix. Anyway, > wanted to run that by you to see if this is an appropriate fix? I am > really not sure about it. Thanks. I think that's the expected behavior. The UNTESTED is emitted by build_executable_from_specs, I think. If the test used gdb_compile, I think we wouldn't see an UNTESTED. But as far as your addition is concerned, I think it's fine. I just thought of a simpler alternative though. Just remove the version check. If we build with an older gcc, there will simply be a message that says that the flag is not recognized, and the result should be just the same. I just hacked it locally and changed the flag name to be wrong (I don't have a gcc <= 6 on hand to test). It looks like: Executing on host: gcc -fno-stack-protector -fdiagnostics-color=never -gcolumn-info-foo -c -g -o /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.reverse/func-map-to-same-line/func-map-to-same-line0.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.reverse/func-map-to-same-line.c (timeout = 300) builtin_spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -gcolumn-info-foo -c -g -o /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.reverse/func-map-to-same-line/func-map-to-same-line0.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.reverse/func-map-to-same-line.c gcc: error: unrecognized debug output level 'column-info-foo' compiler exited with status 1 output is: gcc: error: unrecognized debug output level 'column-info-foo' gdb compile failed, gcc: error: unrecognized debug output level 'column-info-foo' UNTESTED: gdb.reverse/func-map-to-same-line.exp: with_column_info=yes: failed to prepare I then thought about the "no-column-info" case. Currently, you error out for gccs <= 6. However, shouldn't we just compile without any special flag in that case, since there just wasn't any support for column-info back then? Simon