This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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" }
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]