-# Copyright 2012-2017 Free Software Foundation, Inc.
+# Copyright 2012-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
gdb_test "break $linespec" [string_to_regexp \
[eval format \$error_messages($msg_id) \
- $args]]
+ $args]] \
+ "'break $linespec'"
}
# Some commonly used whitespace tests around ':'.
foreach x $invalid_offsets {
set offset $x
- # Relative offsets are relative to line 16. Adjust
+ # Relative offsets are relative to the current line. Adjust
# expected offset from error message accordingly.
if {[string index $x 0] == "+" || [string index $x 0] == "-"} {
- incr offset 24
+ incr offset $bp_location
}
test_break $x invalid_offset $offset
test_break "-line $x" invalid_offset $offset
# Test that option lexing stops at whitespace boundaries, except
# when lexing function names, where we want to handle setting
# breakpoints on e.g., "int template_function<int>()".
- test_break "-source this file has spaces.c -line 3" invalid_file "this"
+ test_break "-source this file has spaces.c -line 3" source_incomplete
test_break "-function ret_type tmpl_function" \
invalid_function "ret_type tmpl_function"
test_break "-source $srcfile -function ret_type tmpl_function" \
foreach x $spaces {
test_break "main${x}there" invalid_label "there" "main"
- if {[test_compiler_info {clang-*-*}]} {
- setup_xfail clang/14500 *-*-*
- }
test_break "main:here${x}" unexpected "end of input"
}
- foreach x {"3" "+100" "-100" "foo"} {
+ foreach_with_prefix x {"3" "+100" "-100" "foo"} {
test_break "main 3" invalid_function "main 3"
test_break "-function \"main $x\"" invalid_function "main $x"
if {$x == "foo"} {
# Explicit linespec-specific tests
test_break "-source $srcfile" source_incomplete
+ test_break "-source $srcfile main" source_incomplete
}
foreach_with_prefix lang {"C" "C++"} {