From patchwork Wed Apr 19 19:30:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 68040 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 32D3F3856961 for ; Wed, 19 Apr 2023 19:31:22 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 62D603858CDA for ; Wed, 19 Apr 2023 19:31:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 62D603858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.99,210,1677571200"; d="scan'208";a="3288410" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 19 Apr 2023 11:31:06 -0800 IronPort-SDR: 4rpkFSs49sDLEK7rEE7N4U61sfsk9KczWABNYtRVvbvgpRnb4MOOJr0r8bdbRaKCQNfNejSNgV tAkcosWJ1rO7xzgIuah8v6okM26Jvqbmb0hExBFn+ghPuXIgYsVv9OvSq4F6nTHAualyZ4FFwu 2iZJ0AbsbF0znI+3j3/44VYNYpeAcrvkOvYOMfZcUO5kdll4jc6azNUVMdIhWunRgbMiH8Atkx IqA5gbwBLc16gV7TiSpeun+bhEsMNTEEePb3uZTRoKsLMGbiHp4eWkFzscFeLVatNzwc2zonv3 27o= From: Sandra Loosemore To: Subject: [PATCH 1/5] gdb/testsuite: Fix style.exp failures on targets without argc/argv support Date: Wed, 19 Apr 2023 13:30:42 -0600 Message-ID: <20230419193046.548783-2-sandra@codesourcery.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230419193046.548783-1-sandra@codesourcery.com> References: <20230419193046.548783-1-sandra@codesourcery.com> MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-14.mgc.mentorg.com (147.34.90.214) To svr-orw-mbx-13.mgc.mentorg.com (147.34.90.213) X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Some embedded targets don't have full support for argc/argv. argv may print as "0x0" or as an address with a symbol name following. This causes problems for the regexps in the style.exp line-wrapping tests that assume it always prints as an ordinary address in backtrace output. This patch generalizes the regexps to handle these additional forms and reworks some of the line-wrapping tests to account for the argv address string being shorter or longer than a regular address. --- gdb/testsuite/gdb.base/style.exp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index 0370550d251..60f909e2402 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -92,7 +92,7 @@ proc run_style_tests { } { set argv "" gdb_test_multiple "frame" "frame without styling" { - -re -wrap "main \\(argc=.*, (argv=$hex)\\).*style\\.c:\[0-9\].*" { + -re -wrap "main \\(argc=.*, (argv=$hex.*)\\).*style\\.c:\[0-9\].*" { set argv $expect_out(1,string) pass $gdb_test_name } @@ -105,9 +105,13 @@ proc run_style_tests { } { set file_expr "$base_file_expr:\[0-9\]+" set arg_expr [limited_style "arg." variable] + # On some embedded targets that don't fully support argc/argv, + # argv may print as "0x0" or as an address with a symbol name + # following, so use a regexp general enough to match that and + # do not make assumptions about how long the address string is. gdb_test "frame" \ [multi_line \ - "#0\\s+$main_expr\\s+\\($arg_expr=$decimal,\\s+$arg_expr=$hex\\)\\s+at\\s+$file_expr" \ + "#0\\s+$main_expr\\s+\\($arg_expr=$decimal,\\s+$arg_expr=$hex.*\\)\\s+at\\s+$file_expr" \ "\[0-9\]+\\s+.*return.* break here .*"] gdb_test "info breakpoints" "$main_expr at $file_expr.*" @@ -134,16 +138,21 @@ proc run_style_tests { } { # the line listing; this is why the words from the source # code are spelled out in the final result line of the # test. + set re0_styled \ + [multi_line \ + "#0\\s+$main_expr\\s+\\($arg_expr=$decimal,\\s+$arg_expr=$hex\\)" \ + "\\s+at\\s+$file_expr" \ + "\[0-9\]+\\s+.*return.* break here .*"] set re1_styled \ [multi_line \ "#0\\s+$main_expr\\s+\\($arg_expr=$decimal,\\s+" \ - "\\s+$arg_expr=$hex\\)" \ + "\\s+$arg_expr=$hex.*\\)" \ "\\s+at\\s+$file_expr" \ "\[0-9\]+\\s+.*return.* break here .*"] set re2_styled \ [multi_line \ "#0\\s+$main_expr\\s+\\($arg_expr=.*" \ - "\\s+$arg_expr=$hex\\)\\s+at\\s+$file_expr" \ + "\\s+$arg_expr=$hex.*\\)\\s+at\\s+$file_expr" \ "\[0-9\]+\\s+.*return.* break here .*"] # The length of the line containing argv containing: @@ -152,7 +161,11 @@ proc run_style_tests { } { # - closing parenthesis set line_len [expr 4 + $argv_len + 1] - if { $line_len > $width } { + if { $argv == "argv=0x0" && $width >= 27 } { + # Embedded target with no argv support. + # #0 main (argc=0, argv=0x0) + set re_styled $re0_styled + } elseif { $line_len > $width } { # At on the next line. set re_styled $re1_styled } else { From patchwork Wed Apr 19 19:30:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 68043 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 655713854176 for ; Wed, 19 Apr 2023 19:31:38 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 984F03858C83 for ; Wed, 19 Apr 2023 19:31:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 984F03858C83 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.99,210,1677571200"; d="scan'208";a="3288412" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 19 Apr 2023 11:31:08 -0800 IronPort-SDR: 2qkfOd96l1Id4fps1VWPPZw9tEeF2bmCQSNJ51Y3iSXp+tzXHWgHDFfgotd5B+Tw+p9IznBX8H 5Xe80SvUe1lKJQFziBtaIe0z1Ga9ftJOrKT1f3gZjwkOQrW/z3Lpn6rRIAmgfQfWxFxv6mcrL7 CfsnpT51FxcQYNbWuclhQsSxyHffVfAIL/+SgMuYn3Tdm2VVrWkTMlnwAptXTEE6XDECg+iEZz L+VnswJ1U2w4ARe/hXajDHM2rmFvOHFRiJcWSNJqASH46Ui2Rte1tGRMcv49GLg0JxVXQo9Oah zRs= From: Sandra Loosemore To: Subject: [PATCH 2/5] gdb/testsuite: Fix style.exp failures on targets without libopcodes styling Date: Wed, 19 Apr 2023 13:30:43 -0600 Message-ID: <20230419193046.548783-3-sandra@codesourcery.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230419193046.548783-1-sandra@codesourcery.com> References: <20230419193046.548783-1-sandra@codesourcery.com> MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-14.mgc.mentorg.com (147.34.90.214) To svr-orw-mbx-13.mgc.mentorg.com (147.34.90.213) X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Do not expect disassembler output to be styled by libopcodes if GDB reports the target does not support that. --- gdb/testsuite/gdb.base/style.exp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index 60f909e2402..d6ce48237e4 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -24,6 +24,29 @@ if {[build_executable "failed to build" $testfile $srcfile {debug macros}]} { return -1 } +# Check whether libopcodes styling is supported for this target. +set have_libopcodes_styling 1 +proc test_for_libopcodes_styling {} { + global binfile + global have_libopcodes_styling + clean_restart ${binfile} + + gdb_test_multiple "maint set libopcodes-styling enabled on" "" { + -re "^maint set libopcodes-styling enabled on\r\n" + { + exp_continue + } + -re "Use of libopcodes styling not supported on architecture \[^\r\n\]+\r\n" + { + set have_libopcodes_styling 0 + exp_continue + } + -re "^$::gdb_prompt $" + { + } + } +} + # The tests in this file are run multiple times with GDB's styles # disabled one at a time. This variable is the style that is # currently disabled. @@ -68,6 +91,7 @@ proc clean_restart_and_disable { prefix args } { proc run_style_tests { } { global testfile srcfile hex binfile global currently_disabled_style decimal hex + global have_libopcodes_styling save_vars { env(TERM) } { # We need an ANSI-capable terminal to get the output. @@ -195,7 +219,7 @@ proc run_style_tests { } { # symbol will be styled. However, if pygments is not being # used then we can know how the symbol name will be styled. set main [limited_style main function] - if { $::python_disassembly_styling } { + if { $::python_disassembly_styling || !$have_libopcodes_styling } { set func "some_called_function" } else { set func [limited_style some_called_function function] @@ -495,6 +519,9 @@ if {[allow_python_tests] && [gdb_py_module_available "pygments"]} { set python_disassembly_styling false } +# Check to see if libopcodes styling is available for this target +test_for_libopcodes_styling + # Run tests with all styles in their default state. with_test_prefix "all styles enabled" { run_style_tests From patchwork Wed Apr 19 19:30:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 68041 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 573E03854171 for ; Wed, 19 Apr 2023 19:31:35 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 2BC623857720 for ; Wed, 19 Apr 2023 19:31:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2BC623857720 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.99,210,1677571200"; d="scan'208";a="3288413" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 19 Apr 2023 11:31:10 -0800 IronPort-SDR: 7+cHeTIRzGZRfUL99YOtRxjwr1rxY8BK92in0OrvajbITCnWdN57ERWhslFDhyR/ihZZrfY3bI Sx9tTBDkxXTsIt6H94Qk2bSeWX85dcHoVKsIsyE3LqE19JzzZt6uT9qeHsdBQAoqqXWt09DUId cKtORBIT6Poq0hEdvSJxbAsnC0CeTCuOOSi/+vcH8owfKaXWGDd+donD7w28opuNHawhYpD2LV 6dcPzsQ6jWPomIj3uNDlDXzLPMxXhgHGtcK5BdBGjZy1dBgAzmMvnu6yWk7xguM2grC8XQnwrl 60E= From: Sandra Loosemore To: Subject: [PATCH 3/5] gdb/testsuite: Adjust some testcases to allow Windows pathnames Date: Wed, 19 Apr 2023 13:30:44 -0600 Message-ID: <20230419193046.548783-4-sandra@codesourcery.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230419193046.548783-1-sandra@codesourcery.com> References: <20230419193046.548783-1-sandra@codesourcery.com> MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-14.mgc.mentorg.com (147.34.90.214) To svr-orw-mbx-13.mgc.mentorg.com (147.34.90.213) X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" This patch fixes some testcases that formerly had patterns with hardwired "/" pathname separators in them, which broke when testing on (remote) Windows host. --- .../maint-expand-symbols-header-file.exp | 4 +-- gdb/testsuite/gdb.base/setshow.exp | 14 ++++++-- gdb/testsuite/gdb.dwarf2/dw2-filename.exp | 2 +- gdb/testsuite/gdb.mi/mi-info-sources.exp | 32 +++++++++---------- 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/gdb/testsuite/gdb.base/maint-expand-symbols-header-file.exp b/gdb/testsuite/gdb.base/maint-expand-symbols-header-file.exp index d38d2ab7398..43b5aabea3c 100644 --- a/gdb/testsuite/gdb.base/maint-expand-symbols-header-file.exp +++ b/gdb/testsuite/gdb.base/maint-expand-symbols-header-file.exp @@ -40,13 +40,13 @@ gdb_test_no_output "maint info symtabs" $test gdb_test_no_output "maint expand-symtabs maint-expand-symbols-header-file.h" # Check that the include symtab was in fact expanded. -set file_re "\[^\r\n\]*/maint-expand-symbols-header-file.h" +set file_re "\[^\r\n\]*maint-expand-symbols-header-file.h" gdb_test "maint info symtabs" \ "\r\n\t{ symtab $file_re \\(\\(struct symtab \\*\\) $hex\\)\r\n.*" \ "check header file psymtab expansion" # Check that the symtab the include symtab was referring to was expanded. -set file_re "\[^\r\n\]*/maint-expand-symbols-header-file.c" +set file_re "\[^\r\n\]*maint-expand-symbols-header-file.c" gdb_test "maint info symtabs" \ "\r\n\t{ symtab $file_re \\(\\(struct symtab \\*\\) $hex\\)\r\n.*" \ "check source file psymtab expansion" diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp index 86821ca1db0..6f8644af710 100644 --- a/gdb/testsuite/gdb.base/setshow.exp +++ b/gdb/testsuite/gdb.base/setshow.exp @@ -280,10 +280,18 @@ proc_with_prefix test_setshow_history {} { #get home directory path set HOME "" + set STRINGHOME "" set test "show environment HOME" gdb_test_multiple $test $test { -re "\nHOME = (\[^\r\n\]*)\[\r\n\]+$::gdb_prompt $" { set HOME $expect_out(1,string) + if { [ishost *-*-mingw*] } { + # Backslashes in the pathname must be escaped for the patterns + # that match quoted string output. + regsub -all {\\} $HOME {\\\\} STRINGHOME + } else { + set STRINGHOME $HOME + } pass $test } } @@ -294,13 +302,13 @@ proc_with_prefix test_setshow_history {} { #test show history filename ~/foobar.baz gdb_test "show history filename" \ - "The filename in which to record the command history is \"[string_to_regexp $HOME]/foobar.baz\"..*" \ + "The filename in which to record the command history is \"[string_to_regexp $HOME].foobar.baz\"..*" \ "show history filename (~/foobar.baz)" gdb_test "p \$_gdb_setting(\"history filename\")" \ - " = \"[string_to_regexp $HOME]/foobar.baz\"..*" \ + " = \"[string_to_regexp $STRINGHOME].foobar.baz\".*" \ "_gdb_setting history filename" gdb_test "p \$_gdb_setting_str(\"history filename\")" \ - " = \"[string_to_regexp $HOME]/foobar.baz\"..*" \ + " = \"[string_to_regexp $STRINGHOME].foobar.baz\".*" \ "_gdb_setting_str history filename" #get current working directory diff --git a/gdb/testsuite/gdb.dwarf2/dw2-filename.exp b/gdb/testsuite/gdb.dwarf2/dw2-filename.exp index 3bdac4c1cb8..c0ee3ac0d3f 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-filename.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-filename.exp @@ -38,4 +38,4 @@ gdb_test "interpreter-exec mi -file-list-exec-source-files" \ ".*{file=\"file1\\.txt\",fullname=\".+file1\\.txt\",debug-fully-read=\"\[^\"\]+\"}.*" # And `info sources' should return the fullname incl. the directories. -gdb_test "info sources" {[/]file1\.txt.*} +gdb_test "info sources" {.+file1\.txt.*} diff --git a/gdb/testsuite/gdb.mi/mi-info-sources.exp b/gdb/testsuite/gdb.mi/mi-info-sources.exp index f639f3cdef9..3778ccb3fbe 100644 --- a/gdb/testsuite/gdb.mi/mi-info-sources.exp +++ b/gdb/testsuite/gdb.mi/mi-info-sources.exp @@ -118,16 +118,16 @@ proc check_info_sources { debug_fully_read } { [mi_list "files" \ ".*" \ [mi_tuple "" \ - [mi_field "file" "\[^\"\]+/mi-info-sources-base\\.c"] \ - [mi_field "fullname" "\[^\"\]+/mi-info-sources-base\\.c"] \ + [mi_field "file" "\[^\"\]*mi-info-sources-base\\.c"] \ + [mi_field "fullname" "\[^\"\]+mi-info-sources-base\\.c"] \ [mi_field "debug-fully-read" "${debug_fully_read}"]] \ ".*"] set p2 \ [mi_list "files" \ ".*" \ [mi_tuple "" \ - [mi_field "file" "\[^\"\]+/mi-info-sources\\.c"] \ - [mi_field "fullname" "\[^\"\]+/mi-info-sources\\.c"] \ + [mi_field "file" "\[^\"\]*mi-info-sources\\.c"] \ + [mi_field "fullname" "\[^\"\]+mi-info-sources\\.c"] \ [mi_field "debug-fully-read" "true"]] \ ".*"] } else { @@ -135,16 +135,16 @@ proc check_info_sources { debug_fully_read } { [mi_list "files" \ ".*" \ [mi_tuple "" \ - [mi_field "file" "\[^\"\]+/mi-info-sources\\.c"] \ - [mi_field "fullname" "\[^\"\]+/mi-info-sources\\.c"] \ + [mi_field "file" "\[^\"\]*mi-info-sources\\.c"] \ + [mi_field "fullname" "\[^\"\]+mi-info-sources\\.c"] \ [mi_field "debug-fully-read" "true"]] \ ".*"] set p2 \ [mi_list "files" \ ".*" \ [mi_tuple "" \ - [mi_field "file" "\[^\"\]+/mi-info-sources-base\\.c"] \ - [mi_field "fullname" "\[^\"\]+/mi-info-sources-base\\.c"] \ + [mi_field "file" "\[^\"\]*mi-info-sources-base\\.c"] \ + [mi_field "fullname" "\[^\"\]+mi-info-sources-base\\.c"] \ [mi_field "debug-fully-read" "${debug_fully_read}"]] \ ".*"] } @@ -156,8 +156,8 @@ proc check_info_sources { debug_fully_read } { set p [mi_list "files" \ [mi_tuple "" \ - [mi_field "file" "\[^\"\]+/mi-info-sources-base\\.c"] \ - [mi_field "fullname" "\[^\"\]+/mi-info-sources-base\\.c"] \ + [mi_field "file" "\[^\"\]*mi-info-sources-base\\.c"] \ + [mi_field "fullname" "\[^\"\]+mi-info-sources-base\\.c"] \ [mi_field "debug-fully-read" "${debug_fully_read}"]]] mi_gdb_test "-file-list-exec-source-files --basename -- base" ".*\\^done,${p}" \ "-file-list-exec-source-files --basename -- base" @@ -171,13 +171,13 @@ proc check_info_sources { debug_fully_read } { set p [mi_list "files" \ [mi_tuple "" \ - [mi_field "filename" "\[^\"\]+/mi-info-sources(\.debug)?"] \ + [mi_field "filename" "\[^\"\]+mi-info-sources(\.debug)?"] \ [mi_field "debug-info" "${debug_info}"] \ [mi_list "sources" \ ".*" \ [mi_tuple "" \ - [mi_field "file" "\[^\"\]+/mi-info-sources\\.c"] \ - [mi_field "fullname" "\[^\"\]+/mi-info-sources\\.c"] \ + [mi_field "file" "\[^\"\]*mi-info-sources\\.c"] \ + [mi_field "fullname" "\[^\"\]+mi-info-sources\\.c"] \ [mi_field "debug-fully-read" "true"]] \ ".*"]]] mi_gdb_test "-file-list-exec-source-files --group-by-objfile" \ @@ -186,13 +186,13 @@ proc check_info_sources { debug_fully_read } { set p [mi_list "files" \ [mi_tuple "" \ - [mi_field "filename" "\[^\"\]+/mi-info-sources(\.debug)?"] \ + [mi_field "filename" "\[^\"\]+mi-info-sources(\.debug)?"] \ [mi_field "debug-info" "${debug_info}"] \ [mi_list "sources" \ ".*" \ [mi_tuple "" \ - [mi_field "file" "\[^\"\]+/mi-info-sources-base\\.c"] \ - [mi_field "fullname" "\[^\"\]+/mi-info-sources-base\\.c"] \ + [mi_field "file" "\[^\"\]*mi-info-sources-base\\.c"] \ + [mi_field "fullname" "\[^\"\]+mi-info-sources-base\\.c"] \ [mi_field "debug-fully-read" "${debug_fully_read}"]] \ ".*"]]] mi_gdb_test "-file-list-exec-source-files --group-by-objfile" \ From patchwork Wed Apr 19 19:30:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 68042 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 42C92385B51E for ; Wed, 19 Apr 2023 19:31:38 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 1B5FE3857716 for ; Wed, 19 Apr 2023 19:31:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B5FE3857716 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.99,210,1677571200"; d="scan'208";a="3288416" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 19 Apr 2023 11:31:13 -0800 IronPort-SDR: cmNC+Rvaf7Yq0q03h764ZZLSfSFekKOGv4qLe/XZoxXJAZZZoPpqJy+i5AFQ3zOYxI5oM0eRDa ZaUr3xdAEhsll26ipepOyTSnllTF9UCD4N+zJqwK5wC29tyEa6iDu87K0DsdzmW5ZNGgkr8uhZ SFdlUT6Zm0GgtyBjNj5fZdEZp2E+yd5PAYPShj4yryZ1qly9IN4duRIgElGqZ2cZwLP83HLelb Oj/lkqpBMJtcjNKv0wF9nxhxhqDBtf6wtw3Mc+O1VnABLhSmuJMG4EV8pKwYDQBMpRFPkjfw1u o7Y= From: Sandra Loosemore To: Subject: [PATCH 4/5] gdb/testsuite: Disable some tests that are broken on remote Windows host Date: Wed, 19 Apr 2023 13:30:45 -0600 Message-ID: <20230419193046.548783-5-sandra@codesourcery.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230419193046.548783-1-sandra@codesourcery.com> References: <20230419193046.548783-1-sandra@codesourcery.com> MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-14.mgc.mentorg.com (147.34.90.214) To svr-orw-mbx-13.mgc.mentorg.com (147.34.90.213) X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" These testcases assume host==build or that the remote host has a Posix shell to run commands in. Don't try to run them if that's not the case. --- gdb/testsuite/gdb.base/bad-file.exp | 6 ++++++ gdb/testsuite/gdb.base/early-init-file.exp | 6 ++++++ gdb/testsuite/gdb.base/empty-host-env-vars.exp | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/gdb/testsuite/gdb.base/bad-file.exp b/gdb/testsuite/gdb.base/bad-file.exp index 5d8dfee8fea..98101d9e15a 100644 --- a/gdb/testsuite/gdb.base/bad-file.exp +++ b/gdb/testsuite/gdb.base/bad-file.exp @@ -20,6 +20,12 @@ # print different text then the plan is to update the expected text # instead of making this test linux-only or some such. +# The pathnames and shell commands in this test don't work on Windows host. +if { [is_remote host] && [ishost *-*-mingw*] } { + untested "does not work on remote Windows host" + return 0 +} + # There is no such file, but we still use the normal mechanism to pick # its name and path. standard_testfile diff --git a/gdb/testsuite/gdb.base/early-init-file.exp b/gdb/testsuite/gdb.base/early-init-file.exp index fcd1ff041a1..0bb2c456a3e 100644 --- a/gdb/testsuite/gdb.base/early-init-file.exp +++ b/gdb/testsuite/gdb.base/early-init-file.exp @@ -15,6 +15,12 @@ # Test GDB's early init file mechanism. +# Test assumes host == build. +if {[is_remote host]} { + untested "does not work on remote host" + return 0 +} + standard_testfile # Compile the test executable. diff --git a/gdb/testsuite/gdb.base/empty-host-env-vars.exp b/gdb/testsuite/gdb.base/empty-host-env-vars.exp index 96240311c24..a28798ff69a 100644 --- a/gdb/testsuite/gdb.base/empty-host-env-vars.exp +++ b/gdb/testsuite/gdb.base/empty-host-env-vars.exp @@ -13,6 +13,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# This test assumes host == build. +if {[is_remote host]} { + untested "does not work on remote host" + return 0 +} + # GDB reads some environment variables on startup, make sure it behaves # correctly if these variables are defined but empty.