From patchwork Tue Nov 15 10:42:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 60631 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4F0833894C37 for ; Tue, 15 Nov 2022 10:43:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F0833894C37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668508987; bh=MmUjnN8fOeBVqZLVLDNXuvGF7hR4kERrlNRPyaHhHMU=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=H/BIKMoHaiziaEYJrIvE+N3FTivcKflzYdBTyc5WiwvO35ko+U77A/1E3JC+RJSHZ q7iVoLnbzh34xnhuCE8K1M9n+pMsUFqCf5tQVpMZJ2eu9v6QOLhCPmxS0Rae0pGA6x dZt1xKNsmu3CXFMUvJWTD0DWQOtkItw/2ykC/8lg= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 9F9C8388B69A for ; Tue, 15 Nov 2022 10:42:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9F9C8388B69A Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-460-2HQmotmoMMuLGorRGQY53A-1; Tue, 15 Nov 2022 05:42:38 -0500 X-MC-Unique: 2HQmotmoMMuLGorRGQY53A-1 Received: by mail-qt1-f200.google.com with SMTP id i13-20020ac8764d000000b003a4ec8693dcso10030816qtr.14 for ; Tue, 15 Nov 2022 02:42:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sYQ/UuGidAfaJDyyctPFORNP+qAa4MdSzmbRGael7r0=; b=Rjv8FZFq1AvWYtCPwoZVlmvAENjYYnoE5U8Sav1n35nfQmKoKUBQvrnwegQ7QLT/T9 Ju/5uf3xYltWtVKVLS1ipKCGsiypD3tUUTZeXZUBSsi8F3/Y4CwE+hns3wWqcVuPrP7B XNVWcc/Nyt/7CeLPl5fr1llTyjTMuZiXb6zaFsYDbtygmqrOL2nn+6JfShy5QN9P5UNJ 1N70IzacSvbGczRSnsAizbCjUq7d8XBlj93s67H0yS8cdwe2iqe4RCUGWzTcj5lxkDDe oyQBSy5r8VwWPdfqCu2oVNh/BUUoNyE7/bg+aUe6phGwFnWxZL4ojIdL3tZFx6U5z6qa BbdA== X-Gm-Message-State: ANoB5pmza++tRR+YFHlpOukGh8/fae6NkEUQO7qcbNlb58fonpR8gNFP dRoRU2OhZrJODj1Hc4fcRbtuUiaZ3NGRueh+pSOeSOm2xB0cyAHcd0eI5w1Ipv4LKc26hW47AQY otLZcEUVso/iDVBrQKOKokm1nRKTDoTXRczNOHmYaWKx0Mc0hjgR4KT6y4wQvAD/hrnHiBIKs0g == X-Received: by 2002:a37:e204:0:b0:6fa:2050:ea8e with SMTP id g4-20020a37e204000000b006fa2050ea8emr14662011qki.608.1668508957598; Tue, 15 Nov 2022 02:42:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf4jY8mfUmM1NsJWiQbD7OsR8ndm7OfutG4yr7UmzY7LEBuhDrffrdFQRb9IZkm8Bx5X1zlGCw== X-Received: by 2002:a37:e204:0:b0:6fa:2050:ea8e with SMTP id g4-20020a37e204000000b006fa2050ea8emr14661996qki.608.1668508957171; Tue, 15 Nov 2022 02:42:37 -0800 (PST) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id i20-20020ac85e54000000b0039ccbf75f92sm7061258qtx.11.2022.11.15.02.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 02:42:36 -0800 (PST) To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 01/14] gdb/testsuite: remove DOS line endings from a test script Date: Tue, 15 Nov 2022 10:42:18 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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 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-Patchwork-Original-From: Andrew Burgess via Gdb-patches From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" The gdb.fortran/nested-funcs.exp test script has DOS line endings. I can see no reason why this script needs DOS line endings. Convert to UNIX line endings. There should be no change in what is tested after this commit. --- gdb/testsuite/gdb.fortran/nested-funcs.exp | 184 ++++++++++----------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/gdb/testsuite/gdb.fortran/nested-funcs.exp b/gdb/testsuite/gdb.fortran/nested-funcs.exp index d5ba7ce3c5e..ea3d66685be 100755 --- a/gdb/testsuite/gdb.fortran/nested-funcs.exp +++ b/gdb/testsuite/gdb.fortran/nested-funcs.exp @@ -1,92 +1,92 @@ -# Copyright 2016-2022 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# This testcase is supposed to test DWARF static link which is usually -# used together with nested functions. - -if { [skip_fortran_tests] } { return -1 } - -standard_testfile .f90 -load_lib "fortran.exp" - -if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} { - return -1 -} - -if ![fortran_runto_main] then { - perror "couldn't run to main" - continue -} - -# Test if we can set a breakpoint in a nested function -gdb_breakpoint "testnestedfuncs::sub_nested_outer" -gdb_continue_to_breakpoint "testnestedfuncs::sub_nested_outer" \ - ".*local_int = 19" - -# Test if we can access local and -# non-local variables defined one level up. -gdb_breakpoint [gdb_get_line_number "! BP_outer"] -gdb_continue_to_breakpoint "! BP_outer" ".*! BP_outer" -gdb_test "print index" "= 13" "print index at BP_outer" -gdb_test_no_output "set variable index = 42" -gdb_test "print index" "= 42" "print index at BP_outer, manipulated" -gdb_test "print local_int" "= 19" "print local_int in outer function" - -# Non-local variable should be affected in one frame up as well. -gdb_test "up" -gdb_test "print index" "= 42" "print index at BP1, one frame up" - -# Test if we can set a breakpoint in a nested function -gdb_breakpoint "testnestedfuncs::sub_nested_inner" -gdb_continue_to_breakpoint "testnestedfuncs::sub_nested_inner" \ - ".*local_int = 17" - -# Test if we can access local and -# non-local variables defined two level up. -gdb_breakpoint [gdb_get_line_number "! BP_inner"] -gdb_continue_to_breakpoint "! BP_inner" ".*! BP_inner" -gdb_test "print index" "= 42" "print index at BP_inner" -gdb_test "print v_state%code" "= 61" "print v_state%code at BP_inner" -gdb_test "print local_int" "= 17" "print local_int in inner function" - -# Test if local variable is still correct. -gdb_breakpoint [gdb_get_line_number "! BP_outer_2"] -gdb_continue_to_breakpoint "! BP_outer_2" ".*! BP_outer_2" -gdb_test "print local_int" "= 19" \ - "print local_int in outer function, after sub_nested_inner" - -# Test if we can set a breakpoint in public routine with the same name -# as the internal -gdb_breakpoint "sub_nested_outer" -gdb_continue_to_breakpoint "sub_nested_outer" \ - ".*name = 'sub_nested_outer external'" - -# Test if we can set a breakpoint in public routine with the same name -# as the internal -gdb_breakpoint "sub_with_sub_nested_outer::sub_nested_outer" -gdb_continue_to_breakpoint \ - "sub_with_sub_nested_outer::sub_nested_outer" ".*local_int = 11" - -# Test if we can set a breakpoint in public routine with the same name -# as the internal -gdb_breakpoint "mod1::sub_nested_outer" -gdb_continue_to_breakpoint "mod1::sub_nested_outer" \ - ".*name = 'sub_nested_outer_mod1'" - -# Sanity check in main. -gdb_breakpoint [gdb_get_line_number "! BP_main"] -gdb_continue_to_breakpoint "! BP_main" ".*! BP_main" -gdb_test "print index" "= 42" "print index at BP_main" -gdb_test "print v_state%code" "= 59" "print v_state%code at BP_main" +# Copyright 2016-2022 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This testcase is supposed to test DWARF static link which is usually +# used together with nested functions. + +if { [skip_fortran_tests] } { return -1 } + +standard_testfile .f90 +load_lib "fortran.exp" + +if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} { + return -1 +} + +if ![fortran_runto_main] then { + perror "couldn't run to main" + continue +} + +# Test if we can set a breakpoint in a nested function +gdb_breakpoint "testnestedfuncs::sub_nested_outer" +gdb_continue_to_breakpoint "testnestedfuncs::sub_nested_outer" \ + ".*local_int = 19" + +# Test if we can access local and +# non-local variables defined one level up. +gdb_breakpoint [gdb_get_line_number "! BP_outer"] +gdb_continue_to_breakpoint "! BP_outer" ".*! BP_outer" +gdb_test "print index" "= 13" "print index at BP_outer" +gdb_test_no_output "set variable index = 42" +gdb_test "print index" "= 42" "print index at BP_outer, manipulated" +gdb_test "print local_int" "= 19" "print local_int in outer function" + +# Non-local variable should be affected in one frame up as well. +gdb_test "up" +gdb_test "print index" "= 42" "print index at BP1, one frame up" + +# Test if we can set a breakpoint in a nested function +gdb_breakpoint "testnestedfuncs::sub_nested_inner" +gdb_continue_to_breakpoint "testnestedfuncs::sub_nested_inner" \ + ".*local_int = 17" + +# Test if we can access local and +# non-local variables defined two level up. +gdb_breakpoint [gdb_get_line_number "! BP_inner"] +gdb_continue_to_breakpoint "! BP_inner" ".*! BP_inner" +gdb_test "print index" "= 42" "print index at BP_inner" +gdb_test "print v_state%code" "= 61" "print v_state%code at BP_inner" +gdb_test "print local_int" "= 17" "print local_int in inner function" + +# Test if local variable is still correct. +gdb_breakpoint [gdb_get_line_number "! BP_outer_2"] +gdb_continue_to_breakpoint "! BP_outer_2" ".*! BP_outer_2" +gdb_test "print local_int" "= 19" \ + "print local_int in outer function, after sub_nested_inner" + +# Test if we can set a breakpoint in public routine with the same name +# as the internal +gdb_breakpoint "sub_nested_outer" +gdb_continue_to_breakpoint "sub_nested_outer" \ + ".*name = 'sub_nested_outer external'" + +# Test if we can set a breakpoint in public routine with the same name +# as the internal +gdb_breakpoint "sub_with_sub_nested_outer::sub_nested_outer" +gdb_continue_to_breakpoint \ + "sub_with_sub_nested_outer::sub_nested_outer" ".*local_int = 11" + +# Test if we can set a breakpoint in public routine with the same name +# as the internal +gdb_breakpoint "mod1::sub_nested_outer" +gdb_continue_to_breakpoint "mod1::sub_nested_outer" \ + ".*name = 'sub_nested_outer_mod1'" + +# Sanity check in main. +gdb_breakpoint [gdb_get_line_number "! BP_main"] +gdb_continue_to_breakpoint "! BP_main" ".*! BP_main" +gdb_test "print index" "= 42" "print index at BP_main" +gdb_test "print v_state%code" "= 59" "print v_state%code at BP_main"