From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 09E263858D39 for ; Mon, 19 Jun 2023 09:47:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09E263858D39 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-out1.suse.de (Postfix) with ESMTPS id 425A321882 for ; Mon, 19 Jun 2023 09:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1687168074; 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=EjJmhYCy8VZAumZ07g+9wgHwEXHYIdnNZcXJ33d4itg=; b=j59zcTbdI7bdks7pHE69usYKhxDZ82DLw2WJ3BgYrty/nLCzJ25+C80dkuDUl2JFYfZcQN GMx5rq/jnxN/s4z1T50Mgj77Wy8YETH549Y0SOrGM3oW3drMz9MDFPKrimnZsD3YUW5A/W n4tQ9N0m8wdsFfFCCYI2Sx49LX9ncAY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1687168074; 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=EjJmhYCy8VZAumZ07g+9wgHwEXHYIdnNZcXJ33d4itg=; b=G0V14dIjuibch+SWjtMxeLUoPGwREGxI4ema1Mjbb+I1AkbCKZ3gkUPyw+lLK+zOIKZ45Z F0POWwUqmK1Lc+Ag== 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 2DFAD138E8 for ; Mon, 19 Jun 2023 09:47:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4jMOCkokkGReMwAAMHmgww (envelope-from ) for ; Mon, 19 Jun 2023 09:47:54 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Add shared_gnat_runtime_has_debug_info Date: Mon, 19 Jun 2023 11:47:50 +0200 Message-Id: <20230619094750.4115-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: Test-case gdb.ada/catch_ex_std.exp passes for me with package libada7-debuginfo installed, but after removing it I get: ... (gdb) catch exception some_kind_of_error^M Your Ada runtime appears to be missing some debugging information.^M Cannot insert Ada exception catchpoint in this configuration.^M (gdb) FAIL: gdb.ada/catch_ex_std.exp: catch exception some_kind_of_error ... The test-case contains a require gnat_runtime_has_debug_info to deal with this, but the problem is that this checks the static gnat runtime, while this test-case uses the shared one. Fix this by introducing shared_gnat_runtime_has_debug_info, and requiring that one instead. Tested on x86_64-linux. PR testsuite/30094 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30094 --- gdb/testsuite/gdb.ada/catch_ex_std.exp | 2 +- gdb/testsuite/lib/ada.exp | 27 ++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.ada/catch_ex_std.exp b/gdb/testsuite/gdb.ada/catch_ex_std.exp index 3a2b10a8c13..052d4d7a668 100644 --- a/gdb/testsuite/gdb.ada/catch_ex_std.exp +++ b/gdb/testsuite/gdb.ada/catch_ex_std.exp @@ -17,7 +17,7 @@ require allow_shlib_tests load_lib "ada.exp" -require allow_ada_tests gnat_runtime_has_debug_info +require allow_ada_tests shared_gnat_runtime_has_debug_info standard_ada_testfile foo diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp index b4a93faefa5..d45d75994dd 100644 --- a/gdb/testsuite/lib/ada.exp +++ b/gdb/testsuite/lib/ada.exp @@ -171,7 +171,7 @@ proc gnatmake_version_at_least { major } { # Return 1 if the GNAT runtime appears to have debug info. -gdb_caching_proc gnat_runtime_has_debug_info {} { +proc gnat_runtime_has_debug_info_1 { shared } { if { ![allow_ada_tests] } { return 0 } @@ -181,7 +181,18 @@ gdb_caching_proc gnat_runtime_has_debug_info {} { set src "$srcdir/lib/gnat_debug_info_test.adb" set dst [standard_output_file "gnat_debug_info_test"] - if { [gdb_compile_ada_1 $src $dst executable {debug}] != "" } { + set opts {} + lappend opts debug + if { $shared } { + # Make sure we link against the shared GNAT run time. + set gnatbind_options [list -bargs -shared -margs] + + foreach option $gnatbind_options { + lappend opts [concat "additional_flags=" $option] + } + } + + if { [gdb_compile_ada_1 $src $dst executable $opts] != "" } { return 0 } @@ -208,3 +219,15 @@ gdb_caching_proc gnat_runtime_has_debug_info {} { return $has_debug_info } + +# Return 1 if the static GNAT runtime appears to have debug info. + +gdb_caching_proc gnat_runtime_has_debug_info {} { + return [gnat_runtime_has_debug_info_1 0] +} + +# Return 1 if the shared GNAT runtime appears to have debug info. + +gdb_caching_proc shared_gnat_runtime_has_debug_info {} { + return [gnat_runtime_has_debug_info_1 1] +} base-commit: ba769bb0e6fdf5b4c55577b068b93adf2f6d1333 -- 2.35.3