testsuite: Disable some tests when logging
authorAlan Hayward <alan.hayward@arm.com>
Fri, 17 May 2019 14:35:08 +0000 (15:35 +0100)
committerAlan Hayward <alan.hayward@arm.com>
Fri, 17 May 2019 14:35:08 +0000 (15:35 +0100)
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.

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:

* disasm.c (set_disassembler_options): Send errors to stderr.

gdb/testsuite/ChangeLog:

* 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.

22 files changed:
gdb/ChangeLog
gdb/disasm.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
gdb/testsuite/gdb.base/debug-expr.exp
gdb/testsuite/gdb.base/foll-fork.exp
gdb/testsuite/gdb.base/foll-vfork.exp
gdb/testsuite/gdb.base/fork-print-inferior-events.exp
gdb/testsuite/gdb.base/gdb-sigterm.exp
gdb/testsuite/gdb.base/gdbinit-history.exp
gdb/testsuite/gdb.base/osabi.exp
gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp
gdb/testsuite/gdb.base/ui-redirect.exp
gdb/testsuite/gdb.gdb/unittest.exp
gdb/testsuite/gdb.mi/mi-break.exp
gdb/testsuite/gdb.mi/mi-watch.exp
gdb/testsuite/gdb.mi/new-ui-mi-sync.exp
gdb/testsuite/gdb.mi/user-selected-context-sync.exp
gdb/testsuite/gdb.python/python.exp
gdb/testsuite/gdb.threads/check-libthread-db.exp
gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
gdb/testsuite/gdb.threads/stepi-random-signal.exp

index 0e79bd0e6b44f00b896e08e6b8f604164e612d80..8d8a6789ab3809456921fc04df2552dcbbe5a2b1 100644 (file)
@@ -1,3 +1,7 @@
+2019-05-17  Alan Hayward  <alan.hayward@arm.com>
+
+       * disasm.c (set_disassembler_options): Send errors to stderr.
+
 2019-05-17  Alan Hayward  <alan.hayward@arm.com>
 
        * cli/cli-interp.c (struct saved_output_files): Add saved entry.
index 7c7a148935e3b65e99cc3db1cfe3bdfa4ffeae02..ed740c26e0fcd94c455b8ae77c64298700c1f9ad 100644 (file)
@@ -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;
index e76a1017c8fd8d0a5eb2f430f1bc2f2a48e2f0c2..724bd51efcbe5486b9d8c58bc023ac1783505166 100644 (file)
@@ -1,20 +1,43 @@
+2019-05-17  Alan Hayward  <alan.hayward@arm.com>
+
+       * 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.
+
 2019-05-17  Alan Hayward  <alan.hayward@arm.com>
 
        * Makefile.in: Pass through GDB_DEBUG.
        * README (Testsuite Parameters): Add GDB_DEBUG.
-        (gdb,debug): Add board setting.
-       * lib/gdb.exp (default_gdb_start): Start debugging.
-       (gdb_debug_enabled): New procedure.
-       (gdb_debug_init): Likewise.
+       (gdb,debug): Add board setting.
+       * lib/gdb.exp (default_gdb_start): Start debugging.
+       (gdb_debug_enabled): New procedure.
+       (gdb_debug_init): Likewise.
 
 2019-05-17  Alan Hayward  <alan.hayward@arm.com>
-
+       
        * Makefile.in: Pass through GDB_DEBUG.
        * README (Testsuite Parameters): Add GDB_DEBUG.
-        (gdb,debug): Add board setting.
-       * lib/gdb.exp (default_gdb_start): Start debugging.
-       (gdb_debug_enabled): New procedure.
-       (gdb_debug_init): Likewise.
+       (gdb,debug): Add board setting.
+       * lib/gdb.exp (default_gdb_start): Start debugging.
+       (gdb_debug_enabled): New procedure.
+       (gdb_debug_init): Likewise.
 
 2019-05-17  Alan Hayward  <alan.hayward@arm.com>
 
index 8655f54e038659f0cd613154522c08b55ce9167f..9099df0a08b64c76bf8f3c4b93fcc78dbeab6f67 100644 (file)
 
 # This file is part of the gdb testsuite
 
+# Test relies on checking gdb debug output. Do not run if gdb debug is
+# enabled as any debug will be redirected to the log.
+if [gdb_debug_enabled] {
+    untested "debug is enabled"
+    return 0
+}
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
index 8885ec6b9b08c5d98e278f5bce770a4e8d36f08d..6da591b9cadade6e56d1fd599b102b62c7a59d90 100644 (file)
 
 # Test "set debug expr 1" on c expressions.
 
+# Test relies on checking gdb debug output. Do not run if gdb debug is
+# enabled as any debug will be redirected to the log.
+if [gdb_debug_enabled] {
+    untested "debug is enabled"
+    return 0
+}
+
 standard_testfile .c
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
index 8884686928d355588cda0cf484c61746164a298e..9f27c4c962cc16dc454f76aff5905eebe86d2c35 100644 (file)
@@ -20,6 +20,13 @@ if { ![istarget "*-*-linux*"] && ![istarget "*-*-openbsd*"] } then {
     continue
 }
 
+# Test relies on checking follow-fork output. Do not run if gdb debug is
+# enabled as it will be redirected to the log.
+if [gdb_debug_enabled] {
+    untested "debug is enabled"
+    return 0
+}
+
 standard_testfile
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
index 96d8539bee832eefdc1d7d840c224346fa1d4712..7bfebb2a91f06dc954469b64da8b1c36f642eb34 100644 (file)
@@ -25,6 +25,13 @@ if {![istarget "*-linux*"]} then {
     continue
 }
 
