binutils-gdb/gdb/testsuite/gdb.base/hw-sw-break-same-address.exp
Pedro Alves e777225bfd gdb/testsuite/: Use "-qualified" in explicit "break main", etc.
Similar to the previous patch, but this time add "-q" to tests that do
"break main", "list main", etc. explicitly.

gdb/testsuite/ChangeLog:

	* config/monitor.exp: Use "list -q".
	* gdb.arch/gdb1558.exp: Use "break -q".
	* gdb.arch/i386-permbkpt.exp: Use "break -q".
	* gdb.arch/i386-prologue-skip-cf-protection.exp: Use "break -q".
	* gdb.base/break.exp: Use "break -q", "list -q" and "tbreak -q".
	* gdb.base/commands.exp: Use "break -q".
	* gdb.base/condbreak.exp: Use "break -q".
	* gdb.base/ctf-ptype.exp: Use "list -q".
	* gdb.base/define.exp: Use "break -q".
	* gdb.base/del.exp: Use "break -q".
	* gdb.base/fullname.exp: Use "break -q".
	* gdb.base/hbreak-in-shr-unsupported.exp: Use "hbreak -q".
	* gdb.base/hbreak-unmapped.exp: Use "hbreak -q".
	* gdb.base/hbreak2.exp: Use "hbreak -q" and "list -q".
	* gdb.base/hw-sw-break-same-address.exp: Use "break -q" and
	"hbreak -q".
	* gdb.base/included.exp: Use "list -q".
	* gdb.base/label.exp: Use "break -q".
	* gdb.base/lineinc.exp: Use "break -q".
	* gdb.base/list.exp: Use "list -q".
	* gdb.base/macscp.exp: Use "list -q".
	* gdb.base/pending.exp: Use "break -q".
	* gdb.base/prologue-include.exp: Use "break -q".
	* gdb.base/ptype.exp: Use "list -q".
	* gdb.base/sepdebug.exp: Use "break -q", "list -q" and "tbreak -q".
	* gdb.base/server-del-break.exp: Use "break -q".
	* gdb.base/style.exp: Use "break -q".
	* gdb.base/symbol-without-target_section.exp: Use "list -q".
	* gdb.base/watchpoint-reuse-slot.exp: Use "hbreak -q".
	* gdb.cp/exception.exp: Use "tbreak -q".
	* gdb.dwarf2/dw2-error.exp: Use "break -q".
	* gdb.dwarf2/fission-mix.exp: Use "break -q".
	* gdb.dwarf2/fission-reread.exp: Use "break -q".
	* gdb.dwarf2/pr13961.exp: Use "break -q".
	* gdb.linespec/explicit.exp: Use "list -q".
	* gdb.linespec/linespec.exp: Use "break -q".
	* gdb.mi/mi-simplerun.exp: Use "--qualified".
	* gdb.python/py-mi-objfile-gdb.py: Use "list -q".
	* gdb.server/bkpt-other-inferior.exp: Use "break -q".
	* gdb.server/connect-without-multi-process.exp: Use "break -q".
	* gdb.trace/change-loc.exp: Use "break -q".
	* gdb.trace/pending.exp: Use "break -q".
	* gdb.tui/basic.exp: Use "list -q".
	* gdb.tui/list-before.exp: Use "list -q".
	* gdb.tui/list.exp: Use "list -q".
	* lib/gdb.exp (gdb_has_argv0): Use "break -q".

Change-Id: Iab9408e90ed71cbb111cd737d2d81b5ba8adb108
2020-10-13 22:34:26 +01:00

74 lines
2.2 KiB
Plaintext

# Copyright 2020 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 inserting a hardware and a software breakpoint at the same
# address behaves as expected. GDB used to consider hw and sw
# breakpoint locations as duplicate locations, which would lead to bad
# behavior. See PR gdb/25741.
if {[skip_hw_breakpoint_tests]} {
return 0
}
set test hbreak
set srcfile ${test}.c
if { [prepare_for_testing "failed to prepare" ${test} ${srcfile}] } {
return -1
}
if ![runto_main] {
fail "can't run to main"
return -1
}
delete_breakpoints
gdb_test_no_output "set breakpoint always-inserted on"
gdb_test_no_output "set breakpoint condition-evaluation host"
gdb_test_no_output "set confirm off"
# Test inserting a hw breakpoint first, then a sw breakpoint at the
# same address.
with_test_prefix "hw-sw" {
gdb_test "hbreak -q main" \
"Hardware assisted breakpoint .* at .*" \
"hbreak"
gdb_test "break -q main" \
"Note: breakpoint .* also set at .*\r\nBreakpoint .* at .*" \
"break"
# A bad GDB debugging against GDBserver would output a warning
# here:
# delete breakpoints
# warning: Error removing breakpoint 3
# (gdb) FAIL: gdb.base/hw-sw-break-same-address.exp: hw-sw: delete breakpoints
gdb_test_no_output "delete breakpoints"
}
# Now the opposite: test inserting a sw breakpoint first, then a hw
# breakpoint at the same address.
with_test_prefix "sw-hw" {
gdb_test "break -q main" \
"Breakpoint .* at .*" \
"break"
gdb_test "hbreak -q main" \
"Note: breakpoint .* also set at .*\r\nHardware assisted breakpoint .* at .*" \
"hbreak"
gdb_test_no_output "delete breakpoints"
}