From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +WzxE+GeXGSTqwYAWB0awg (envelope-from ) for ; Thu, 11 May 2023 03:53:05 -0400 Received: by simark.ca (Postfix, from userid 112) id 450261E11D; Thu, 11 May 2023 03:53:05 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=br/H3QfN; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4FD2D1E0D6 for ; Thu, 11 May 2023 03:53:04 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 198643856DE2 for ; Thu, 11 May 2023 07:53:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 198643856DE2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1683791583; bh=BBkcl1nbO/zGcEegg4Lk5ZS4fCcCjFrUu1NIvJFWqpc=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=br/H3QfNpqVGOPlpL/ZbtN8XSHQuYAJwn2m6A2kuaiflf8V9Q+Yd5wB/uFP3hK2Lb 12Mqx9q0clq/IO8rdB1CJA2QY4936F302uRXnV3QzWkdg0IJlRrESMEJJzUXIlTG6d /RkPvqoj5GMN2z/WS7lsypO7bIyRHwL2yMG2T1PY= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id ED3DF3858D33 for ; Thu, 11 May 2023 07:52:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED3DF3858D33 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-354-7saMXomQMryeWsCLJdQd8Q-1; Thu, 11 May 2023 03:52:41 -0400 X-MC-Unique: 7saMXomQMryeWsCLJdQd8Q-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-3f33f8ffa37so29753675e9.2 for ; Thu, 11 May 2023 00:52:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683791560; x=1686383560; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BBkcl1nbO/zGcEegg4Lk5ZS4fCcCjFrUu1NIvJFWqpc=; b=SyBZTCKO3KfjJdoPiMXJh19ALx5i+Lbx/5r0OVOvt6ryaLFfiIs1PL4k0UxE16dlby 5gTyl+Dw5ithxe2Y0frVbLKgY0s9z2VSYLZo2b4/xvKL9BnNpZlFIr6mcv8m9iazU3Bx zYkmGPqJDOfycxpAtToepyegO78pdVydHXNTOzRrTJwFQeZALcVVElJRfRGpaVKwyU4l dbN0tYDVGmdOKwUdqTcnovZ8+tM+kEVQcd8BidCpPt3BuboXOaafDHIOgQNsGHzrURuJ mZKK3Il/O5523YgFFg7CPPjNFcPP9jpbS6Hhfnti9Z0/bLXGhWVrdknZjCnlikaQnhq7 N24A== X-Gm-Message-State: AC+VfDz4cWKFqzMBjyuWo8l8RPOqERJxuMltX4SrxBkWVlyJI9zPbSkj WIojcE3vWIiJNa+cVxW3u9N3XRAvtHH+16mcGPADLhqm3Kt9/KKxoj45Na1hGWVWU4KWUpp3EOj 2RyuBRs4B9sEOAY0lPzLeMA== X-Received: by 2002:a1c:7917:0:b0:3f4:2bb3:a5ba with SMTP id l23-20020a1c7917000000b003f42bb3a5bamr5467124wme.3.1683791560221; Thu, 11 May 2023 00:52:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5D1RC/PKlbqdmgRsSMwC+vkGiyDH2fQqXaCc/AGyspOuiIvteO9GH4GbEZPAywb4ypf+yP5w== X-Received: by 2002:a1c:7917:0:b0:3f4:2bb3:a5ba with SMTP id l23-20020a1c7917000000b003f42bb3a5bamr5467112wme.3.1683791559837; Thu, 11 May 2023 00:52:39 -0700 (PDT) Received: from [192.168.0.45] (ip-94-112-225-44.bb.vodafone.cz. [94.112.225.44]) by smtp.gmail.com with ESMTPSA id h8-20020a1ccc08000000b003f17eaae2c9sm24994138wmb.1.2023.05.11.00.52.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 May 2023 00:52:39 -0700 (PDT) Message-ID: Date: Thu, 11 May 2023 09:52:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v3] Fix reverse stepping multiple contiguous PC ranges over the line table. To: Carl Love , 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> In-Reply-To: <956b8c3c9a7bdc3aa6f9a040619ec4778edc9c94.camel@us.ibm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Bruno Larsen via Gdb-patches Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 10/05/2023 19:16, Carl Love wrote: >>> + >>> +require supports_reverse >>> + >>> +# This test uses the gcc no-column-info command which was added in >>> gcc 7.1. >>> +require get_compiler_info "gcc-7-*" > I put the compiler check in last. When I ran it, I obviously didn't > double check gdb/testsuite/gdb.log to make sure it really worked. I > normally try to make a point of double checking the log file. I have > been burned before thinking it was OK when there were no errors visible > on the command line. The above command fails if you check the log file. >> By constructing your regex like this, you are only allowing this test >> to >> be run on gcc 7. Anything later is also not accepted. I would do >> something like (Warning, untested) >> >> require get_compiler_info "gcc" >> require !get_compiler_info "gcc-[1-6]-*" > I couldn't get require to work like that. The get_compiler_info > doesn't seem take "gcc" as an argument. > > I changed the test to: > > if {![test_compiler_info {gcc-*}] > || [test_compiler_info {gcc-[1-6]-*}]} { > return > } > > With this, I do see the correct number of passes in > gdb/testsuite/gdb.log. Yeah, this is perfectly fine IMO, since this is a more complicated use of "require". > >> Which requires gcc, but does not allow versions 1 to 6. There is >> probably a way to do it with a single require line, but I'm not the >> best >> with regexes. >> >>> + >>> +proc run_tests {msg} { >>> + global srcfile >>> + global executable >>> + >>> + runto_main >>> + set target_remote [gdb_is_target_remote] >> When probing for target remote, GDB will emit pass/fails with >> hardcoded >> names, so the current proc setup gives us some duplicated test names. >> >> I would suggest that, instead of passing a message as a parameter, >> you >> wrapped all function calls in a with_test_prefix scope, like: >> >> with_test_prefix "with-column-info" { >> run_test >> } > OK, I changed from passing in an argument and did the wrapped calls to > run_test instead. Note, this still didn't fix the duplicate test names > for turning on record. > >>> + >>> + gdb_test_no_output "record" "turn on process record" >>> + >>> + # This regression test verifies the reverse-step and reverse- >>> next commands >>> + # work properly when executing backwards thru a source line >>> containing >>> + # two function calls on the same source line, i.e. func1 (); >>> func2 (); >>> + # This test is compiled so the dwarf info not contain the line >>> table >>> + # information. >>> + >>> + # Test 1, reverse-next command >>> + # Set breakpoint at the line after the function calls. >>> + set bp_start_reverse_test [gdb_get_line_number "START REVERSE >>> TEST" \ >>> + $srcfile] >>> + gdb_breakpoint $srcfile:$bp_start_reverse_test temporary >>> + >>> + # Continue to break point for reverse-next test. >>> + # Command definition: reverse-next [count] >>> + # Run backward to the beginning of the previous line >>> executed in the >>> + # current (innermost) stack frame. If the line contains >>> function calls, >>> + # they will be “un-executed” without stopping. Starting from >>> the first >>> + # line of a function, reverse-next will take you back to the >>> caller of >>> + # that function, before the function was called, just as the >>> normal next >>> + # command would take you from the last line of a function >>> back to its >>> + # return to its caller 2 . >>> + gdb_continue_to_breakpoint \ >>> + "$msg: test1: stopped at command reverse-next test start >>> location" \ >>> + ".*$srcfile:$bp_start_reverse_test\r\n.*" >>> + >>> + # The reverse-next should step all the way back to the >>> beginning of the >>> + # line, i.e. at the beginning of the func1 call. >>> + gdb_test "reverse-next" ".*func1 \\(\\); func2 \\(\\);.*" \ >>> + "$msg: test1: reverse-next to line with two functions" >>> + >>> + # We should be stopped at the first instruction of the line. A >>> reverse-step >>> + # should step back and stop at the beginning of the previous >>> line b = 2, >>> + # i.e. not in func1 (). >>> + gdb_test "reverse-stepi" ".*b = 2;.*" \ >>> + "$msg: test1: reverse-stepi to previous line b = 2" >>> + >>> + >>> + # Setup for test 2 >>> + clean_restart $executable >>> + runto_main >>> + >>> + gdb_test_no_output "record" "turn on process record" >> This gives a duplicate test name from setting up for the first test. >> Adding "test 2:(...)" in here solves it. > I couldn't figure out how to get the above syntax to work. So I used > the with_test_prefix instead, i.e. oops, sorry, that's what I get for sending a patch review at the end of a long work day. That wasn't some arcane magic of TCL, it was just me being too lazy to type out the whole message. Sorry for the wild goose chase. > > with_test_prefix "test2" { > gdb_test_no_output "record" "turn on process record" > } > > That fixed the duplicate names. I also wrapped the first record with > "test1" for consistency. > -- Cheers, Bruno