From patchwork Sun Apr 23 19:31:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 68193 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 1EFC43858414 for ; Sun, 23 Apr 2023 19:32:39 +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 8291D3858C50 for ; Sun, 23 Apr 2023 19:32:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8291D3858C50 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,220,1677571200"; d="scan'208";a="3666943" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 23 Apr 2023 11:32:22 -0800 IronPort-SDR: 78swdS/PFU8ofQk/UysAn0qEeXdcIJO+Jr2mtyCYrg+fpD+Isk1hSQUYBzHZgRVX4LAjtidLXW /Kp+zGwo8+J9KPnbaYkBYo62YEhJAf3MAtLQ/ic+CJiJSmhKKR8n5E7AAaVGC1p6xmBXvL0g4z IgbBQ7NVLs5b1eLnchLx7TQSIha6ewmJrZG1dVHKFW6FViUNHmiTd1I+yG++vWWATOqAl18ioo 2QV6TtrdWMmEjEQ4vZVLlMsYdu4inIboLBYmvLsLHvpxwQWfZiYFJr9du3ztPTvUEbeqCUgaAF nFk= From: Sandra Loosemore To: CC: Subject: [PATCH V2 1/5] gdb/testsuite: Fix style.exp failures on targets without argc/argv support Date: Sun, 23 Apr 2023 13:31:55 -0600 Message-ID: <20230423193159.576300-2-sandra@codesourcery.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230423193159.576300-1-sandra@codesourcery.com> References: <20230423193159.576300-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, 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 Sun Apr 23 19:31:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 68194 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 50AB23858C2F for ; Sun, 23 Apr 2023 19:32:53 +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 2986D3858C53 for ; Sun, 23 Apr 2023 19:32:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2986D3858C53 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,220,1677571200"; d="scan'208";a="3666948" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 23 Apr 2023 11:32:25 -0800 IronPort-SDR: kv1PpyCLhHv6CGf2kj9dYCGVbEzuJAnNeop2qFh97ad0ErDCEkNiKpGN7b0sKCsQI600+VT6eW 9YNwGzxTEsoycY3J/TcKqtaBpJPL9i1dnFAA47xMNgeZERw5T0RICDnlF5fgzFVdtcWc7ItyEu 0cCdI2FhGIfoHA0Fyp1PMzhD06H+PUJgienn/cPoJGVS5CqvyEUkgR5vRaNhs/AallrLQaOkLq ehLsNnK0/AqPLRLgayyDKmbbEgN3lUB6b445x7KjTZE4D2hxQRK3YifOouEVWZnv0AHQrrPRo/ frM= From: Sandra Loosemore To: CC: Subject: [PATCH V2 2/5] gdb/testsuite: Fix style.exp failures on targets without libopcodes styling Date: Sun, 23 Apr 2023 13:31:56 -0600 Message-ID: <20230423193159.576300-3-sandra@codesourcery.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230423193159.576300-1-sandra@codesourcery.com> References: <20230423193159.576300-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, 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 | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index 60f909e2402..94c9dc46d73 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -24,6 +24,26 @@ 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 +88,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 +216,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 +516,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 Sun Apr 23 19:31:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 68195 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 2E8B7385624C for ; Sun, 23 Apr 2023 19:32:57 +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 0B24C3857727 for ; Sun, 23 Apr 2023 19:32:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B24C3857727 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,220,1677571200"; d="scan'208";a="3666949" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 23 Apr 2023 11:32:27 -0800 IronPort-SDR: sgsLnNUtP3I9OZQF2AuFScMgX1ERsuH+kshDhP2e1VSjfk7190abbmRG1D8QgZgGYS3GzbBiQq 62aE2TRv4vmyzNTZNHqJZvCeP01s1Lz/rJYEzoRU7euTqz/SRoVoDpXJj6Bm3ZpeVX/w8ZWzjH R5S3I49mZZKzawvB+zg6XcEvSNzX+VL/RR1ZVI+twkxA6HQujnyy7NmAlsmEVgOhYaD82rACt0 Ghi8YWQNoNoG7rK0zwHkblngpfKLEX8rtxsxmRMFSIgGF8Bb3VTtnihYGVm7ItU2DpHM5G2qaW JjA= From: Sandra Loosemore To: CC: Subject: [PATCH V2 3/5] gdb/testsuite: Adjust some testcases to allow Windows pathnames Date: Sun, 23 Apr 2023 13:31:57 -0600 Message-ID: <20230423193159.576300-4-sandra@codesourcery.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230423193159.576300-1-sandra@codesourcery.com> References: <20230423193159.576300-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, 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 | 17 ++++++++-- gdb/testsuite/gdb.dwarf2/dw2-filename.exp | 2 +- gdb/testsuite/gdb.mi/mi-info-sources.exp | 32 +++++++++---------- 4 files changed, 33 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..684e2b6c3a4 100644 --- a/gdb/testsuite/gdb.base/setshow.exp +++ b/gdb/testsuite/gdb.base/setshow.exp @@ -280,10 +280,21 @@ 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*] } { + # STRINGHOME is how HOME prints with C string escapes. + # Specifically, all backslashes "\" in the pathname + # string have to be escaped as "\\". If you have other + # weird characters in your HOME pathname that need + # escaping too, maybe you shouldn't do that. :-P + regsub -all {\\} $HOME {\\\\} STRINGHOME + } else { + set STRINGHOME $HOME + } pass $test } } @@ -294,13 +305,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 Sun Apr 23 19:36:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 68196 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 4CC0E3857353 for ; Sun, 23 Apr 2023 19:36:35 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 339493858C83 for ; Sun, 23 Apr 2023 19:36:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 339493858C83 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,220,1677571200"; d="scan'208";a="3274786" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 23 Apr 2023 11:36:21 -0800 IronPort-SDR: 5faq/ZCLbNl9chKqPTJafan4xB+fV0pvIn0D5Lv1Jhby6GS+SRK25HqwpEnUVBmaZK5yHg+HCC /p76xO2QQBe1xe+RtIEHUcWe0IqbtVVE4wxKTqbbm70Q0cIAmTyhclTP08KgvVpQZPCSyqYCkN IUMn936EzUrRi9CkNY8STDSw1HyyhB6v2W5BUuKsB+MG/DweOMpEyS5crJPHByqwiqUex5Ov0n 3E3b4MdFR4piQXtWry618/cRuY5I4ZhtYf1zmoKgT6X9GKFZk3feA68INUoiC6BqWSAdBJAPfM ixw= From: Sandra Loosemore To: CC: Subject: [PATCH V2 4/5] gdb/testsuite: Disable some tests that are broken on remote Windows host Date: Sun, 23 Apr 2023 13:36:05 -0600 Message-ID: <20230423193606.576453-1-sandra@codesourcery.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-13.mgc.mentorg.com (147.34.90.213) 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, 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 | 3 +++ gdb/testsuite/gdb.base/early-init-file.exp | 3 +++ gdb/testsuite/gdb.base/empty-host-env-vars.exp | 3 +++ 3 files changed, 9 insertions(+) diff --git a/gdb/testsuite/gdb.base/bad-file.exp b/gdb/testsuite/gdb.base/bad-file.exp index 5d8dfee8fea..5e050411f95 100644 --- a/gdb/testsuite/gdb.base/bad-file.exp +++ b/gdb/testsuite/gdb.base/bad-file.exp @@ -20,6 +20,9 @@ # 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. +require {!ishost *-*-mingw*} + # 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..237439f9db7 100644 --- a/gdb/testsuite/gdb.base/early-init-file.exp +++ b/gdb/testsuite/gdb.base/early-init-file.exp @@ -15,6 +15,9 @@ # Test GDB's early init file mechanism. +# Test assumes host == build. +require {!is_remote host} + 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..22f6b4d2ebe 100644 --- a/gdb/testsuite/gdb.base/empty-host-env-vars.exp +++ b/gdb/testsuite/gdb.base/empty-host-env-vars.exp @@ -13,6 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# This test assumes host == build. +require {!is_remote host} + # GDB reads some environment variables on startup, make sure it behaves # correctly if these variables are defined but empty. From patchwork Sun Apr 23 19:36:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 68197 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 95EF93856DC6 for ; Sun, 23 Apr 2023 19:36:36 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id D16AB3858C50 for ; Sun, 23 Apr 2023 19:36:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D16AB3858C50 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,220,1677571200"; d="scan'208";a="3274788" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 23 Apr 2023 11:36:22 -0800 IronPort-SDR: Xav+OHuskyXUqjNecOJZanFHANLztStQR1EcUyc1Yx8zzzCqqkySQgzPT1CyOQv1AT2PrOqAkF NqzQSMHed6y5IqAuXT9yDo3juXFNrUZLSSYGnK2vqtt5yB/xmPn6dtJdaerw8bGSmL20FjlhgR xyy0yYZk1uW4BGgYwlxAC4NVONaZL0+ivQKuiL5ZAt1MShiY4S4cchqFwe/vIsO1m+OJs/6cpF HvpAL1FEodxaf6uoGVXL6sAbaUqDuOsPJIOvDhm5wAlhVJwsYNcpPZZ6E2LwHpOXME8r+1di71 r2c= From: Sandra Loosemore To: CC: Subject: [PATCH V2 5/5] gdb/testsuite: Make hook-stop.exp ignore termination message from GDB stub Date: Sun, 23 Apr 2023 13:36:06 -0600 Message-ID: <20230423193606.576453-2-sandra@codesourcery.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230423193606.576453-1-sandra@codesourcery.com> References: <20230423193606.576453-1-sandra@codesourcery.com> MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-13.mgc.mentorg.com (147.34.90.213) 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, 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" When a GDB stub is run via "target remote |", it sometimes produces extra output that ends up mixed with GDB's own output. For example, QEMU's built-in GDB stub responds to the vKill packet by printing nios2-elf-qemu-system: QEMU: Terminated via GDBstub before exiting. This patch fixes the regexp in gdb.base/hook-stop.exp to allow such messages between GDB's "continuing" and "Inferior killed" messages. --- gdb/testsuite/gdb.base/hook-stop.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/hook-stop.exp b/gdb/testsuite/gdb.base/hook-stop.exp index 0babd46aaea..50c5dfe9dc5 100644 --- a/gdb/testsuite/gdb.base/hook-stop.exp +++ b/gdb/testsuite/gdb.base/hook-stop.exp @@ -85,7 +85,7 @@ proc hook_stop_kill {} { set test "run hook-stop" gdb_test_multiple "continue" "$test" { - -re "Continuing.\r\n\\\[Inferior $decimal \\(.*\\) killed\\\]\r\n${gdb_prompt} $" { + -re "Continuing.*\r\n\\\[Inferior $decimal \\(.*\\) killed\\\]\r\n${gdb_prompt} $" { pass $test } }