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]

Re: RFC: gdb_test_multiple


Daniel Jacobowitz writes:

  set msg "breakpoint on Foo::Bar"
  gdb_test_multiple "break Foo::Bar" "breakpoint on Foo::Bar" {
  ... fail "$msg ...
  }

This can be improved to:

  set msg "breakpoint on Foo::Bar"
  gdb_test_multiple "break Foo::Bar" $msg {
  ... fail $msg ...
  }

The grammar would still allow different messages for the explicit
messages given by the caller versus the internal messages generated
by gdb_test_multiple.  But the normal idiom would have one $msg.

  gdb_test_multiple "break Foo::Bar" "breakpoint on Foo::Bar" \
    "Breakpoint at .*\[\r\n\]$gdb_prompt $" { pass $msg } \
    "Bang." { kfail "gdb/90211" $msg }

Err, I like my treatment of $msg better, I dislike subroutines that
create variables like this for little inferior blocks of code.
But maybe I have poor taste in TCL style.

Michael C


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