From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 B9C813851A83 for ; Tue, 13 Sep 2022 12:17:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B9C813851A83 Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-616-IXrQlBXINESPVZOhn8wgbg-1; Tue, 13 Sep 2022 08:17:43 -0400 X-MC-Unique: IXrQlBXINESPVZOhn8wgbg-1 Received: by mail-qk1-f199.google.com with SMTP id u6-20020a05620a430600b006ce769b7150so696833qko.0 for ; Tue, 13 Sep 2022 05:17:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date; bh=J1KcJyJE+z1VMlIIAFIiboAhuPc/ZEob0FWeTXqOPkY=; b=eMAwTa9HN7OX8A6cbMHHLfgqeDYR+Ny5xigjpjLNvwdz47D2B/kH0+bK9GvKB5Ca+I AUhQlY2ZLJ1NNCp+acxo4kRthvyUjs3SiY1gJ3RYBwiQg9LzBYm5BJ0cZsAncUYtsxMy oUlF8/HZOqm1YRx1x6PFrBGvDkpqHOlh5FHfdt4OxVHLE2/fRBe3wrBFqI9FokeVloUo t1KW6M76WILW5ONwd128RfFsB7T7gEQUQbbH+ZebHMrMHqVjVsRyttp57L4z5dx5E0CC DSit5XHhlLN6q17zEWaadVr0F1Z7tImy0klxzthsJX5YxMmHLFWY7a+3cC8fSvtixX3M cqXw== X-Gm-Message-State: ACgBeo20nX8eTYgpK0GjQ4LnGEL5UnRLnm209pR1fNNBtngWX/EJyWIL 7+tkrNYLq8yR1M0i3RcKaNy6snjRbH/vO64NHGcjg3UArXTrPGHuDagH175UkpK1kpcq9kezM9g 8rejqK/VPF8xFcatg4/8EBw== X-Received: by 2002:a05:622a:19a3:b0:35b:ad2f:6f46 with SMTP id u35-20020a05622a19a300b0035bad2f6f46mr12004444qtc.7.1663071462983; Tue, 13 Sep 2022 05:17:42 -0700 (PDT) X-Google-Smtp-Source: AA6agR6UTKrCeBi/CTFItyIbwcy4X0Gy0tLGpS01pRbqtFFIf0GDA9axK2ORAy0lSL0U05Z7QDWTxw== X-Received: by 2002:a05:622a:19a3:b0:35b:ad2f:6f46 with SMTP id u35-20020a05622a19a300b0035bad2f6f46mr12004432qtc.7.1663071462743; Tue, 13 Sep 2022 05:17:42 -0700 (PDT) Received: from localhost (52.72.115.87.dyn.plus.net. [87.115.72.52]) by smtp.gmail.com with ESMTPSA id u6-20020ac858c6000000b0035a6b89412bsm9020824qta.46.2022.09.13.05.17.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 05:17:41 -0700 (PDT) From: Andrew Burgess To: Bruno Larsen , gdb-patches@sourceware.org Subject: Re: [PATCH v4 02/15] gdb/testsuite: Add a proc to test where compiler links the epilogue In-Reply-To: <20220720194441.168906-4-blarsen@redhat.com> References: <20220720194441.168906-1-blarsen@redhat.com> <20220720194441.168906-4-blarsen@redhat.com> Date: Tue, 13 Sep 2022 13:17:40 +0100 Message-ID: <87tu5bjwnv.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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 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: , X-List-Received-Date: Tue, 13 Sep 2022 12:17:46 -0000 Bruno Larsen via Gdb-patches writes: > Different compilers link the epilogue of functions to different lines. > As an example, gcc links it to the closing brace of the function, > whereas clang links it to the last statement of the function. This > difference is important for the testsuite, since the where GDB will land > after a step can be wildly different. Where possible, this dependency > should be side-stepped in the testsuite, but it isn't always possible, > so this commit adds a gdb_caching_proc that is able to detect where the > epilogue is linked, so tests can react accordingly. This looks fine to me. You can merge this once you have a patch that depends on this that is ready to merge. Thanks, Andrew > --- > gdb/testsuite/lib/gdb.exp | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index aae5cb31255..6c8eb472041 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -8862,5 +8862,37 @@ proc gdb_step_until { regexp {test_name ""} {max_steps 10} } { > } > } > > +# Check if the compiler emits epilogue information associated > +# with the closing brace or with the last statement line. > +# > +# This proc restarts GDB > +# > +# Returns True if it is associated with the closing brace, > +# False if it is the last statement > +gdb_caching_proc have_epilogue_line_info { > + > + set main { > + int > + main () > + { > + return 0; > + } > + } > + if {![gdb_simple_compile "simple_program" $main]} { > + return False > + } > + > + clean_restart $obj > + > + gdb_test_multiple "info line 6" "epilogue test" { > + -re -wrap ".*starts at address.*and ends at.*" { > + return True > + } > + -re -wrap ".*" { > + return False > + } > + } > +} > + > # Always load compatibility stuff. > load_lib future.exp > -- > 2.31.1