From patchwork Mon Mar 27 11:58:49 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: 66942 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 B023738555B6 for ; Mon, 27 Mar 2023 11:59:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B023738555B6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679918363; bh=yPtO09zYtGQ6/FTtOBb4rsK5UQlqnncr029uxx67r8M=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=qtJQ9UiqCShG8FbPyqyCzE1Nd3pAlmo9VvNxn/lvGbaurQbN9KTb2jf0BDg+mXou/ 0yhqKK4rL3Jxz69H+JsNMkXqfKrfAUlAF4NpQdsvlI+g2Jk8p7+BAZ+td5BBTl/0X+ +HvzJx7zOCGMNZCp5eiC5J50D6E+7nZL/+0upfCw= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 5028B3858404 for ; Mon, 27 Mar 2023 11:59:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5028B3858404 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 86FAB1FDBE for ; Mon, 27 Mar 2023 11:58:59 +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 749B4138ED for ; Mon, 27 Mar 2023 11:58:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id AC9lGwOFIWTCOgAAMHmgww (envelope-from ) for ; Mon, 27 Mar 2023 11:58:59 +0000 To: gdb-patches@sourceware.org Subject: [pushed 01/10] [gdb/testsuite] Add missing include_file in gdb.dwarf/*.exp Date: Mon, 27 Mar 2023 13:58:49 +0200 Message-Id: <20230327115858.5950-2-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230327115858.5950-1-tdevries@suse.de> References: <20230327115858.5950-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 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" --- gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp | 2 ++ gdb/testsuite/gdb.dwarf2/fission-mix.exp | 2 ++ gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp | 1 + 3 files changed, 5 insertions(+) diff --git a/gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp b/gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp index 06ce4906f07..c08179fe5e9 100644 --- a/gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp +++ b/gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp @@ -17,6 +17,8 @@ standard_testfile .cc -b.cc +include_file dw4-sig-types.h + # This test is intended for targets which support DWARF-4. # Since we pass an explicit -gdwarf-4 -fdebug-types-section to the compiler, # we let that be the test of whether the target supports it. diff --git a/gdb/testsuite/gdb.dwarf2/fission-mix.exp b/gdb/testsuite/gdb.dwarf2/fission-mix.exp index a396747714d..1e78de6990e 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-mix.exp +++ b/gdb/testsuite/gdb.dwarf2/fission-mix.exp @@ -19,6 +19,8 @@ load_lib dwarf.exp require dwarf2_support standard_testfile .c -2.c +include_file fission-mix.h + set objfile [standard_output_file ${testfile}.o] set objfile2 [standard_output_file ${testfile}2.o] diff --git a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp index a5b301e26fb..5bdc3e49b1c 100644 --- a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp +++ b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp @@ -67,6 +67,7 @@ set lib_basename ${::gdb_test_file_name}-lib # which will be ${srcfile3} after the execution of standard_testfile. standard_testfile $main_basename.c $lib_basename.c $lib_basename.S +include_file locexpr-data-member-location.h set libsrc "${::srcdir}/${::subdir}/${::srcfile2}" set lib_so [standard_output_file ${lib_basename}.so] From patchwork Mon Mar 27 11:58:50 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: 66943 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 62DBE385840A for ; Mon, 27 Mar 2023 11:59:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62DBE385840A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679918364; bh=O3mqs/CJu1spuhKM6cV5EoqJXqYDfrhNxAg6u5/JGpg=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ybg0DNqD/wdfPDMfOODXcdmmGqz7jWcK7GN3t46RdKjmKk0yLBujX8VeuOCHhk8kh VhIDRMGpMW+owe48PrLrhpjvD4F9Nx2PeUpKQuQQg6Ir3a1HCGChNujPJ3EXSq0Ylj rUr7ViW0C/J95ulMRjBp07OPIzPA9Wg9vCyvZwzk= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 699F63858C50 for ; Mon, 27 Mar 2023 11:59:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 699F63858C50 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 A0CDF1FDBF for ; Mon, 27 Mar 2023 11:58:59 +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 8C17513482 for ; Mon, 27 Mar 2023 11:58:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id QGcoIQOFIWTCOgAAMHmgww (envelope-from ) for ; Mon, 27 Mar 2023 11:58:59 +0000 To: gdb-patches@sourceware.org Subject: [pushed 02/10] [gdb/testsuite] Fix have_index for remote host Date: Mon, 27 Mar 2023 13:58:50 +0200 Message-Id: <20230327115858.5950-3-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230327115858.5950-1-tdevries@suse.de> References: <20230327115858.5950-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 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" Proc have_index is mostly used with $binfile, which gives problems for remote host. Fix this by using "file tail" on the proc argument. Tested on x86_64-linux. --- gdb/testsuite/lib/gdb.exp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 813b755215e..c0762cbb3a8 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -8740,6 +8740,10 @@ proc readnow { } { # Otherwise, return "". proc have_index { objfile } { + # This proc is mostly used with $binfile, but that gives problems with + # remote host, while using $testfile would work. + # Fix this by reducing $binfile to $testfile. + set objfile [file tail $objfile] set res "" set cmd "maint print objfiles $objfile" From patchwork Mon Mar 27 11:58:51 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: 66947 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 89C9538708BD for ; Mon, 27 Mar 2023 12:00:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89C9538708BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679918402; bh=Uuk4M1fT0gjikWg+ktDj+99B5WklFrY0EUKABGLO20I=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=rT1BfkhuiGyGAQtHY8Cdn2bAmN1hO5ph4oIV0ceX+Ln2GrpIplRuoZDtAWz0nuBBF a9v5iMGwRwy9qSOUxRzPjS7LO8z0UFcnuBA4uVPIp8pRPla6ShtIy2qC9WA7p5qMMG 42cailHN/7BbZxQWmC/zJFvmlUYy/xXh0Fl5FZ5Y= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 814EE3858C3A for ; Mon, 27 Mar 2023 11:59:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 814EE3858C3A 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 B971B1FDC0 for ; Mon, 27 Mar 2023 11:58:59 +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 A62C013482 for ; Mon, 27 Mar 2023 11:58:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4ADuJgOFIWTCOgAAMHmgww (envelope-from ) for ; Mon, 27 Mar 2023 11:58:59 +0000 To: gdb-patches@sourceware.org Subject: [pushed 03/10] [gdb/testsuite] Fix quoting issues in gdb.dwarf2 for remote host Date: Mon, 27 Mar 2023 13:58:51 +0200 Message-Id: <20230327115858.5950-4-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230327115858.5950-1-tdevries@suse.de> References: <20230327115858.5950-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 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" A few test-cases in gdb.dwarf2 use something like: ... additional_flags=\"-DFOO=BAR + 10\" ... which doesn't work on remote host. Fix this by introducing a new proc quote_for_host that also works for remote host, such that we have: ... additional_flags=[quote_for_host -DFOO=BAR + 10] ... Tested on x86_64-linux. --- gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp | 17 ++++++++++------- .../gdb.dwarf2/dw2-ref-missing-frame.exp | 18 ++++++++++++------ gdb/testsuite/lib/gdb.exp | 13 +++++++++++++ 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp index 2ec3d11d8ac..0868b69f15e 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp @@ -37,13 +37,16 @@ set sources \ ${testfile}-hello.c \ ${testfile}-world-dbg.S \ ${testfile}-world.c] -set flags \ - [list \ - "nodebug" \ - "additional_flags=\"-DHELLO_START=$hello_start\"" \ - "additional_flags=\"-DHELLO_END=$hello_start + $hello_len\"" \ - "additional_flags=\"-DWORLD_START=$world_start\"" \ - "additional_flags=\"-DWORLD_END=$world_start + $world_len\""] + +set flags {} +lappend flags nodebug +lappend flags additional_flags=[quote_for_host -DHELLO_START=$hello_start] +lappend flags additional_flags=[quote_for_host -DHELLO_END=$hello_start \ + + $hello_len] +lappend flags additional_flags=[quote_for_host -DWORLD_START=$world_start] +lappend flags additional_flags=[quote_for_host -DWORLD_END=$world_start \ + + $world_len] + set executable ${testfile} if {[build_executable ${testfile}.exp ${executable} $sources $flags] == -1} { return -1 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp index d9a552a8c9d..09c484a8ebb 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp @@ -25,12 +25,18 @@ lassign [function_range func_loopfb \ "${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}"] \ func_loopfb_start func_loopfb_len -set flags \ - [list \ - "additional_flags=\"-DFUNC_NOFB_START=$func_nofb_start\"" \ - "additional_flags=\"-DFUNC_NOFB_END=$func_nofb_start + $func_nofb_len\"" \ - "additional_flags=\"-DFUNC_LOOPFB_START=$func_loopfb_start\"" \ - "additional_flags=\"-DFUNC_LOOPFB_END=$func_loopfb_start + $func_loopfb_len\""] +set flags {} +lappend flags \ + additional_flags=[quote_for_host -DFUNC_NOFB_START=$func_nofb_start] +lappend flags \ + additional_flags=[quote_for_host -DFUNC_NOFB_END=$func_nofb_start \ + + $func_nofb_len] +lappend flags \ + additional_flags=[quote_for_host -DFUNC_LOOPFB_START=$func_loopfb_start] +lappend flags \ + additional_flags=[quote_for_host -DFUNC_LOOPFB_END=$func_loopfb_start \ + + $func_loopfb_len] + set executable ${testfile} if { [prepare_for_testing_full "failed to prepare" \ diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index c0762cbb3a8..2cf128fdd68 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4700,6 +4700,19 @@ proc escape_for_host { str } { return [string map $map $str] } +# Add double quotes around ARGS, sufficiently escaped for use on host +# commandline. + +proc quote_for_host { args } { + set str [join $args] + if { [is_remote host] } { + set str [join [list {\"} $str {\"}] ""] + } else { + set str [join [list {"} $str {"}] ""] + } + return $str +} + # Compile source files specified by SOURCE into a binary of type TYPE at path # DEST. gdb_compile is implemented using DejaGnu's target_compile, so the type # parameter and most options are passed directly to it. From patchwork Mon Mar 27 11:58:52 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: 66945 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 E10033858417 for ; Mon, 27 Mar 2023 11:59:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E10033858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679918396; bh=nPDHLQOQQ26or7eceGjSdeAEBCfl0giy4/wgWlG6w3Q=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=q9HWgyMjw/mddcqbWm0Fvr5jIpeIq+CGmD4b0zuPtMqZrduRg61gVZCLcBNiMgrXI S8zq9B3bIP4+1MNhVj2xmUS276cQbhJaq8EzHLS9c31dKdoLO+W3kU/4HDYxFunFb0 6DzNcMYsPJqo+OxDrNSxZ0oNb2hiMUWAZYK2z0vI= 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 A37883858C2D for ; Mon, 27 Mar 2023 11:59:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A37883858C2D 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 D10501FDC1 for ; Mon, 27 Mar 2023 11:58:59 +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 BE36213482 for ; Mon, 27 Mar 2023 11:58:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GGJYLQOFIWTCOgAAMHmgww (envelope-from ) for ; Mon, 27 Mar 2023 11:58:59 +0000 To: gdb-patches@sourceware.org Subject: [pushed 04/10] [gdb/testsuite] Fix quoting issue in gdb.base/index-cache.exp Date: Mon, 27 Mar 2023 13:58:52 +0200 Message-Id: <20230327115858.5950-5-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230327115858.5950-1-tdevries@suse.de> References: <20230327115858.5950-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 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 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" For test-case gdb.base/index-cache.exp and remote host, this: ... lassign [remote_exec host sh "-c \"rm $cache_dir/*.gdb-index\""] ret ... gives us: ... Executing on host: sh -c rm /tmp/tmp.m3L7m2AVkL/*.gdb-index (timeout = 300) builtin_spawn -ignore SIGHUP sh -c rm /tmp/tmp.m3L7m2AVkL/*.gdb-index^M rm: missing operand^M Try 'rm --help' for more information.^M FAIL: gdb.dwarf2/per-bfd-sharing.exp: couldn't remove files in temporary cache dir ... Fix this using quote_for_host. Likewise in gdb.dwarf2/per-bfd-sharing.exp. Tested on x86_64-linux. --- gdb/testsuite/gdb.base/index-cache.exp | 2 +- gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp index ec69f0f11ad..9f2f53053cb 100644 --- a/gdb/testsuite/gdb.base/index-cache.exp +++ b/gdb/testsuite/gdb.base/index-cache.exp @@ -245,7 +245,7 @@ test_cache_enabled_hit $cache_dir # Test again with the cache disabled, now that it is populated. test_cache_disabled $cache_dir "after populate" -lassign [remote_exec host sh "-c \"rm $cache_dir/*.gdb-index\""] ret +lassign [remote_exec host "sh -c" [quote_for_host rm $cache_dir/*.gdb-index]] ret if { $ret != 0 && $expecting_index_cache_use } { fail "couldn't remove files in temporary cache dir" return diff --git a/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp b/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp index 46284c2b775..6574f65df91 100644 --- a/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp +++ b/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp @@ -96,7 +96,7 @@ foreach_with_prefix first $methods { } } -lassign [remote_exec host sh "-c \"rm $cache_dir/*.gdb-index\""] ret +lassign [remote_exec host "sh -c" [quote_for_host rm $cache_dir/*.gdb-index]] ret if { $ret != 0 && $expecting_index_cache_use } { fail "couldn't remove files in temporary cache dir" return From patchwork Mon Mar 27 11:58:53 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: 66950 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 1761C3882170 for ; Mon, 27 Mar 2023 12:00:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1761C3882170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679918455; bh=foVYZfgHBka8uJT27f7dJcciLAyZmE5DgfB6DL7FC+8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=FJejNVHRnH8kQ2oz2uQkmRBDcK10IOpb4mQiHB7rbrpSzM7IgixTJal92beE7wbOi 8UCXFM5eXooI8+aGxJ4qjsb/gmfv62hLSvNe5AJ2sbcbcBa3Q+GQ91saU1qc3vOcQO aM6KG8QAWT7V/EndOmlHBc0yQ/RZqlb/hLEpbjIk= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 50CB13858C5E for ; Mon, 27 Mar 2023 11:59:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 50CB13858C5E 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 E859B1FDC2 for ; Mon, 27 Mar 2023 11:58:59 +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 D58A113482 for ; Mon, 27 Mar 2023 11:58:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id OLgJMwOFIWTCOgAAMHmgww (envelope-from ) for ; Mon, 27 Mar 2023 11:58:59 +0000 To: gdb-patches@sourceware.org Subject: [pushed 05/10] [gdb/testsuite] Fix gdb.dwarf2/per-bfd-sharing.exp for remote host Date: Mon, 27 Mar 2023 13:58:53 +0200 Message-Id: <20230327115858.5950-6-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230327115858.5950-1-tdevries@suse.de> References: <20230327115858.5950-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 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" Fix test-case gdb.dwarf2/per-bfd-sharing.exp for remote host using gdb_remote_download. Likewise in a few other test-cases. Tested on x86_64-linux. --- gdb/testsuite/gdb.dwarf2/dw2-error.exp | 6 ++++-- gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp | 4 +++- gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp | 4 +++- gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp | 11 ++--------- gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp | 10 ++++++---- gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp | 9 +++++---- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-error.exp b/gdb/testsuite/gdb.dwarf2/dw2-error.exp index 626cf5b27f2..76886d5c1b6 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-error.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-error.exp @@ -32,13 +32,15 @@ clean_restart gdb_test_no_output "set breakpoint pending off" +set host_binfile [gdb_remote_download host $binfile] + # First test that reading symbols fails. -gdb_test "file $binfile" \ +gdb_test "file $host_binfile" \ {Reading symbols.*Dwarf Error: wrong version in compilation unit header \(is 153, should be 2, 3, 4 or 5\).*} \ "file $testfile" # We can't use proc readnow, because the PR makes it return 0. -gdb_test_multiple "maint print objfiles $binfile" "" { +gdb_test_multiple "maint print objfiles $host_binfile" "" { -re "^maint print objfiles \[^\r\n\]*\r\n$gdb_prompt $" { setup_kfail "gdb/26797" *-*-* } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp b/gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp index 8f8dac6f94f..f57e8086a7c 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp @@ -44,6 +44,8 @@ if {[build_executable "failed to build executable" $testfile \ return -1 } +set host_binfile [gdb_remote_download host $binfile] + # Restart with no executable. clean_restart @@ -63,7 +65,7 @@ set pattern2 \ "Dwarf Error: unexpected tag 'DW_TAG_subprogram' at offset $hex"] # Load the executable, we expect an error from the DWARF parser. -gdb_test_multiple "file $binfile" "file $testfile" { +gdb_test_multiple "file $host_binfile" "file $testfile" { -wrap -re $pattern1 { pass $gdb_test_name } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp index dd461c33d38..0968c1c473c 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp @@ -34,7 +34,9 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile_outer}" "${binfile_outer}" \ clean_restart $executable_outer -gdb_test "add-symbol-file $binfile_inner outer_inner" \ +set host_binfile_inner [gdb_remote_download host $binfile_inner] + +gdb_test "add-symbol-file $host_binfile_inner outer_inner" \ {Reading symbols from .*\.\.\.} "add-symbol-file" \ "\r\n\t\\.text_addr = 0x\[0-9a-f\]+\r\n\\(y or n\\) \$" "y" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp index 52dfae3d7d7..a72564c075c 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp @@ -25,18 +25,11 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" clean_restart -# From gdb_file_cmd: -if [is_remote host] { - set arg [remote_download host $binfile] - if { $arg == "" } { - perror "download failed" - return -1 - } -} +set host_binfile [gdb_remote_download host $binfile] gdb_test_no_output "set complaints 100" set w1 0 set w2 0 -gdb_test_multiple "file $binfile" "file command" { +gdb_test_multiple "file $host_binfile" "file command" { -re "\r\nReading symbols from \[^\r\n\]*\\.\\.\\." { exp_continue } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp index e921c105d0d..7974cb7f20b 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp @@ -98,12 +98,14 @@ if ![runto_main] { # field names, all of which are stored in the .debug_str section. gdb_test "p global_var" " = \\{aa = 0, bb = 0, cc = 0\\}" +set host_binfile [gdb_remote_download host $binfile] + # Verify that the executable actually contains a .debug_str section, before # trying to remove it. This can be missing with target boards # cc-with-dwz-m.exp and cc-with-gnu-debuglink.exp. Handle this by # skipping the remainder of the test-case. -set debug_str_section "${binfile}-debug-str" -set args "--dump-section .debug_str=${debug_str_section} $binfile" +set debug_str_section "${host_binfile}-debug-str" +set args "--dump-section .debug_str=${debug_str_section} $host_binfile" set result [remote_exec host "[gdb_find_objcopy] $args"] set status [lindex $result 0] set output [lindex $result 1] @@ -115,8 +117,8 @@ if { $status == 0 && ![string equal $output ""] } { # creates an executable with an invalid DWARF configuration. GDB # should give an error when trying to read the debug information from # this executable. -set binfile_no_debug_str "${binfile}-no-debug-str" -set args "--remove-section .debug_str $binfile ${binfile_no_debug_str}" +set binfile_no_debug_str "${host_binfile}-no-debug-str" +set args "--remove-section .debug_str $host_binfile ${binfile_no_debug_str}" if {[run_on_host "objcopy" [gdb_find_objcopy] "$args"]} { perror "failed to run objcopy" return -1 diff --git a/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp b/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp index 6574f65df91..dd15e881d0c 100644 --- a/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp +++ b/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp @@ -22,6 +22,7 @@ if { [build_executable "failed to prepare" $testfile $srcfile \ {debug ldflags=-Wl,--build-id}] == -1 } { return } +set host_binfile [gdb_remote_download host $binfile] set has_index_section [exec_has_index_section $binfile] set uses_readnow [expr [string first "-readnow" $GDBFLAGS] != -1] @@ -46,7 +47,7 @@ with_test_prefix "populate index cache" { gdb_test_no_output "set index-cache directory $cache_dir" \ "set index-cache directory" gdb_test_no_output "set index-cache enabled on" - gdb_test "file $binfile" "Reading symbols from .*" "file" + gdb_test "file $host_binfile" "Reading symbols from .*" "file" } proc load_binary { method } { @@ -54,13 +55,13 @@ proc load_binary { method } { global hex if { $method == "standard" } { - gdb_test "file $binfile" "Reading symbols from .*" "file" + gdb_test "file $::host_binfile" "Reading symbols from .*" "file" } elseif { $method == "index" } { gdb_test_no_output "set index-cache enabled on" - gdb_test "file $binfile" "Reading symbols from .*" "file index" + gdb_test "file $::host_binfile" "Reading symbols from .*" "file index" gdb_test_no_output "set index-cache enabled off" } elseif { $method == "readnow" } { - gdb_test "file -readnow $binfile" \ + gdb_test "file -readnow $::host_binfile" \ "Reading symbols from .*Expanding full symbols from .*" \ "file readnow" } else { From patchwork Mon Mar 27 11:58:54 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: 66948 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 6C5F2385842E for ; Mon, 27 Mar 2023 12:00:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C5F2385842E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679918425; bh=MOv++fAwtXSfLqnFNk8QA9ATUf5e65tpDB4y+ME2UZw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=SnlT7v8dxCGsqMxIbU3oECGQJH5qs14oJ9MpSzaqN0PdaDByqItYkShKtdZzquy0r 9Whh6vLJdUKBfjRMRtu3ZG/kVtWb3bYlFY/rpxVS+Q9Zmc3XOAQNjYAym9zO1mEiH0 N93dX5315U+swCcYVU5zeIRYL5DjG4jcUchVS39s= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id F29E63858CDA for ; Mon, 27 Mar 2023 11:59:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F29E63858CDA 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 0C8FB21E7E for ; Mon, 27 Mar 2023 11:59:00 +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 ECEEE138ED for ; Mon, 27 Mar 2023 11:58:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gCu8OAOFIWTCOgAAMHmgww (envelope-from ) for ; Mon, 27 Mar 2023 11:58:59 +0000 To: gdb-patches@sourceware.org Subject: [pushed 06/10] [gdb/testsuite] Fix gdb.dwarf2/gdb-index.exp on remote host Date: Mon, 27 Mar 2023 13:58:54 +0200 Message-Id: <20230327115858.5950-7-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230327115858.5950-1-tdevries@suse.de> References: <20230327115858.5950-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 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" Fix test-case gdb.dwarf2/gdb-index.exp on remote host using gdb_remote_download and host_standard_output_file. Also declare the test-case unsupported with readnow. Tested on x86_64-linux. --- gdb/testsuite/gdb.dwarf2/gdb-index.exp | 36 +++++++++++++++++++------- gdb/testsuite/lib/gdb.exp | 7 ++++- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-index.exp index 8a12e35f353..c28f45c5e5c 100644 --- a/gdb/testsuite/gdb.dwarf2/gdb-index.exp +++ b/gdb/testsuite/gdb.dwarf2/gdb-index.exp @@ -18,6 +18,9 @@ load_lib dwarf.exp # This test can only be run on targets which support DWARF-2. require dwarf2_support +# Can't save an index with readnow. +require !readnow + standard_testfile main.c if { [prepare_for_testing "failed to prepare" "${testfile}" \ @@ -32,16 +35,17 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \ # Use local prefix to prevent overriding add_gdb_index from lib/gdb.exp. proc local_add_gdb_index { program } { - set index_file ${program}.gdb-index - set dir [file dirname ${program}] set filename [file tail ${program}] - set dwz $dir/.tmp/${filename}.dwz - set dwz_index_file $program.dwz.gdb-index + set host_program [gdb_remote_download host $program] + set index_file [host_standard_output_file $filename.gdb-index] + set tmpdir [host_standard_output_file .tmp] + set dwz $tmpdir/$filename.dwz + set dwz_index_file [host_standard_output_file $filename.dwz.gdb-index] verbose -log "index_file: ${index_file}" remote_file host delete ${index_file} remote_file host delete ${dwz_index_file} gdb_test_no_output "save gdb-index [file dirname ${index_file}]" \ - "save gdb-index for file [file tail ${program}]" + "save gdb-index for file $filename" # No point in continuing if generating the index failed. # N.B.: There are times when gdb won't create an index, and it's not a @@ -55,8 +59,16 @@ proc local_add_gdb_index { program } { return "" } - set program_with_index ${program}.with-index - if {[run_on_host "objcopy" [gdb_find_objcopy] "--remove-section .gdb_index --add-section .gdb_index=$index_file --set-section-flags .gdb_index=readonly ${program} ${program_with_index}"]} { + set host_program_with_index $host_program.with-index + set program_with_index $program.with-index + if {[run_on_host "objcopy" [gdb_find_objcopy] \ + [join \ + [list \ + "--remove-section .gdb_index" \ + "--add-section .gdb_index=$index_file" \ + "--set-section-flags .gdb_index=readonly" \ + "$host_program" \ + "$host_program_with_index"]]]} { return "" } @@ -73,7 +85,9 @@ proc local_add_gdb_index { program } { } } - return ${program_with_index} + return [list \ + [remote_upload host $host_program_with_index $program_with_index] \ + $host_program_with_index] } # Build a copy of the program with an index (.gdb_index/.debug_names). @@ -84,12 +98,14 @@ set test "check if index present" gdb_test_multiple "mt print objfiles ${testfile}" $test { -re "gdb_index.*${gdb_prompt} $" { set binfile_with_index $binfile + set host_binfile_with_index [gdb_remote_download host $binfile] } -re "debug_names.*${gdb_prompt} $" { set binfile_with_index $binfile + set host_binfile_with_index [gdb_remote_download host $binfile] } -re "(Psymtabs|Cooked).*${gdb_prompt} $" { - set binfile_with_index [local_add_gdb_index $binfile] + lassign [local_add_gdb_index $binfile] binfile_with_index host_binfile_with_index if { ${binfile_with_index} == "" } { return -1 } @@ -114,7 +130,7 @@ gdb_test "mt print objfiles ${testfile}" \ # Is touch portable enough? # First make sure enough time has passed, file mtime resolution is seconds. gdb_test_no_output "shell sleep 1" -if {[run_on_host "touch binary" touch ${binfile_with_index}]} { +if {[run_on_host "touch binary" touch $host_binfile_with_index]} { return -1 } diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 2cf128fdd68..39ed5ad761b 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -6412,7 +6412,12 @@ proc standard_output_file {basename} { proc host_standard_output_file { basename } { if { [is_remote host] } { - return $basename + set remotedir [board_info host remotedir] + if { $remotedir == "" } { + return $basename + } else { + return [join [list $remotedir $basename] "/"] + } } else { return [standard_output_file $basename] } From patchwork Mon Mar 27 11:58:55 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: 66949 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 214183881D1F for ; Mon, 27 Mar 2023 12:00:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 214183881D1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679918426; bh=v/fvbDhFRswqUxiZNvcKnxASQIfHI04moo+UkxrdFEc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=oS6HGiiXyA7fJVnj8ibuQqgc7qCwQq2eyqwpgdo6/Zmu771hAm3ePHa3lxLpjY2Qz fiwbLLuNsPJ0dKCkRZpM9IFR+8yfJS1DFNfQ6MGw7eUO1R2b0OEV+ohz5rlphjhX0N p6xDjmGrlUyqe/gRHeUMsjZsGgO9sHhTY0I1oN2c= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 50F173858C74 for ; Mon, 27 Mar 2023 11:59:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 50F173858C74 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 237CA1FDC3 for ; Mon, 27 Mar 2023 11:59:00 +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 1076213482 for ; Mon, 27 Mar 2023 11:59:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id yOr5AgSFIWTCOgAAMHmgww (envelope-from ) for ; Mon, 27 Mar 2023 11:59:00 +0000 To: gdb-patches@sourceware.org Subject: [pushed 07/10] [gdb/testsuite] Fix gdb.dwarf2/enqueued-cu-base-addr.exp for remote host Date: Mon, 27 Mar 2023 13:58:55 +0200 Message-Id: <20230327115858.5950-8-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230327115858.5950-1-tdevries@suse.de> References: <20230327115858.5950-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 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" Fix test-case gdb.dwarf2/enqueued-cu-base-addr.exp for remote host by using $testfile instead $binfile. Tested on x86_64-linux. --- gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp index 658a9a4bb79..b60c02085b4 100644 --- a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp +++ b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp @@ -89,7 +89,7 @@ set cu2_blockvector_re \ "" \ "block #000, \[^\r\n\]* in ($hex)..$hex" \ ".*"] -gdb_test_multiple "maint print symbols -objfile $binfile" "CU addr found" { +gdb_test_multiple "maint print symbols -objfile $testfile" "CU addr found" { -re -wrap $cu2_blockvector_re { set addr $expect_out(1,string) if { $addr eq "0x0" } { From patchwork Mon Mar 27 11:58:56 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: 66944 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 50AC9384D184 for ; Mon, 27 Mar 2023 11:59:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 50AC9384D184 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679918380; bh=Qrf4VdpWGAQjm4B5cs9IYjBu8Z5xG8kT49TLRDSsOCQ=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=mgCNrgq8vN1kRx3/ykxA6KynzOub+ksbPY0Z6oySKPnwcn9ga6xi8VfMAhGd0oC7M MU0QRLry+cNVyJf0pgwwh/mZg81xSEKAMeF7zYoU4T0ldxMNWtWAE3Kw1EHsJ1Lfei 5SOhdfjQm0/2VkhpwMEXZsQ5j4/BDxR1VHCClocE= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 10682385840A for ; Mon, 27 Mar 2023 11:59:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 10682385840A 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 3AB3721E88 for ; Mon, 27 Mar 2023 11:59:00 +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 27F5E13482 for ; Mon, 27 Mar 2023 11:59:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MNeQCASFIWTCOgAAMHmgww (envelope-from ) for ; Mon, 27 Mar 2023 11:59:00 +0000 To: gdb-patches@sourceware.org Subject: [pushed 08/10] [gdb/testsuite] Fix gdb.dwarf2/gdb-index-cxx.exp for remote host Date: Mon, 27 Mar 2023 13:58:56 +0200 Message-Id: <20230327115858.5950-9-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230327115858.5950-1-tdevries@suse.de> References: <20230327115858.5950-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 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" Fix test-case gdb.dwarf2/gdb-index-cxx.exp for remote host using host_standard_output_file. Tested on x86_64-linux. --- gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp | 2 +- gdb/testsuite/lib/gdb.exp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp b/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp index 3c3d6cc463d..6fffc982722 100644 --- a/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp +++ b/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp @@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" "${testfile}" \ } # The bug was that gdb would crash when saving. -set output_dir [standard_output_file ""] +set output_dir [host_standard_output_file ""] set cmd "save gdb-index" gdb_test_multiple "$cmd $output_dir" $cmd { -re -wrap "Cannot use an index to create the index.*" { diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 39ed5ad761b..14ce39e8ed7 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -6414,6 +6414,9 @@ proc host_standard_output_file { basename } { if { [is_remote host] } { set remotedir [board_info host remotedir] if { $remotedir == "" } { + if { $basename == "" } { + return "." + } return $basename } else { return [join [list $remotedir $basename] "/"] From patchwork Mon Mar 27 11:58:57 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: 66946 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 CE627385AC29 for ; Mon, 27 Mar 2023 11:59:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE627385AC29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679918397; bh=5CrKxNv7WQTg+pBTdcNaPp5BtGWICD5CQEFDE4971nI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=JdA744tp5Tj8CwNM6zZF6oNLQoFk4CM/441Hkk6T9TDRBluW0dWsFe9f13aoLSEkj +gyinzGMIkuV94/WhNYzcub7NZj855coxEy4YX9gN48uxFm8lwBwGhAF9VNTm1kn5e SJ/6GXOMLCxkg0s2i/4Rp6aAT+N7qbrgtTRzHQp4= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 204FB3858C53 for ; Mon, 27 Mar 2023 11:59:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 204FB3858C53 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 518E621E89 for ; Mon, 27 Mar 2023 11:59:00 +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 3F76213482 for ; Mon, 27 Mar 2023 11:59:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id OH5KDgSFIWTCOgAAMHmgww (envelope-from ) for ; Mon, 27 Mar 2023 11:59:00 +0000 To: gdb-patches@sourceware.org Subject: [pushed 09/10] [gdb/testsuite] Unsupport gdb.dwarf2/gdb-add-index-symlink.exp for remote host Date: Mon, 27 Mar 2023 13:58:57 +0200 Message-Id: <20230327115858.5950-10-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230327115858.5950-1-tdevries@suse.de> References: <20230327115858.5950-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 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" Declare test-case gdb.dwarf2/gdb-add-index-symlink.exp unsupported for remote host, because the current implementation of gdb_ensure_index doesn't support it. Tested on x86_64-linux. --- gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp index b9d99c314dc..d6f96ab9f5b 100644 --- a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp +++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp @@ -18,6 +18,9 @@ load_lib dwarf.exp # This test can only be run on targets which support DWARF-2. require dwarf2_support +# The current implementation of ensure_gdb_index doesn't work on remote host. +require {!is_remote host} + standard_testfile main.c # First check whether we can actually handle the non-symlink case. From patchwork Mon Mar 27 11:58:58 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: 66951 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 29029385842A for ; Mon, 27 Mar 2023 12:00:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 29029385842A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679918457; bh=oSQIIb3BsFm5K1gvSBOFXZyYRtPfzQuWvkqI+pG485I=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=N1StjVF6wAO2cV8sNlE/zNVpNmkATsnTcDJKhPzv6uasvV99+yz7XOHh20FTg6kAa 4mneRv/p35cD3CSxBBzoqRAwTpN3HxTsXMFY5lyU2MI/ZQcMvRbC6E2UtX1ZR1NL9s yhZQrqSncBKQPZyM4qdfLM3jU5qxV9AbP8xF8v3M= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 3A0E93858C66 for ; Mon, 27 Mar 2023 11:59:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A0E93858C66 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 6B77021E8B for ; Mon, 27 Mar 2023 11:59:00 +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 56E3613482 for ; Mon, 27 Mar 2023 11:59:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gBoLFASFIWTCOgAAMHmgww (envelope-from ) for ; Mon, 27 Mar 2023 11:59:00 +0000 To: gdb-patches@sourceware.org Subject: [pushed 10/10] [gdb/testsuite] Fix gdb.dwarf2/imported-unit-bp-c.exp for remote host Date: Mon, 27 Mar 2023 13:58:58 +0200 Message-Id: <20230327115858.5950-11-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230327115858.5950-1-tdevries@suse.de> References: <20230327115858.5950-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 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" Fix test-case gdb.dwarf2/imported-unit-bp-c.exp on remote by removing a downloaded source file. Tested on x86_64-linux. --- gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl b/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl index 6bef2bdb089..62dee7d7992 100644 --- a/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl +++ b/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl @@ -122,5 +122,10 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ gdb_reinitialize_dir /tmp +# Compilation on remote host downloads the source files to remote host, but +# doesn't clean them up, allowing gdb to find $srcfile, in contrast to +# non-remote host. +remote_file host delete $srcfile + # Using an absolute path is important to see the bug. gdb_test "break /tmp/${srcfile}:19" "Breakpoint .* file $srcfile, line .*"