From patchwork Wed Jul 26 11:28:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 73223 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 A1C8F3857348 for ; Wed, 26 Jul 2023 11:29:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1C8F3857348 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690370951; bh=yZ9coWYXiKmxe1l2YTkJDR9uR348z1d7t50Y/XvU5v8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qlHTGC/TLULRuzZf2OmMPG4CvztCvi11ixqm5WJi5zTTYOIayXd1Dr6hdMUQu3slC NNxyrG5z3cN3UCp4OGYojWkfskGdT5PH3A/uqTmVaH2+Z8pjtAgIu7jIz+e4QfJM8j gNeEjrCH+yQp4rabkwzhcYsyZBmp4DdTyNg3fPtE= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 24CAB3858C54 for ; Wed, 26 Jul 2023 11:28:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 24CAB3858C54 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 3D68921DD7 for ; Wed, 26 Jul 2023 11:28:46 +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 2BA181341F for ; Wed, 26 Jul 2023 11:28:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id dyR7CW4DwWQZJgAAMHmgww (envelope-from ) for ; Wed, 26 Jul 2023 11:28:46 +0000 To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Fix gdb.gdb/python-helper.exp with -O2 -flto=auto and gcc 7.5.0 some more Date: Wed, 26 Jul 2023 13:28:31 +0200 Message-Id: <20230726112831.30904-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 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 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: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" With a gdb build with -O2 -flto=auto and gcc 7.5.0 and test-case gdb.gdb/python-helper.exp I run into: ... (outer-gdb) continue^M Continuing.^M print 1^M ^M Thread 1 "xgdb" hit Breakpoint 2, \ _Z11value_printP5valueP7ui_filePK19value_print_options (val=0x22e2590, \ stream=0x1f65480, options=0x7fffffffcdc0) at gdb/valprint.c:1193^M 1193 {^M (outer-gdb) FAIL: gdb.gdb/python-helper.exp: hit breakpoint in outer gdb ... This is the "value_print" variant of the problem with "c_print_type" I fixed in commit 0d332f11122 ("[gdb/testsuite] Fix gdb.gdb/python-helper.exp with -O2 -flto=auto and gcc 7.5.0"). Fix this likewise. Tested on x86_64-linux. --- gdb/testsuite/gdb.gdb/python-helper.exp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) base-commit: c0afd99439fea90c1e93e5add7eac06cf533bb3e diff --git a/gdb/testsuite/gdb.gdb/python-helper.exp b/gdb/testsuite/gdb.gdb/python-helper.exp index 719c3975f5d..a5d8308e4e5 100644 --- a/gdb/testsuite/gdb.gdb/python-helper.exp +++ b/gdb/testsuite/gdb.gdb/python-helper.exp @@ -69,6 +69,12 @@ proc test_python_helper {} { gdb_breakpoint value_print qualified gdb_breakpoint c_print_type qualified + # With gdb build with -O2 -flto=auto and gcc 7.5.0, we can get the mangled + # names due to a problem in the debug info, so we work around this by less + # strict matching. + set fn_name_value_print "\[^\r\n\]*value_print\[^\r\n\]*" + set fn_name_c_print_type "\[^\r\n\]*c_print_type\[^\r\n\]*" + # Disable all breakpoints until after we have loaded the test # binary into the inner GDB. gdb_test_no_output "disable breakpoints" @@ -125,7 +131,7 @@ proc test_python_helper {} { # breakpoints we created.. send_inferior "print 1\n" gdb_test -prompt $outer_prompt_re "" \ - "Breakpoint $bkptno_numopt_re, value_print.*" \ + "Breakpoint $bkptno_numopt_re, $fn_name_value_print.*" \ "hit breakpoint in outer gdb" # Now inspect the type of parameter VAL, this should trigger the @@ -165,7 +171,7 @@ proc test_python_helper {} { # information. send_inferior "print global_c.m_val\n" gdb_test -prompt $outer_prompt_re "" \ - "Breakpoint $bkptno_numopt_re, value_print.*" \ + "Breakpoint $bkptno_numopt_re, $fn_name_value_print.*" \ "print integer from DWARF info" set answer [multi_line \ @@ -193,12 +199,8 @@ proc test_python_helper {} { send_inferior "ptype global_c\n" set test "hit breakpoint in outer gdb again" set in_outer_gdb 0 - # With gdb build with -O2 -flto=auto and gcc 7.5.0, we get the mangled - # name of c_print_type due to a problem in the debug info, so we work - # around this by less strict matching. - set fn_name "\[^\r\n\]*c_print_type\[^\r\n\]*" gdb_test_multiple "" $test -prompt $outer_prompt_re { - -re -wrap "Breakpoint $bkptno_numopt_re, $fn_name.*" { + -re -wrap "Breakpoint $bkptno_numopt_re, $fn_name_c_print_type.*" { pass $gdb_test_name set in_outer_gdb 1 }