+# Get the endianness for the later use with endianless formats.
+
+send_gdb "show endian\n"
+gdb_expect {
+ -re ".* (big|little) endian.*$gdb_prompt $" {
+ set endian $expect_out(1,string)
+ pass "endianness: $endian"
+ }
+ default {
+ fail "(timeout) getting target endianness"
+ }
+}
+