This patch removes many TODOs from the gdb.cp tests.
Going through the patch:
* bs15503.exp - these have been commented out forever and rely on
libstdc++ debuginfo. It's better to just remove these.
* classes.exp - the test is wrong, I think, according to the C++ ABI
that gdb understands; and the test can be fixed and comments removed
with a simple change to the code.
* ctti.exp - there's no need to bail out any more, as the test works.
* exception.exp - the code relying on the line numbers can't work,
because gdb never prints that message anyway.
Reviewed-By: Bruno Larsen <blarsen@redhat.com>
gdb_test "print s\[s.length()-1\]" "\\$\[0-9\]+ =.* 'g'"
gdb_test "print (const char *) s" \
"\\$\[0-9\]+ = $hex \"I am a short stringand now a longer string\""
-
-# TODO: tests that do not work with gcc 2.95.3
-# -- chastain 2004-01-07
-#
-# gdb_test "print s.compare(s)" "\\$\[0-9\]+ = 0"
-# gdb_test "print s.compare(\"AAA\")" "\\$\[0-9\]+ = 1"
-# gdb_test "print s.compare(\"ZZZ\")" "\\$\[0-9\]+ = -1"
-
-# TODO: tests that do not work with gcc 2.95.3 and gcc 3.3.2.
-# cannot call overloaded non-member operator. -- chastain 2004-01-07
-#
-# gdb_test "print s == s" "\\$\[0-9\]+ = true"
-# gdb_test "print s > "AAA" "\\$\[0-9\]+ = true"
-# gdb_test "print s < "ZZZ" "\\$\[0-9\]+ = true"
-
-# TODO: GDB doesn't know to convert the string to a const char *, and
-# instead tries to use the string as a structure initializer.
-#
-# gdb_test "print s == \"I am a short stringand now a longer string\"" \
-# "\\$\[0-9\]+ = true"
-
-gdb_test "print (const char *) s.substr(0,4)" "\\$\[0-9\]+ = $hex \"I am\""
-gdb_test "print (const char *) (s=s.substr(0,4))" \
- "\\$\[0-9\]+ = $hex \"I am\""
-
-# TODO: cannot call overloaded non-member operator again.
-# -- chastain 2004-01-07
-#
-# gdb_test "print (const char *) (s + s)" \
-# "\\$\[0-9\]+ = $hex \"I amI am\""
-# gdb_test "print (const char *) (s + \" \" + s)" \
-# "\\$\[0-9\]+ = $hex \"I am I am\""
int
main()
{
+ int Foo::* pmi = &Foo::y;
+
dummy();
inheritance1 ();
inheritance3 ();
enums1 ();
- /* FIXME: pmi gets optimized out. Need to do some more computation with
- it or something. (No one notices, because the test is xfail'd anyway,
- but that probably won't always be true...). */
- int Foo::* pmi = &Foo::y;
-
/* Make sure the AIX linker doesn't remove the variable. */
v_tagless.one = 5;
gdb_test "ptype Bar::z" "type = int"
gdb_test "ptype &Bar::z" "type = int Bar::\\*"
- # TODO: this is a bogus test. It's looking at a variable that
- # has not even been declared yet, so it's accessing random junk
- # on the stack and comparing that it's NOT equal to a specific
- # value. It's been like this since gdb 4.10 in 1993!
- # -- chastain 2004-01-01
- gdb_test "print (int)pmi == sizeof(int)" ".* = false"
+ gdb_test "print (int)pmi == sizeof(int)" ".* = true"
}
# Test static members.
gdb_test "print f" "\\$\[0-9\]+ = 9"
gdb_test "print i" "\\$\[0-9\]+ = 4"
-# TODO: this needs more work before actually deploying it.
-# So bail out here.
-
-if {[test_compiler_info gcc-*]} { return }
-
gdb_test_multiple "print add<int>(2,2)" "print add<int>(2,2)" {
-re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
pass "print add<int>(2,2)"
}
-re "No symbol \"add<int>\" in current context.\r\n$gdb_prompt $" {
- # TODO: kfail or xfail this
fail "print add<int>(2,2)"
}
}
pass "print add<float>(2.25,2.25)"
}
-re "No symbol \"add<float>\" in current context.\r\n$gdb_prompt $" {
- # TODO: kfail or xfail this
fail "print add<float>(2.25,2.25)"
}
}
pass "print add<unsigned char>('A','A')"
}
-re "No symbol \"add<unsigned char>\" in current context.\r\n$gdb_prompt $" {
- # TODO: kfail or xfail this
fail "print add<unsigned char>('A','A')"
}
}
pass "print add2<int>(2,2)"
}
-re "No symbol \"add2<int>\" in current context.\r\n$gdb_prompt $" {
- # TODO: kfail or xfail this
fail "print add2<int>(2,2)"
}
}
pass "print add2<float>(2.25,2.25)"
}
-re "No symbol \"add2<float>\" in current context.\r\n$gdb_prompt $" {
- # TODO: kfail or xfail this
fail "print add2<float>(2.25,2.25)"
}
}
pass "print add2<unsigned char>('A','A')"
}
-re "No symbol \"add2<unsigned char>\" in current context.\r\n$gdb_prompt $" {
- # TODO: kfail or xfail this
fail "print add2<unsigned char>('A','A')"
}
}
pass "print add3<int>(2,2)"
}
-re "No symbol \"add3<int>\" in current context.\r\n$gdb_prompt $" {
- # TODO: kfail or xfail this
fail "print add3<int>(2,2)"
}
}
pass "print add3<float>(2.25,2.25)"
}
-re "No symbol \"add3<float>\" in current context.\r\n$gdb_prompt $" {
- # TODO: kfail or xfail this
fail "print add3<float>(2.25,2.25)"
}
}
pass "print add3<unsigned char>('A','A')"
}
-re "No symbol \"add3<unsigned char>\" in current context.\r\n$gdb_prompt $" {
- # TODO: kfail or xfail this
fail "print add3<unsigned char>('A','A')"
}
}
pass "print add4<int>(2,2)"
}
-re "No symbol \"add4<int>\" in current context.\r\n$gdb_prompt $" {
- # TODO: kfail or xfail this
fail "print add4<int>(2,2)"
}
}
pass "print add4<float>(2.25,2.25)"
}
-re "No symbol \"add4<float>\" in current context.\r\n$gdb_prompt $" {
- # TODO: kfail or xfail this
fail "print add4<float>(2.25,2.25)"
}
}
pass "print add4<unsigned char>('A','A')"
}
-re "No symbol \"add4<unsigned char>\" in current context.\r\n$gdb_prompt $" {
- # TODO: kfail or xfail this
fail "print add4<unsigned char>('A','A')"
}
}
# Static-linked executables use a different mechanism to get the
# address of the notification hook in the C++ support library.
-# TODO: this file has many absolute line numbers.
-# Replace them with gdb_get_line_number.
-
set ws "\[\r\n\t \]+"
set nl "\[\r\n\]+"
# Get the first exception thrown
-set name "continue to first throw"
-gdb_test_multiple "continue" $name {
- -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception thrown\\), throw location.*${srcfile}:30, catch location .*${srcfile}:50\r\n$gdb_prompt $" {
- pass $name
- }
- -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception thrown\\).*\r\n$gdb_prompt $" {
- pass $name
- }
-}
+gdb_test "continue" \
+ "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception thrown\\).*" \
+ "continue to first throw"
# Backtrace from the throw point.
# This should get to user code.
# Continue to the catch.
-set name "continue to first catch"
-gdb_test_multiple "continue" $name {
- -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception caught\\), throw location.*${srcfile}:30, catch location .*${srcfile}:50\r\n$gdb_prompt $" {
- pass $name
- }
- -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception caught\\).*\r\n$gdb_prompt $" {
- pass $name
- }
-}
+gdb_test "continue" \
+ "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception caught\\).*" \
+ "continue to first catch"
# Backtrace from the catch point.
# This should get to user code.
# Continue to second throw.
-set name "continue to second throw"
-gdb_test_multiple "continue" $name {
- -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception thrown\\), throw location.*${srcfile}:30, catch location .*${srcfile}:58\r\n$gdb_prompt $" {
- pass $name
- }
- -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception thrown\\).*\r\n$gdb_prompt $" {
- pass $name
- }
-}
+gdb_test "continue" \
+ "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception thrown\\).*" \
+ "continue to second throw"
# Backtrace from the throw point.
# This should get to user code.
# Continue to second catch.
-set name "continue to second catch"
-gdb_test_multiple "continue" $name {
- -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception caught\\), throw location.*${srcfile}:30, catch location .*${srcfile}:58\r\n$gdb_prompt $" {
- pass $name
- }
- -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception caught\\).*\r\n$gdb_prompt $" {
- pass $name
- }
-}
+gdb_test "continue" \
+ "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception caught\\).*" \
+ "continue to second catch"
# Backtrace from the catch point.
# This should get to user code.