mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-21 04:42:53 +08:00
81f47ac29f
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.
93 lines
3.6 KiB
Plaintext
93 lines
3.6 KiB
Plaintext
# This testcase is part of GDB, the GNU debugger.
|
|
|
|
# Copyright 2007-2019 Free Software Foundation, Inc.
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# 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 that the event messages printed when using 'set print
|
|
# inferior-events [on,off]', 'set follow-fork-mode [child,parent]' and
|
|
# 'set detach-on-fork [on,off]' are the correct ones.
|
|
|
|
# This test relies on "run", so it cannot run on target remote stubs.
|
|
if { [use_gdb_stub] } {
|
|
untested "not supported on target remote stubs"
|
|
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] } {
|
|
return -1
|
|
}
|
|
|
|
# This is the expected output for each of the test combinations
|
|
# below. The order here is important:
|
|
#
|
|
# inferior-events: on; follow-fork: child; detach-on-fork: on
|
|
# inferior-events: on; follow-fork: child; detach-on-fork: off
|
|
# inferior-events: on; follow-fork: parent; detach-on-fork: on
|
|
# inferior-events: on; follow-fork: parent; detach-on-fork: off
|
|
# inferior-events: off; follow-fork: child; detach-on-fork: on
|
|
# inferior-events: off; follow-fork: child; detach-on-fork: off
|
|
# inferior-events: off; follow-fork: parent; detach-on-fork: on
|
|
# inferior-events: off; follow-fork: parent; detach-on-fork: off
|
|
|
|
set reading_re "(Reading.*from remote target\\.\\.\\.\r\n)*"
|
|
set exited_normally_re "${reading_re}\\\[Inferior $decimal \\(.*\\) exited normally\\\]"
|
|
# gdbserver produces a slightly different message when attaching after
|
|
# a fork, so we have to tweak the regexp to accomodate that.
|
|
set attach_child_re "${reading_re}\\\[Attaching after .* fork to child .*\\\]\r\n"
|
|
set detach_child_re "${reading_re}\\\[Detaching after fork from child .*\\\]\r\n"
|
|
set detach_parent_re "${reading_re}\\\[Detaching after fork from parent .*\\\]\r\n"
|
|
set new_inf_re "${reading_re}\\\[New inferior $decimal \\(.*\\)\\\]\r\n"
|
|
set inf_detached_re "${reading_re}\\\[Inferior $decimal \\(.*\\) detached\\\]\r\n"
|
|
|
|
set expected_output [list \
|
|
"${attach_child_re}${new_inf_re}${detach_parent_re}${inf_detached_re}" \
|
|
"${attach_child_re}${new_inf_re}" \
|
|
"${detach_child_re}" \
|
|
"${new_inf_re}" \
|
|
"" \
|
|
"" \
|
|
"" \
|
|
"" \
|
|
]
|
|
|
|
set i 0
|
|
|
|
foreach_with_prefix print_inferior_events { "on" "off" } {
|
|
foreach_with_prefix follow_fork_mode { "child" "parent" } {
|
|
foreach_with_prefix detach_on_fork { "on" "off" } {
|
|
clean_restart $binfile
|
|
gdb_test_no_output "set print inferior-events $print_inferior_events"
|
|
gdb_test_no_output "set follow-fork-mode $follow_fork_mode"
|
|
gdb_test_no_output "set detach-on-fork $detach_on_fork"
|
|
|
|
set output [lindex $expected_output $i]
|
|
# Always add the "Starting program..." string so that we
|
|
# match exactly the lines we want.
|
|
set output "Starting program: $binfile\\s*\r\n${output}${exited_normally_re}"
|
|
set i [expr $i + 1]
|
|
gdb_test "run" $output
|
|
}
|
|
}
|
|
}
|