This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] gdb.c++/method.exp: xfail for missing const
- From: Michael Elizabeth Chastain <mec at shout dot net>
- To: drow at mvista dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Mon, 8 Apr 2002 13:32:15 -0500
- Subject: [PATCH] gdb.c++/method.exp: xfail for missing const
How about this for printing "this" in a const method?
It reports PASS if the required "const" is present.
It reports (XFAIL|FAIL) with "missing const" if required "const" is missing.
XFAIL if stabs debugging format
FAIL if any other debugging format
It reports FAIL for any other output.
Michael C
===
# Check access to this pointer
#
# gcc versions up to 3.0.4 with -gstabs+ do not emit "const" indicators,
# so the output is "A *". It should be "const A *" or "const A * const".
get_debug_format
send_gdb "print this\n"
gdb_expect {
-re "\\$\[0-9\]* = \\(const (class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
pass "print this in A::bar"
}
-re "\\$\[0-9\]* = \\((class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
setup_xfail_format "stabs"
fail "print this in A::bar (missing const)"
}
-re ".*$gdb_prompt $" { fail "print this in A::bar" }
timeout { fail "(timeout) print this in A::bar" }
}