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]

Re: [RFC/A] testsuite/gdb.c++/ref-types.exp "cleanup"


On Fri, 19 Oct 2001, Fernando Nasser wrote:

> > +gdb_test {ptype as} {type = short (int)? \[4\]} {ptype as}
> >
> > -send_gdb "ptype as\n"
> > -gdb_expect {
> > -    -re "type = short \\\[4\\\].*$gdb_prompt $"  { pass "ptype as" }
> > -    -re "type = short int \\\[4\\\].*$gdb_prompt $"  { pass "ptype as" }
> > -    -re ".*$gdb_prompt $"   {  fail "ptype as" }
> > -    timeout             { fail "(timeout) ptype as" }
> > -}
>
> I wonder if the extra space in the new pattern would not make it fail.

Oops. Late night braindeath. I actually wrote it this way to begin with,
then noticed that changing it from "( int)?" to " (int)?" had no effect on
linux and solaris deduced that it didn't make a difference. Of course it
doesn't! Both machines print out "short int [4]"! I will change these from
"short (int)?" to "short( int)?":

expect1.23> regexp {type = short (int)? \[4\].*(gdb)} {type = short int [4] (gdb)}
1
expect1.24> regexp {type = short (int)? \[4\].*(gdb)} {type = short [4] (gdb)}
0
expect1.25> regexp {type = short( int)? \[4\].*(gdb)} {type = short [4]
(gdb)}
1
expect1.26> regexp {type = short( int)? \[4\].*(gdb)} {type = short int [4] (gdb)}
1

> Of course you could make it "( int)?", but with the size of the change
> it is hard to find all these cases or to inspect them visually and not
> miss anything.

That's why we've got emacs! ;-)

Thanks for keeping me honest!
Keith



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