diff options
author | Andrew Burgess <aburgess@redhat.com> | 2021-11-05 12:14:01 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2021-11-05 12:32:18 +0000 |
commit | 707ed39ac5cb255f656b2947b50c8273c8ad1d80 (patch) | |
tree | 5cf9449ea70f86591897b13b9b002844cf2aa176 /gdb | |
parent | ca8775833bb6af8eb4333f41e4f8672df0ead874 (diff) | |
download | gdb-707ed39ac5cb255f656b2947b50c8273c8ad1d80.zip gdb-707ed39ac5cb255f656b2947b50c8273c8ad1d80.tar.gz gdb-707ed39ac5cb255f656b2947b50c8273c8ad1d80.tar.bz2 |
gdb/testsuite: use gdb_get_line_number
Replaces a hard coded line number with a use of gdb_get_line_number.
I suspect that the line number has, over time, come adrift from where
it was supposed to be stopping. When the test was first added, line
770 pointed at the final 'return 0' in function main. Over time, as
things have been added, line 770 now points at some random location in
the middle of main.
So, I've marked the 'return 0' with a comment, and now the test will
always stop there.
I also removed an old comment from 1997 talking about how these tests
will only pass with the HP compiler, followed by an additional comment
from 2000 saying that the tests now pass with GCC.
I get the same results before and after this change.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/gdb.cp/templates.cc | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/templates.exp | 20 |
2 files changed, 4 insertions, 18 deletions
diff --git a/gdb/testsuite/gdb.cp/templates.cc b/gdb/testsuite/gdb.cp/templates.cc index 49cf6b6..d6120e2 100644 --- a/gdb/testsuite/gdb.cp/templates.cc +++ b/gdb/testsuite/gdb.cp/templates.cc @@ -801,5 +801,5 @@ int main() arg.method(empty); - return 0; + return 0; /* Final breakpoint. */ } diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp index 388c4f26..8370beb 100644 --- a/gdb/testsuite/gdb.cp/templates.exp +++ b/gdb/testsuite/gdb.cp/templates.exp @@ -278,23 +278,9 @@ do_tests # More tests for different kinds of template parameters, # templates with partial specializations, nested templates, etc. -# These have been tested only with HP aCC. They probably won't -# work with other compilers because of differences in mangling -# schemes. -# Added by Satish Pai <pai@apollo.hp.com> 1997-09-25 -# As of 2000-06-03, C++ support has been improved to the point that g++ can -# pass all of theses, excluding what appears to be one that exposes a stabs bug. - djb - -# I don't know how HP could be passing these tests without this. They -# weren't breakpointing past a point where the below expressions were -# initialized in the actual source. - djb - -gdb_test "b 770" \ - "Breakpoint .* at .*, line 770." - -gdb_test "c" \ - "Continuing.*Breakpoint .*" \ - "continue to line 770" + +gdb_breakpoint [gdb_get_line_number "Final breakpoint"] +gdb_continue_to_breakpoint "Final breakpoint" gdb_test "print fint" \ "\\$\[0-9\]* = \\{x = 0, t = 0\\}" |