From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id inQIB8KLO2GzMgAAWB0awg (envelope-from ) for ; Fri, 10 Sep 2021 12:45:54 -0400 Received: by simark.ca (Postfix, from userid 112) id 0B7141EE23; Fri, 10 Sep 2021 12:45:54 -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 1FC8F1ECEB for ; Fri, 10 Sep 2021 12:45:53 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B72E7385383B for ; Fri, 10 Sep 2021 16:45:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B72E7385383B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1631292352; bh=M8K0zItVL3M+scjNcLeSqknucxk5SDt2tYIJExzoWrY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=nU5+2bv3CFMsMltcK5C6Z3Zm8B4nTVrOvte8IYvJY6jOzp4fjxNQoAyom3+Yp0n4N 60CNEuNHp0ukF2IS9ifotzFXunONSS2D+CiZgtASw/29JpLKPYjoxmSF5GrHd3KdS7 ChfYHqc2I11iK+yV0MjUEdzu+5HdFpviiBwLawrk= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 9D10A384A8B2 for ; Fri, 10 Sep 2021 16:43:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9D10A384A8B2 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 C632321AA9 for ; Fri, 10 Sep 2021 16:43:10 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 imap1.suse-dmz.suse.de (Postfix) with ESMTPS id B1FD91365E for ; Fri, 10 Sep 2021 16:43:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id uqZaKh6LO2GxIgAAGKfGzw (envelope-from ) for ; Fri, 10 Sep 2021 16:43:10 +0000 Date: Fri, 10 Sep 2021 18:43:09 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix DUPLICATE in gdb.base/skip-solib.exp Message-ID: <20210910164307.GA15698@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, Fix DUPLICATE in gdb.base/skip-solib.exp by using with_test_prefix. Also fix indentation style and long lines, remove outdated question/answer bits, and use multi_line. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix DUPLICATE in gdb.base/skip-solib.exp --- gdb/testsuite/gdb.base/skip-solib.exp | 104 ++++++++++++++++------------------ 1 file changed, 49 insertions(+), 55 deletions(-) diff --git a/gdb/testsuite/gdb.base/skip-solib.exp b/gdb/testsuite/gdb.base/skip-solib.exp index 22c8ee06850..a66272aeffb 100644 --- a/gdb/testsuite/gdb.base/skip-solib.exp +++ b/gdb/testsuite/gdb.base/skip-solib.exp @@ -20,7 +20,8 @@ # # This only works on GNU/Linux. -if { ![isnative] || [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} { +if { ![isnative] || [is_remote host] || ![istarget *-linux*] + || [skip_shlib_tests]} { continue } @@ -39,82 +40,75 @@ set binfile_lib [standard_output_file ${libname}.so] # the main program. # -if {[gdb_compile_shlib ${srcdir}/${subdir}/${srcfile_lib} ${binfile_lib} [list debug -Wl,-soname,${libname}.so]] != ""} { +if {[gdb_compile_shlib ${srcdir}/${subdir}/${srcfile_lib} ${binfile_lib} \ + [list debug -Wl,-soname,${libname}.so]] != ""} { return -1 } -if {[gdb_compile "${srcdir}/${subdir}/${srcfile_main}" "${binfile_main}.o" object debug] != ""} { +if {[gdb_compile "${srcdir}/${subdir}/${srcfile_main}" "${binfile_main}.o" \ + object debug] != ""} { return -1 } set testobjdir [standard_output_file {}] if {[gdb_compile "${binfile_main}.o" "${binfile_main}" executable \ - [list debug "additional_flags=-L$testobjdir -l${test} \ - -Wl,-rpath=$testobjdir"]] != ""} { + [list debug "additional_flags=-L$testobjdir" \ + "additional_flags=-l${test}" \ + "additional_flags=-Wl,-rpath=$testobjdir"]] != ""} { return -1 } -clean_restart ${executable_main} - # -# At this point, if we try to skip the file ${srcfile_lib} or the function -# multiply(), we should get a prompt asking us if we want to enable the -# skip entry pending a shared library load. +# Test ignoring of a file inside a solib. # +with_test_prefix "ignoring solib file" { -gdb_test "skip file ${srcfile_lib}" \ - "File ${srcfile_lib} will be skipped when stepping." \ - "ignoring file in solib" \ - "No source file named ${srcfile_lib}.* -Ignore file pending future shared library load.*" \ - "y" + clean_restart ${executable_main} -# -# Checkinfo skip list. -# -gdb_test "info skip" \ - "Num\\s+Enb\\s+Glob\\s+File\\s+RE\\s+Function\\s* -1\\s+y\\s+n\\s+${srcfile_lib}\\s+n\\s+\\s*" \ - "info skip with pending file" + gdb_test "skip file ${srcfile_lib}" \ + "File ${srcfile_lib} will be skipped when stepping." \ + "skip file" -if ![runto_main] { fail "skip tests suppressed" } + gdb_test "info skip" \ + [multi_line \ + "Num\\s+Enb\\s+Glob\\s+File\\s+RE\\s+Function\\s*" \ + "1\\s+y\\s+n\\s+${srcfile_lib}\\s+n\\s+\\s*"] -# -# We shouldn't step into square(), since we skipped skip-solib-lib.c. -# -gdb_test "step" "" -gdb_test "bt" "#0\\s+main.*" "step after ignoring solib file." + if ![runto_main] { fail "skip tests suppressed" } + + # + # We shouldn't step into square(), since we skipped skip-solib-lib.c. + # + gdb_test "step" "" + gdb_test "bt" "#0\\s+main.*" +} # -# Now restart gdb and testing ignoring of a function inside a solib. +# Now test ignoring of a function inside a solib. # -clean_restart ${executable_main} +with_test_prefix "ignoring solib function" { + clean_restart ${executable_main} -gdb_test "skip function multiply" \ - "Function multiply will be skipped when stepping\\." \ - "ignoring function in solib" \ -"No function found named multiply..* -Ignore function pending future shared library load.*" \ - "y" + gdb_test "skip function multiply" \ + "Function multiply will be skipped when stepping\\." \ + "skip function" -if ![runto_main] { fail "skip tests suppressed" } + if ![runto_main] { fail "skip tests suppressed" } -# -# Our first step should take us into square. -# -gdb_test "step" "square.*" + # + # Our first step should take us into square. + # + gdb_test "step" "square.*" "step into other function" -# -# Now our entry should no longer be pending. -# -gdb_test "info skip" \ - "Num\\s+Enb\\s+Glob\\s+File\\s+RE\\s+Function\\s* -1\\s+y\\s+n\\s+\\s+n\\s+multiply\\s*" \ - "info skip for function multiply" + gdb_test "info skip" \ + [multi_line \ + "Num\\s+Enb\\s+Glob\\s+File\\s+RE\\s+Function\\s*" \ + "1\\s+y\\s+n\\s+\\s+n\\s+multiply\\s*"] -# -# This step shouldn't go into multiply -- we should skip it and go on to the -# last line of square. -# -gdb_test "step" "" -gdb_test "bt" "#0\\s+square.*" + # + # This step shouldn't go into multiply -- we should skip it and go on to + # the last line of square. + # + gdb_test "step" "" + gdb_test "bt" "#0\\s+square.*" +}