From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id a6s6A5hRZGFBLwAAWB0awg (envelope-from ) for ; Mon, 11 Oct 2021 11:00:40 -0400 Received: by simark.ca (Postfix, from userid 112) id EF14B1F0B9; Mon, 11 Oct 2021 11:00:39 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 DD80E1E813 for ; Mon, 11 Oct 2021 11:00:38 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 12E14385800A for ; Mon, 11 Oct 2021 15:00:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 12E14385800A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633964438; bh=vt6j4m8vnNfq47dgzv204KTz1KAkzF57j9gFewhMeNw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=gVfucPjJsBYW//D1e/ULyaXgVhFEamBnOMKpHVm0xahtKhlNZWaMKWv/LpyprtS1E Bs6k1En2FjYfYzDfaS5As0pwynH+nVlVy6eXHkfpC6SvXlZfXwZWECNKMgZVhTtYiF 32ZiEI+c43nOQMXKqYia5Nfacv2bIoGQvi9ogPNo= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 58E933858D28 for ; Mon, 11 Oct 2021 15:00:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 58E933858D28 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8441D22002 for ; Mon, 11 Oct 2021 15:00:16 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 706E613C72 for ; Mon, 11 Oct 2021 15:00:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id REJrGoBRZGE1RAAAMHmgww (envelope-from ) for ; Mon, 11 Oct 2021 15:00:16 +0000 Date: Mon, 11 Oct 2021 17:00:15 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix FAIL in gdb.mi/mi-var-child-f.exp Message-ID: <20211011150013.GA13792@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, When running test-case gdb.mi/mi-var-child-f.exp on openSUSE Tumbleweed (with glibc 2.34) I run into: ... (gdb) ^M PASS: gdb.mi/mi-var-child-f.exp: mi runto prog_array Expecting: ^(-var-create array \* array[^M ]+)?(\^done,name="array",numchild="[0-9]+",value=".*",type=.*,has_more="0"[^M ]+[(]gdb[)] ^M [ ]*) -var-create array * array^M &"Attempt to use a type name as an expression.\n"^M ^error,msg="-var-create: unable to create variable object"^M (gdb) ^M FAIL: gdb.mi/mi-var-child-f.exp: create local variable array (unexpected output) ... The problem is that the name array is used both: - as the name for a local variable - as the name of a type in glibc, in file malloc/dynarray-skeleton.c, as included by nss/nss_files/files-hosts.c. Fix this by ignoring the shared lib symbols. Likewise in a couple of other fortran tests. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix FAIL in gdb.mi/mi-var-child-f.exp --- gdb/testsuite/gdb.fortran/allocated.exp | 6 ++++++ gdb/testsuite/gdb.fortran/array-slices-bad.exp | 6 ++++++ gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp | 6 ++++++ gdb/testsuite/gdb.fortran/array-slices.exp | 6 ++++++ gdb/testsuite/gdb.fortran/lbound-ubound.exp | 5 +++++ gdb/testsuite/gdb.fortran/subarray.exp | 6 ++++++ gdb/testsuite/gdb.mi/mi-var-child-f.exp | 6 ++++++ 7 files changed, 41 insertions(+) diff --git a/gdb/testsuite/gdb.fortran/allocated.exp b/gdb/testsuite/gdb.fortran/allocated.exp index d9308af17b5..9f192d66e1b 100644 --- a/gdb/testsuite/gdb.fortran/allocated.exp +++ b/gdb/testsuite/gdb.fortran/allocated.exp @@ -25,10 +25,16 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ return -1 } +# Avoid shared lib symbols. +gdb_test_no_output "set auto-solib-add off" + if ![fortran_runto_main] { return -1 } +# Avoid libc symbols, in particular the 'array' type. +gdb_test_no_output "nosharedlibrary" + # Set all the breakpoints. for { set i 1 } { $i < 6 } { incr i } { gdb_breakpoint [gdb_get_line_number "Breakpoint $i"] diff --git a/gdb/testsuite/gdb.fortran/array-slices-bad.exp b/gdb/testsuite/gdb.fortran/array-slices-bad.exp index a68903498d6..c8bea995247 100644 --- a/gdb/testsuite/gdb.fortran/array-slices-bad.exp +++ b/gdb/testsuite/gdb.fortran/array-slices-bad.exp @@ -25,10 +25,16 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ return -1 } +# Avoid shared lib symbols. +gdb_test_no_output "set auto-solib-add off" + if ![fortran_runto_main] { return -1 } +# Avoid libc symbols, in particular the 'array' type. +gdb_test_no_output "nosharedlibrary" + # gdb_breakpoint [gdb_get_line_number "Display Message Breakpoint"] gdb_breakpoint [gdb_get_line_number "First Breakpoint"] gdb_breakpoint [gdb_get_line_number "Second Breakpoint"] diff --git a/gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp b/gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp index 4264cec7a9d..c8e5232da4e 100644 --- a/gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp +++ b/gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp @@ -25,10 +25,16 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ return -1 } +# Avoid shared lib symbols. +gdb_test_no_output "set auto-solib-add off" + if ![fortran_runto_main] { return -1 } +# Avoid libc symbols, in particular the 'array' type. +gdb_test_no_output "nosharedlibrary" + # gdb_breakpoint [gdb_get_line_number "Display Message Breakpoint"] gdb_breakpoint [gdb_get_line_number "Stop Here"] gdb_breakpoint [gdb_get_line_number "Final Breakpoint"] diff --git a/gdb/testsuite/gdb.fortran/array-slices.exp b/gdb/testsuite/gdb.fortran/array-slices.exp index 5b01e4f5e04..2c92d606e56 100644 --- a/gdb/testsuite/gdb.fortran/array-slices.exp +++ b/gdb/testsuite/gdb.fortran/array-slices.exp @@ -55,10 +55,16 @@ proc run_test { repack } { clean_restart ${binfile} + # Avoid shared lib symbols. + gdb_test_no_output "set auto-solib-add off" + if ![fortran_runto_main] { return -1 } + # Avoid libc symbols, in particular the 'array' type. + gdb_test_no_output "nosharedlibrary" + gdb_test_no_output "set fortran repack-array-slices $repack" # gdb_breakpoint [gdb_get_line_number "Display Message Breakpoint"] diff --git a/gdb/testsuite/gdb.fortran/lbound-ubound.exp b/gdb/testsuite/gdb.fortran/lbound-ubound.exp index 489c9ad24ce..3a65f7fa8ca 100644 --- a/gdb/testsuite/gdb.fortran/lbound-ubound.exp +++ b/gdb/testsuite/gdb.fortran/lbound-ubound.exp @@ -25,11 +25,16 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ return -1 } +# Avoid shared lib symbols. +gdb_test_no_output "set auto-solib-add off" if ![fortran_runto_main] { return -1 } +# Avoid libc symbols, in particular the 'array' type. +gdb_test_no_output "nosharedlibrary" + gdb_breakpoint [gdb_get_line_number "Test Breakpoint"] gdb_breakpoint [gdb_get_line_number "Final Breakpoint"] diff --git a/gdb/testsuite/gdb.fortran/subarray.exp b/gdb/testsuite/gdb.fortran/subarray.exp index d41443a88b0..722ac52bdf3 100644 --- a/gdb/testsuite/gdb.fortran/subarray.exp +++ b/gdb/testsuite/gdb.fortran/subarray.exp @@ -27,11 +27,17 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} { return -1 } +# Avoid shared lib symbols. +gdb_test_no_output "set auto-solib-add off" + if ![fortran_runto_main] then { perror "couldn't run to main" continue } +# Avoid libc symbols, in particular the 'array' type. +gdb_test_no_output "nosharedlibrary" + # Try to set breakpoint at the last write statement. set bp_location [gdb_get_line_number "str(:)"] diff --git a/gdb/testsuite/gdb.mi/mi-var-child-f.exp b/gdb/testsuite/gdb.mi/mi-var-child-f.exp index f35c0cdd6d3..a1aa1acb720 100644 --- a/gdb/testsuite/gdb.mi/mi-var-child-f.exp +++ b/gdb/testsuite/gdb.mi/mi-var-child-f.exp @@ -36,8 +36,14 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} +# Avoid shared lib symbols. +mi_gdb_test "-gdb-set auto-solib-add off" "\\^done" + mi_runto prog_array +# Avoid libc symbols, in particular the 'array' type. +mi_gdb_test "nosharedlibrary" ".*\\^done" + mi_create_varobj "array" "array" "create local variable array"