From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SWDIL15nqmrQ7xEAWB0awg (envelope-from ) for ; Wed, 16 Sep 2026 05:54:38 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=igiEtMG+; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=/weSVyg9; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ypJUktsc; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=ciFlH88x; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BD4501E06B; Wed, 16 Sep 2026 05:54:38 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 940B31E01F for ; Wed, 16 Sep 2026 05:54:37 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CEEC24BA7994 for ; Wed, 16 Sep 2026 09:54:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CEEC24BA7994 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=igiEtMG+; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=/weSVyg9; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ypJUktsc; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=ciFlH88x Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 8FBD84BA2E2E for ; Wed, 16 Sep 2026 09:52:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8FBD84BA2E2E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8FBD84BA2E2E Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789552373; cv=none; b=xpXP5r/LM/XZ9bXv2FijiQNRKf7edhCiaYjhuMzbw9PHUbZOWN4fXMNqjG2yrWjvfM8fGHlq+8fYPHjGsGZl6zwx0Yh9LlK8LHjnRkTK34z8vMVgXpxU1xiWs81UO1wkcywvZtEQnK1uwK/F3vRGcXZICQZUv1fyCRzBZ2iFso4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789552373; c=relaxed/simple; bh=tYEHY/UMaQ/Q+cEAXA4ShGIP9fOqrqN6mzmtbHLuhlk=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=jGwFAZq+4gGnp2rzuS9ZqOAVFuuzNSHKBizZjhB4TuzDVa0W9d5GhhvbrKQMv1ustg2hU6vtePs9F0j6NZeCpYoi8P19cUOEdJMwDH1rOIF7OqdDI1VnmkGN9TadjLqepLePHPdTLNW0CgfnW+kuYhk/YQZoFLm38NhrwY2v11c= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=igiEtMG+; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=/weSVyg9; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ypJUktsc; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=ciFlH88x DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8FBD84BA2E2E Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 37E0F1FE1D for ; Wed, 16 Sep 2026 09:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1789552368; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8j/APjNbHakpbaw1oU2Z4E6k7GbDmYbfnWufAQ7EJa8=; b=igiEtMG+ceIYUKynYDKPRR2tnsSxCKUIUldC8oSLxCiV+TwRvOd/9lzWQwKbFWYdpmxlD2 UG9FJP2kxOHfCxxk1tvP4tPgBRouaMxWAYOaPId42hxqZRVPCIwm2tPyBUDM90i8P9Hwot 2bWKsESPhmVyUT5btcoOYEXbWrgqeKk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1789552368; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8j/APjNbHakpbaw1oU2Z4E6k7GbDmYbfnWufAQ7EJa8=; b=/weSVyg9jArO5QDGkytKKXd2Yp6WzrqdLIoA/7q58IGRuV9IRNNlFZS0SWtUPNQqY/N+an dxMGmdxO8DDV1+DQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1789552364; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8j/APjNbHakpbaw1oU2Z4E6k7GbDmYbfnWufAQ7EJa8=; b=ypJUktsc6765H2nsjXtdUmoyq2poK5n+jQhALWtEqmMbc+rK+EZ7TDWkGSA3GYN3yGUiZs uARuH9C6Hwi5VDArQ5n6tJDamyybExkHQcpttrn1IInh9A1ZWMsNe5dM40mNF9LLc26MhW clvLeiIfI5Z1f7Mp/xFnXSs4lKTgNNk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1789552364; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8j/APjNbHakpbaw1oU2Z4E6k7GbDmYbfnWufAQ7EJa8=; b=ciFlH88xcz4CpltT3C8Eo44U4FOQ+dpZn5Hl/Jtn/VQr1LZLghPfbkDsPvGOoHyTpKxRFk uDrU30kevhamPJBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 05DCF136D1 for ; Wed, 16 Sep 2026 09:52:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id omSCKetmqmqMMQAAD6G6ig:T2 (envelope-from ) for ; Wed, 16 Sep 2026 09:52:44 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 1/4] [gdb/testsuite] Use strict regexp in gdb.python/py-rbreak.exp Date: Wed, 16 Sep 2026 11:52:40 +0200 Message-ID: <20260916095243.3040533-2-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260916095243.3040533-1-tdevries@suse.de> References: <20260916095243.3040533-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org With a 16.3 based package and test-case gdb.python/py-rbreak.exp I ran into: ... (gdb) py sl = gdb.rbreak("func.*",minsyms=False,throttle=10) Breakpoint 17 at 0x4011ad: file py-rbreak-func2.c, line 21. Breakpoint 18 at 0x4011b8: file py-rbreak-func2.c, line 27. Breakpoint 19 at 0x4011c3: file py-rbreak-func2.c, line 33. Breakpoint 20 at 0x40113a: file py-rbreak.c, line 21. Breakpoint 21 at 0x401145: file py-rbreak.c, line 27. Breakpoint 22 at 0x401150: file py-rbreak.c, line 33. Breakpoint 23 at 0x40115b: file py-rbreak.c, line 39. Breakpoint 24 at 0x401166: file py-rbreak.c, line 45. Breakpoint 25 at 0x401171: file py-rbreak.c, line 51. Breakpoint 26 at 0x40107e: file static-reloc.c, line 29. (gdb) py print(len(sl)) 10 (gdb) FAIL: $exp: check number of returned breakpoints is 9 ... The extra match is for _dl_relocate_static_pie_ifunc, which has a debug info entry with address: ... <1><295>: Abbrev Number: 2 (DW_TAG_subprogram) <296> DW_AT_external : 1 <296> DW_AT_name : _dl_relocate_static_pie_ifunc <29a> DW_AT_decl_file : 1 <29a> DW_AT_decl_line : 28 <29b> DW_AT_decl_column : 1 <29b> DW_AT_prototyped : 1 <29b> DW_AT_low_pc : 0x40107e <2a3> DW_AT_high_pc : 0x7 <2ab> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) <2ad> DW_AT_call_all_calls: 1 ... Previously, that was just a declaration: ... <1><295>: Abbrev Number: 4 (DW_TAG_subprogram) <296> DW_AT_external : 1 <296> DW_AT_name : _dl_relocate_static_pie_ifunc <29a> DW_AT_decl_file : 1 <29b> DW_AT_decl_line : 28 <29c> DW_AT_decl_column : 1 <29d> DW_AT_prototyped : 1 ... I'm not sure what the exact cause for this difference is, but it breaks the test-case. Fix this by using a regexp that only matches the 9 functions defined in the sources: func[1-6] and efunc[1-3]. I didn't consider it a good idea to update the test names using "func.*", because the intention stays the same, and changing it would unnecessarily disturb test summary comparisons. Tested on x86-64-linux. --- gdb/testsuite/gdb.python/py-rbreak.exp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.python/py-rbreak.exp b/gdb/testsuite/gdb.python/py-rbreak.exp index ba02758ae79..731ac7bbdb3 100644 --- a/gdb/testsuite/gdb.python/py-rbreak.exp +++ b/gdb/testsuite/gdb.python/py-rbreak.exp @@ -45,11 +45,15 @@ gdb_py_test_silent_cmd "py sl = gdb.rbreak(\"main\.\*\",minsyms=False)" \ "get main function breakpoint" 0 gdb_test "py print(len(sl))" "1" \ "check number of returned breakpoints is 1" -gdb_py_test_silent_cmd "py sl = gdb.rbreak(\"func\.\*\",minsyms=False,throttle=10)" \ + +# BRE matching func[1-6] and efunc[1-3]. +set re_func_efunc {r"^\(func[1-6]\|efunc[1-3]\)$"} + +gdb_py_test_silent_cmd "py sl = gdb.rbreak($re_func_efunc,minsyms=False,throttle=10)" \ "get functions matching func.*" 0 gdb_test "py print(len(sl))" "9" \ "check number of returned breakpoints is 9" -gdb_test "py gdb.rbreak(\"func\.\*\",minsyms=False,throttle=5)" \ +gdb_test "py gdb.rbreak($re_func_efunc,minsyms=False,throttle=5)" \ "Number of breakpoints exceeds throttled maximum.*" \ "check throttle errors on too many breakpoints" gdb_py_test_silent_cmd "py sl = gdb.rbreak(\"func1\",minsyms=True)" \ @@ -60,7 +64,7 @@ gdb_py_test_silent_cmd "python sym = gdb.lookup_symbol(\"efunc1\")" \ "find a symbol in objfile" 1 gdb_py_test_silent_cmd "python symtab = sym\[0\].symtab" \ "get backing symbol table" 1 -gdb_py_test_silent_cmd "py sl = gdb.rbreak(\"func\.\*\",minsyms=False,throttle=10,symtabs=\[symtab\])" \ +gdb_py_test_silent_cmd "py sl = gdb.rbreak($re_func_efunc,minsyms=False,throttle=10,symtabs=\[symtab\])" \ "get functions matching func.* in one symtab only" 0 gdb_test "py print(len(sl))" "3" \ "check number of returned breakpoints is 3" -- 2.51.0