From patchwork Wed Jul 19 07:18:47 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: 72916 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 8B5C038582BC for ; Wed, 19 Jul 2023 07:19:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B5C038582BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689751161; bh=G3LpIPcwmFQXPUlWrbyp5CCf3+mbf8S5nCfZpv+EIAM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=OJjSmrLoONbm8FKSCisoDJm7VyaqmPPHclXM9NEHyVvFuOtZ6Sp0r+IiA/AOcI+Ac /0Ls5hdy0e0R8vU+7NzuawWmBRaAjWHH72HlzQ3fkR4a+/l0/nJ0O+vF/DgHXo+lVL xep0sk6JEJQm1YJ/wDa7+yMUA4Qa81sZsGMtrkRU= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 46B983858439 for ; Wed, 19 Jul 2023 07:18:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 46B983858439 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 D46641F8BF for ; Wed, 19 Jul 2023 07:18:55 +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 C02DB13460 for ; Wed, 19 Jul 2023 07:18:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 3pa+LV+Ot2TOVwAAMHmgww (envelope-from ) for ; Wed, 19 Jul 2023 07:18:55 +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 Date: Wed, 19 Jul 2023 09:18:47 +0200 Message-Id: <20230719071847.16882-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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 using gcc 7.5.0, I run into: ... (gdb) ptype global_c^M ^M Thread 1 "xgdb" hit Breakpoint 3, \ _Z12c_print_typeP4typePKcP7ui_fileii8languagePK18type_print_options () at \ gdb/c-typeprint.c:175^M 175 {^M (outer-gdb) FAIL: gdb.gdb/python-helper.exp: hit breakpoint in outer gdb again ... This is a problem with the debug info, which marks the CU containing the function declaration as C rather than C++. This is fixed in gcc 8 and later. Work around this compiler problem by allowing the mangled name. Tested on x86_64-linux. PR testsuite/30648 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30648 --- gdb/testsuite/gdb.gdb/python-helper.exp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) base-commit: 03c02b696e90714a0ae2c0200d3c65cfffcaa1ee diff --git a/gdb/testsuite/gdb.gdb/python-helper.exp b/gdb/testsuite/gdb.gdb/python-helper.exp index 217f123302d..719c3975f5d 100644 --- a/gdb/testsuite/gdb.gdb/python-helper.exp +++ b/gdb/testsuite/gdb.gdb/python-helper.exp @@ -193,8 +193,12 @@ 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, c_print_type.*" { + -re -wrap "Breakpoint $bkptno_numopt_re, $fn_name.*" { pass $gdb_test_name set in_outer_gdb 1 }