From patchwork Mon Apr 29 12:50:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 32456 Received: (qmail 7284 invoked by alias); 29 Apr 2019 12:51:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 7169 invoked by uid 89); 29 Apr 2019 12:51:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, MIME_BASE64_BLANKS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=modes, 2011, 13, 6, sk:gdb_py_ X-HELO: EUR02-VE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr20041.outbound.protection.outlook.com (HELO EUR02-VE1-obe.outbound.protection.outlook.com) (40.107.2.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Apr 2019 12:51:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KTq6a5ImR89FeyGNxb87TwZzbcwAhdXfGo9RxGqoeok=; b=nZAz8nttJL6VvVY/1ptndPH3DNrqmByzYl2Nr98MJ62sp1gM/F8vGRguaCgB3MoX+MZ+AugI1Sum79GKOJIQY95uT+eQTl6APHIf1Sl3Ml+YFQmNO/JzYPhd/y9P2YcB68/C+Nu9ckdaity624m86XKZCY+PBCMAbTYH+kIyUUE= Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com (10.172.227.22) by DB6PR0802MB2518.eurprd08.prod.outlook.com (10.172.245.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.15; Mon, 29 Apr 2019 12:50:49 +0000 Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::399b:3a32:bff9:827e]) by DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::399b:3a32:bff9:827e%11]) with mapi id 15.20.1835.018; Mon, 29 Apr 2019 12:50:49 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd , Alan Hayward Subject: [PATCH v2 4/4] testsuite: Disable some tests when logging Date: Mon, 29 Apr 2019 12:50:49 +0000 Message-ID: <20190429125041.15266-5-alan.hayward@arm.com> References: <20190429125041.15266-1-alan.hayward@arm.com> In-Reply-To: <20190429125041.15266-1-alan.hayward@arm.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; x-ms-exchange-purlcount: 1 x-ms-oob-tlc-oobclassifiers: OLM:8882; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-IsSubscribed: yes Fix up all failures encountered when running the testsuite with GDB_DEBUG="infrun". Some tests rely on enabling debugging for various components. With debugging on, this will be lost to the debug file. Disable separate tty for mi tests when debugging. This currently does not work. Some tests rely on output which is being sent to the debug stream. It could be argued this output should instead go to stderr. disasm.c should send errors to the stderr instead of the logfile. Note that enabling debug for other components might still cause additional errors above what has been fixed here. gdb/ChangeLog: 2019-04-29 Alan Hayward * disasm.c (set_disassembler_options): Send errors to stderr. gdb/testsuite/ChangeLog: 2019-04-29 Alan Hayward * gdb.base/breakpoint-in-ro-region.exp: Disable when debugging. * gdb.base/debug-expr.exp: Likewise. * gdb.base/foll-fork.exp: Likewise. * gdb.base/foll-vfork.exp: Likewise. * gdb.base/fork-print-inferior-events.exp: Likewise. * gdb.base/gdb-sigterm.exp: Likewise. * gdb.base/gdbinit-history.exp: Likewise. * gdb.base/osabi.exp: Likewise. * gdb.base/sss-bp-on-user-bp-2.exp: Likewise. * gdb.base/ui-redirect.exp: Likewise. * gdb.gdb/unittest.exp: Likewise. * gdb.mi/mi-break.exp: Disable separate-mi-tty when debugging. * gdb.mi/mi-watch.exp: Likewise. * gdb.mi/new-ui-mi-sync.exp: Likewise. * gdb.mi/user-selected-context-sync.exp: Likewise. * gdb.python/python.exp: Disable debug test when debugging. * gdb.threads/check-libthread-db.exp: Disable when debugging. * gdb.threads/signal-while-stepping-over-bp-other-thread.exp: Likewise. * gdb.threads/stepi-random-signal.exp: Likewise. --- gdb/disasm.c | 4 ++-- gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp | 6 ++++++ gdb/testsuite/gdb.base/debug-expr.exp | 6 ++++++ gdb/testsuite/gdb.base/foll-fork.exp | 6 ++++++ gdb/testsuite/gdb.base/foll-vfork.exp | 6 ++++++ gdb/testsuite/gdb.base/fork-print-inferior-events.exp | 6 ++++++ gdb/testsuite/gdb.base/gdb-sigterm.exp | 6 ++++++ gdb/testsuite/gdb.base/gdbinit-history.exp | 5 +++++ gdb/testsuite/gdb.base/osabi.exp | 6 ++++++ gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp | 6 ++++++ gdb/testsuite/gdb.base/ui-redirect.exp | 5 +++++ gdb/testsuite/gdb.gdb/unittest.exp | 6 ++++++ gdb/testsuite/gdb.mi/mi-break.exp | 9 ++++++++- gdb/testsuite/gdb.mi/mi-watch.exp | 9 ++++++++- gdb/testsuite/gdb.mi/new-ui-mi-sync.exp | 5 +++++ gdb/testsuite/gdb.mi/user-selected-context-sync.exp | 5 +++++ gdb/testsuite/gdb.python/python.exp | 5 ++++- gdb/testsuite/gdb.threads/check-libthread-db.exp | 6 ++++++ .../signal-while-stepping-over-bp-other-thread.exp | 6 ++++++ gdb/testsuite/gdb.threads/stepi-random-signal.exp | 6 ++++++ 20 files changed, 114 insertions(+), 5 deletions(-) -- 2.20.1 (Apple Git-117) diff --git a/gdb/disasm.c b/gdb/disasm.c index 7c7a148935..ed740c26e0 100644 --- a/gdb/disasm.c +++ b/gdb/disasm.c @@ -943,7 +943,7 @@ set_disassembler_options (char *prospective_options) valid_options_and_args = gdbarch_valid_disassembler_options (gdbarch); if (valid_options_and_args == NULL) { - fprintf_filtered (gdb_stdlog, _("\ + fprintf_filtered (gdb_stderr, _("\ 'set disassembler-options ...' is not supported on this architecture.\n")); return; } @@ -979,7 +979,7 @@ set_disassembler_options (char *prospective_options) break; if (valid_options->name[i] == NULL) { - fprintf_filtered (gdb_stdlog, + fprintf_filtered (gdb_stderr, _("Invalid disassembler option value: '%s'.\n"), opt); return; diff --git a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp index 8655f54e03..a54d712f08 100644 --- a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp +++ b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp @@ -15,6 +15,12 @@ # This file is part of the gdb testsuite +# Test relies on checking gdb debug ouput. Do not run if gdb debug is +# enabled as any debug will be redirected to the log. +if [gdb_debug_enabled] { + continue +} + standard_testfile if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { diff --git a/gdb/testsuite/gdb.base/debug-expr.exp b/gdb/testsuite/gdb.base/debug-expr.exp index 8885ec6b9b..80bb75851e 100644 --- a/gdb/testsuite/gdb.base/debug-expr.exp +++ b/gdb/testsuite/gdb.base/debug-expr.exp @@ -15,6 +15,12 @@ # Test "set debug expr 1" on c expressions. +# Test relies on checking gdb debug ouput. Do not run if gdb debug is +# enabled as any debug will be redirected to the log. +if [gdb_debug_enabled] { + return 0 +} + standard_testfile .c if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} { diff --git a/gdb/testsuite/gdb.base/foll-fork.exp b/gdb/testsuite/gdb.base/foll-fork.exp index 8884686928..3befabbbf6 100644 --- a/gdb/testsuite/gdb.base/foll-fork.exp +++ b/gdb/testsuite/gdb.base/foll-fork.exp @@ -20,6 +20,12 @@ if { ![istarget "*-*-linux*"] && ![istarget "*-*-openbsd*"] } then { continue } +# Test relies on checking follow-fork ouput. Do not run if gdb debug is +# enabled as it will be redirected to the log. +if [gdb_debug_enabled] { + continue +} + standard_testfile if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { diff --git a/gdb/testsuite/gdb.base/foll-vfork.exp b/gdb/testsuite/gdb.base/foll-vfork.exp index 96d8539bee..ae0441d6a5 100644 --- a/gdb/testsuite/gdb.base/foll-vfork.exp +++ b/gdb/testsuite/gdb.base/foll-vfork.exp @@ -25,6 +25,12 @@ if {![istarget "*-linux*"]} then { continue } +# Test relies on checking follow-fork ouput. Do not run if gdb debug is +# enabled as it will be redirected to the log. +if [gdb_debug_enabled] { + continue +} + standard_testfile set compile_options debug diff --git a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp index 1c5a470bd6..33f80eafb3 100644 --- a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp +++ b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp @@ -25,6 +25,12 @@ if { [use_gdb_stub] } { return } +# Test relies on checking follow-fork ouput. Do not run if gdb debug is +# enabled as it will be redirected to the log. +if [gdb_debug_enabled] { + continue +} + standard_testfile if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } { diff --git a/gdb/testsuite/gdb.base/gdb-sigterm.exp b/gdb/testsuite/gdb.base/gdb-sigterm.exp index 36d24fcc56..44fbbdc38a 100644 --- a/gdb/testsuite/gdb.base/gdb-sigterm.exp +++ b/gdb/testsuite/gdb.base/gdb-sigterm.exp @@ -15,6 +15,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Test relies on checking gdb debug ouput. Do not run if gdb debug is +# enabled as any debug will be redirected to the log. +if [gdb_debug_enabled] { + continue +} + standard_testfile # The test program exits after a while, in case GDB crashes. Make it diff --git a/gdb/testsuite/gdb.base/gdbinit-history.exp b/gdb/testsuite/gdb.base/gdbinit-history.exp index f4f0686ccc..8710010cf7 100644 --- a/gdb/testsuite/gdb.base/gdbinit-history.exp +++ b/gdb/testsuite/gdb.base/gdbinit-history.exp @@ -21,6 +21,11 @@ # We cannot expect remote hosts to see environment variables set on the # local machine. +# Do not run if gdb debug is enabled - it interferes with the command history. +if [gdb_debug_enabled] { + continue +} + if { [is_remote host] } { unsupported "can't set environment variables on remote host" return -1 diff --git a/gdb/testsuite/gdb.base/osabi.exp b/gdb/testsuite/gdb.base/osabi.exp index 50146311f7..ed94ecf4ec 100644 --- a/gdb/testsuite/gdb.base/osabi.exp +++ b/gdb/testsuite/gdb.base/osabi.exp @@ -15,6 +15,12 @@ # This file is part of the gdb testsuite. +# Test relies on checking gdb debug ouput. Do not run if gdb debug is +# enabled as any debug will be redirected to the log. +if [gdb_debug_enabled] { + continue +} + # Test that choosing "set osabi none" really requests a gdbarch with no osabi. proc test_set_osabi_none { } { diff --git a/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp b/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp index 898233afa4..b07a8fffbf 100644 --- a/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp +++ b/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp @@ -31,6 +31,12 @@ # 4 - The single-step finishes, and GDB removes the single-step # breakpoint. +# Test relies on checking gdb debug ouput. Do not run if gdb debug is +# enabled as any debug will be redirected to the log. +if [gdb_debug_enabled] { + continue +} + standard_testfile if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { diff --git a/gdb/testsuite/gdb.base/ui-redirect.exp b/gdb/testsuite/gdb.base/ui-redirect.exp index e62d5e8341..55bd495267 100644 --- a/gdb/testsuite/gdb.base/ui-redirect.exp +++ b/gdb/testsuite/gdb.base/ui-redirect.exp @@ -13,6 +13,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Do not run if gdb debug is enabled as it will interfere with log redirect. +if [gdb_debug_enabled] { + return 0 +} + if { [prepare_for_testing "failed to prepare" ui-redirect start.c] } { return -1 } diff --git a/gdb/testsuite/gdb.gdb/unittest.exp b/gdb/testsuite/gdb.gdb/unittest.exp index 09c603059f..6f1f29a03f 100644 --- a/gdb/testsuite/gdb.gdb/unittest.exp +++ b/gdb/testsuite/gdb.gdb/unittest.exp @@ -13,6 +13,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Do not run if gdb debug is enabled as maintenance output will be +# redirected to the log files. +if [gdb_debug_enabled] { + continue +} + set do_xml_test [expr ![gdb_skip_xml_test]] gdb_start diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp index 365e4faa81..c517ce886f 100644 --- a/gdb/testsuite/gdb.mi/mi-break.exp +++ b/gdb/testsuite/gdb.mi/mi-break.exp @@ -429,6 +429,13 @@ proc test_break {mi_mode} { test_explicit_breakpoints } -foreach_with_prefix mi-mode {"main" "separate"} { +if [gdb_debug_enabled] { + # gdb debug doesn't work for separate-mi-tty. + set modes {"main"} +} else { + set modes {"main" "separate"} +} + +foreach_with_prefix mi-mode $modes { test_break ${mi-mode} } diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp index e7c59c8fb7..23cc178d71 100644 --- a/gdb/testsuite/gdb.mi/mi-watch.exp +++ b/gdb/testsuite/gdb.mi/mi-watch.exp @@ -174,9 +174,16 @@ proc test_watchpoint_all {mi_mode type} { test_watchpoint_triggering } +if [gdb_debug_enabled] { + # gdb debug doesn't work for separate-mi-tty. + set modes {"main"} +} else { + set modes {"main" "separate"} +} + # Run the tests twice, once using software watchpoints, and another # with hardware watchpoints. -foreach_with_prefix mi-mode {"main" "separate"} { +foreach_with_prefix mi-mode $modes { foreach_with_prefix wp-type {"sw" "hw"} { test_watchpoint_all ${mi-mode} ${wp-type} } diff --git a/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp b/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp index c9de792e28..c280022417 100644 --- a/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp +++ b/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp @@ -20,6 +20,11 @@ # commands, MI should not process further commands until the inferior # stops again. See PR gdb/20418. +# Do not run if gdb debug is enabled as it doesn't work for separate-mi-tty. +if [gdb_debug_enabled] { + return 0 +} + load_lib mi-support.exp standard_testfile diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp index 989bc56d35..2a22e7261c 100644 --- a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp +++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp @@ -29,6 +29,11 @@ # - Thread 3 of each inferior is either stopped at /* thread loop line */, if we # are using all-stop, or running, if we are using non-stop. +# Do not run if gdb debug is enabled as it doesn't work for separate-mi-tty. +if [gdb_debug_enabled] { + return 0 +} + load_lib mi-support.exp standard_testfile diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index b62572ceb8..3b5d1a462c 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -293,7 +293,10 @@ gdb_test "python print (sys.stdout)" ".*gdb.GdbOutputFile (instance|object) at.* gdb_test "python gdb.write(\"Foo\\n\")" "Foo" "test default write" gdb_test "python gdb.write(\"Error stream\\n\", stream=gdb.STDERR)" "Error stream" "test stderr write" gdb_test "python gdb.write(\"Normal stream\\n\", stream=gdb.STDOUT)" "Normal stream" "test stdout write" -gdb_test "python gdb.write(\"Log stream\\n\", stream=gdb.STDLOG)" "Log stream" "test stdlog write" + +if ![gdb_debug_enabled] { + gdb_test "python gdb.write(\"Log stream\\n\", stream=gdb.STDLOG)" "Log stream" "test stdlog write" +} # Turn on full stack printing for subsequent tests. gdb_py_test_silent_cmd "set python print-stack full" \ diff --git a/gdb/testsuite/gdb.threads/check-libthread-db.exp b/gdb/testsuite/gdb.threads/check-libthread-db.exp index b569079f46..46234acf78 100644 --- a/gdb/testsuite/gdb.threads/check-libthread-db.exp +++ b/gdb/testsuite/gdb.threads/check-libthread-db.exp @@ -18,6 +18,12 @@ if {[target_info gdb_protocol] != "" || ![istarget *-linux*]} { continue } +# Test relies on checking gdb debug ouput. Do not run if gdb debug is +# enabled as any debug will be redirected to the log. +if [gdb_debug_enabled] { + continue +} + standard_testfile if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ diff --git a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp index 7043a7a9f9..a531528db0 100644 --- a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp +++ b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp @@ -18,6 +18,12 @@ # stop, when the thread that hit that breakpoint is not the stepped # thread. +# Test relies on checking gdb debug ouput. Do not run if gdb debug is +# enabled as any debug will be redirected to the log. +if [gdb_debug_enabled] { + continue +} + standard_testfile set executable ${testfile} diff --git a/gdb/testsuite/gdb.threads/stepi-random-signal.exp b/gdb/testsuite/gdb.threads/stepi-random-signal.exp index ce93bed501..f2c1a0ecc8 100644 --- a/gdb/testsuite/gdb.threads/stepi-random-signal.exp +++ b/gdb/testsuite/gdb.threads/stepi-random-signal.exp @@ -13,6 +13,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Test relies on checking gdb debug ouput. Do not run if gdb debug is +# enabled as any debug will be redirected to the log. +if [gdb_debug_enabled] { + continue +} + standard_testfile set executable ${testfile}