+# Test relies on checking follow-fork output. Do not run if gdb debug is
+# enabled as it will be redirected to the log.
+if [gdb_debug_enabled] {
+    untested "debug is enabled"
+    return 0
+}
+
 standard_testfile
 
 set compile_options debug
index 1c5a470bd6b28d426181082f4bd428d38701fb26..2befdd8edec08aec3caf4e57a1066c81d1844e90 100644 (file)
@@ -25,6 +25,13 @@ if { [use_gdb_stub] } {
     return
 }
 
+# Test relies on checking follow-fork output. Do not run if gdb debug is
+# enabled as it will be redirected to the log.
+if [gdb_debug_enabled] {
+    untested "debug is enabled"
+    return 0
+}
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
index 36d24fcc562c1f992ca7a7a420a54fd7c8d69e12..f0a26c6085ca404c0f520195270c3a44a0b928de 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Test relies on checking gdb debug output. Do not run if gdb debug is
+# enabled as any debug will be redirected to the log.
+if [gdb_debug_enabled] {
+    untested "debug is enabled"
+    return 0
+}
+
 standard_testfile
 
 # The test program exits after a while, in case GDB crashes.  Make it
index f4f0686ccc12d26ce28e0bcf09f897a5f2917990..b45e7116d9eda9e5033e59f224f3b9cd3c6e5e70 100644 (file)
 # 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] {
+    untested "debug is enabled"
+    return 0
+}
+
 if { [is_remote host] } {
     unsupported "can't set environment variables on remote host"
     return -1
index 50146311f7ef920b450d783dd931a4c5123b8fdc..f4418cac656df70ef6fd9b0b01ae7cf53c901cb8 100644 (file)
 
 # This file is part of the gdb testsuite.
 
+# Test relies on checking gdb debug output. Do not run if gdb debug is
+# enabled as any debug will be redirected to the log.
+if [gdb_debug_enabled] {
+    untested "debug is enabled"
+    return 0
+}
+
 # Test that choosing "set osabi none" really requests a gdbarch with no osabi.
 
 proc test_set_osabi_none { } {
index 898233afa44c2745c5e8e1900156da8868371a30..d25ad794cb07a35e61052c1e0005361e7b75083e 100644 (file)
 # 4 - The single-step finishes, and GDB removes the single-step
 #     breakpoint.
 
+# Test relies on checking gdb debug output. Do not run if gdb debug is
+# enabled as any debug will be redirected to the log.
+if [gdb_debug_enabled] {
+    untested "debug is enabled"
+    return 0
+}
+
 standard_testfile
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
index e62d5e8341c6ccc1b896c71763a098f548223025..4507ac51a27d81b5e47eb4a0f67682951c8ac8ff 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Do not run if gdb debug is enabled as it will interfere with log redirect.
+if [gdb_debug_enabled] {
+    untested "debug is enabled"
+    return 0
+}
+
 if { [prepare_for_testing "failed to prepare" ui-redirect start.c] } {
     return -1
 }
index 09c603059f20b92894390bbcc9b24adf97294a60..e6ec628049542ae6f32ee1f8e3095283ff58abc5 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Do not run if gdb debug is enabled as maintenance output will be
+# redirected to the log files.
+if [gdb_debug_enabled] {
+    untested "debug is enabled"
+    return 0
+}
+
 set do_xml_test [expr ![gdb_skip_xml_test]]
 
 gdb_start
index 365e4faa81d23901008c94168099c9a28fdd24bf..c517ce886fab14a6d42628d7367c8bb623d14d61 100644 (file)
@@ -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}
 }
index e7c59c8fb75eb199102eac1beddafdfa88816984..23cc178d71a95a94ac2b621b76a1f0d8ecb06e58 100644 (file)
@@ -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}
     }
index c9de792e28aa84b3fe6e6b0619b3f4411231d47b..5560a8be966fa0163f4729db96ca252412694508 100644 (file)
 # 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] {
+    untested "debug is enabled"
+    return 0
+}
+
 load_lib mi-support.exp
 
 standard_testfile
index 989bc56d35b76c3d09b6c3f601ea287a3acfef02..621b4c5163b48aa0c8b96bcf1c969b3bf28cd3b7 100644 (file)
 # - 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] {
+    untested "debug is enabled"
+    return 0
+}
+
 load_lib mi-support.exp
 
 standard_testfile
index b62572ceb88ec58282d8e652b31b44b1c00c60ec..3b5d1a462c1926da620aee383984f3ac65db8122 100644 (file)
@@ -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" \
index b569079f462c29a0e4938f339b7cb0be6be279e1..6baa4910d38769205a2685af04849e80dd5945c2 100644 (file)
@@ -18,6 +18,13 @@ if {[target_info gdb_protocol] != "" || ![istarget *-linux*]} {
     continue
 }
 
+# Test relies on checking gdb debug output. Do not run if gdb debug is
+# enabled as any debug will be redirected to the log.
+if [gdb_debug_enabled] {
+    untested "debug is enabled"
+    return 0
+}
+
 standard_testfile
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
index 7043a7a9f9f5158d3a1ad6fa15de0a5eeedc7904..9fb3762934c9c1cff0f3e5a23fa67eb554623820 100644 (file)
 # stop, when the thread that hit that breakpoint is not the stepped
 # thread.
 
+# Test relies on checking gdb debug output. 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}
 
index ce93bed501a05e9a4ac0ab7fa9a80b8c4897c291..fd593c38e41754582f1c507e34a5f5c8fbe9daca 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Test relies on checking gdb debug output. Do not run if gdb debug is
+# enabled as any debug will be redirected to the log.
+if [gdb_debug_enabled] {
+    untested "debug is enabled"
+    return 0
+}
+
 standard_testfile
 set executable ${testfile}
 
This page took 0.038729 seconds and 4 git commands to generate.