From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 21FD63858D20 for ; Mon, 12 Jun 2023 11:00:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 21FD63858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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-out2.suse.de (Postfix) with ESMTPS id 585492019C for ; Mon, 12 Jun 2023 11:00:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686567609; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=EZTlqsRwezp9XjIAuvKGQdRg4qCxz/2aVtQkFoJP7Ww=; b=r1BuaVzucsFWSGva6l6sH/1X95w6eHjL/BFa4sY2SVEFtevudECxLkMYxNoDWr7CV+wzHZ sP6PTHYT+CyHnQxuYiFCZoChkPnI5akSVfgoIYjPHBU8vHmDN1809y/g1rfssx1D3jgd01 v9HKuHVzj2TYosooINo2yyU5hbDgLn0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686567609; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=EZTlqsRwezp9XjIAuvKGQdRg4qCxz/2aVtQkFoJP7Ww=; b=6+t9odrU5q3G8Ve0r5zReznpkP8pOURPApmtJBILAodNSP5lfAQHt3TF16wv7G8GGvcVEr v4dbx605ZmClW+Aw== 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 3722D138EC for ; Mon, 12 Jun 2023 11:00:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1YdqDLn6hmRAOgAAMHmgww (envelope-from ) for ; Mon, 12 Jun 2023 11:00:09 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Relax breakpoint count check in gdb.python/py-rbreak.exp Date: Mon, 12 Jun 2023 13:00:26 +0200 Message-Id: <20230612110026.8557-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,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 List-Id: With a gdb 13.2 based package on SLE-15 aarch64, I run into: ... (gdb) PASS: gdb.python/py-rbreak.exp: nosharedlibrary py sl = gdb.rbreak("^[^_]",minsyms=False)^M Breakpoint 2 at 0x4004ac: file ../sysdeps/aarch64/crti.S, line 63.^M ... (gdb) py print(len(sl))^M 12^M (gdb) FAIL: gdb.python/py-rbreak.exp: check number of returned breakpoints is 11 ... The FAIL is due to: - the glibc object crti.o containing debug information for function call_weak_fn, and - the test-case not expecting this. The debug information is there due to compiling glibc using a binutils which contains commit 591cc9fbbfd ("gas/Dwarf: record functions"). I've run into a similar issue before, see commit 3fbbcf473a5 ("[gdb/testsuite] Fix regexp in py-rbreak.exp"). The fix I applied there was to use a regexp "^[^_]" to filter out __libc_csu_fini and __libc_csu_init, but that doesn't work for call_weak_fn. Fix this by: - reverting the regexp to "", and - rewriting the check to require at least 11 functions, rather than a precise match. Tested on x86_64-linux. PR testsuite/30538 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30538 --- gdb/testsuite/gdb.python/py-rbreak.exp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.python/py-rbreak.exp b/gdb/testsuite/gdb.python/py-rbreak.exp index 43e13cdcb1f..136c147f40f 100644 --- a/gdb/testsuite/gdb.python/py-rbreak.exp +++ b/gdb/testsuite/gdb.python/py-rbreak.exp @@ -31,10 +31,16 @@ if {![runto_main]} { } gdb_test_no_output "nosharedlibrary" -gdb_py_test_silent_cmd "py sl = gdb.rbreak(\"^\[^_\]\",minsyms=False)" \ +gdb_py_test_silent_cmd "py sl = gdb.rbreak(\"\",minsyms=False)" \ "get all function breakpoints" 0 -gdb_test "py print(len(sl))" "11" \ - "check number of returned breakpoints is 11" +set min_breakpoints 11 +gdb_test_multiple "py print(len(sl))" \ + "check number of returned breakpoints is at least $min_breakpoints" { + -re -wrap "($decimal)" { + set n $expect_out(1,string) + gdb_assert { $n >= $min_breakpoints } $gdb_test_name + } + } gdb_py_test_silent_cmd "py sl = gdb.rbreak(\"main\.\*\",minsyms=False)" \ "get main function breakpoint" 0 gdb_test "py print(len(sl))" "1" \ base-commit: d0cc647211981cfdcb402694ea43334ba2c236bd -- 2.35.3