This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 04/11] Little-endian fixes: VSX tests and pseudo-regs
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: brobecker at adacore dot com (Joel Brobecker)
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 29 Jan 2014 19:06:14 +0100 (CET)
- Subject: Re: [PATCH 04/11] Little-endian fixes: VSX tests and pseudo-regs
- Authentication-results: sourceware.org; auth=none
Joel Brobecker wrote:
> > +send_gdb "show endian\n"
> > +set endianness ""
> > +gdb_expect {
> > + -re "(The target endianness is set automatically .currently )(big|little)( endian.*)$gdb_prompt $" {
> > + pass "endianness"
> > + set endianness $expect_out(2,string)
> > + }
> > + -re ".*$gdb_prompt $" {
> > + fail "couldn't get endianness"
> > + }
> > + timeout { fail "(timeout) endianness" }
>
> Can you use test_gdb_multiple instead? That should allow you to simplify
> this a little by not having to handle the timeout. Generally speaking,
> we now prefer not to use send_gdb+gdb_expect unless we absolutely have to.
Ah, right. I've just copied this block from altivec-regs.exp, but you're
of course right that gdb_test_multiple is better. I've changed this now,
and also copied the new test back to altivec-regs.exp:
+set endianness ""
+set msg "detect endianness"
+gdb_test_multiple "show endian" "$msg" {
+ -re "(The target endianness is set automatically .currently )(big|little)( endian.*)$gdb_prompt $" {
+ pass "$msg"
+ set endianness $expect_out(2,string)
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$msg"
+ }
+}
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com