This is the mail archive of the gdb-patches@sourceware.org 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: [PATCH 04/11] Little-endian fixes: VSX tests and pseudo-regs


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


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