From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Keith Seitz Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC/A] testsuite/gdb.c++/ref-types.exp "cleanup" Date: Fri, 19 Oct 2001 15:12:00 -0000 Message-id: <3BD0A54C.4010005@cygnus.com> References: X-SW-Source: 2001-10/msg00268.html > On Fri, 19 Oct 2001, Andrew Cagney wrote: > > >> > +set pattern {.[0-9]* = \(short (int)? &\) @} >> > +append pattern "$hex: -1" > >> >> Is there another way of doing this bit? I'm finding it more confusing >> then all the escape characters? > > > Well, there is, but I don't think anyone would like it any better: > > gdb_test {print foo} [format {%s %s} {.[0-9]* = \(short( int?) &\)} "@$hex: -1"] \ > {print foo test} There has to be something better. Look at some of the patters in MI. They read ``blah $hex more blah $hex even more blah $hex even more blah $hex''. While all those escape characters are bad I think this construct a pattern bit by bit approach is worse. > This is a common tcl thing to do, but, well, I'm not sure it's any better > for, how did someone put it? "beginners". (IMO, the "beginner" thing is a > cop out.) Think of it more as making the testsuite contributor friendly. People create test cases by cloning existing code. People don't create test cases by reading the TCL manual. Can functions like gdb_expect_list and the like be changed to convert their ``string'' into a fixed pattern before passing things on? Andrew