From 805acca042afed8e8431c92ab031167b03475676 Mon Sep 17 00:00:00 2001 From: Andreas Arnez Date: Tue, 13 Jun 2017 15:20:26 +0200 Subject: gdb/testsuite: Add "get_endianness" convenience proc The test suite contains multiple instances of determining the target's endianness with GDB's "show endian" command. This patch replaces these by an invocation of a new convenience proc 'get_endianness'. gdb/testsuite/ChangeLog: * lib/gdb.exp (get_endianness): New proc. * gdb.arch/aarch64-fp.exp: Use it. * gdb.arch/altivec-regs.exp: Likewise. * gdb.arch/e500-regs.exp: Likewise. * gdb.arch/vsx-regs.exp: Likewise. * gdb.base/dump.exp: Likewise. * gdb.base/funcargs.exp: Likewise. * gdb.base/gnu_vector.exp: Likewise. * gdb.dwarf2/formdata16.exp: Likewise. * gdb.dwarf2/implptrpiece.exp: Likewise. * gdb.dwarf2/nonvar-access.exp: Likewise. * gdb.python/py-inferior.exp: Likewise. * gdb.trace/unavailable-dwarf-piece.exp: Likewise. --- gdb/testsuite/gdb.python/py-inferior.exp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'gdb/testsuite/gdb.python/py-inferior.exp') diff --git a/gdb/testsuite/gdb.python/py-inferior.exp b/gdb/testsuite/gdb.python/py-inferior.exp index adb5df3..c2ea2c2 100644 --- a/gdb/testsuite/gdb.python/py-inferior.exp +++ b/gdb/testsuite/gdb.python/py-inferior.exp @@ -30,15 +30,9 @@ clean_restart ${testfile} # Skip all tests if Python scripting is not enabled. if { [skip_python_tests] } { continue } -gdb_test_multiple "show endian" "getting target endian" { - -re ".*little endian.*$gdb_prompt $" { - set python_pack_char "<" - # pass silently - } - -re ".*big endian.*$gdb_prompt $" { - set python_pack_char ">" - # pass silently - } +switch [get_endianness] { + little { set python_pack_char "<" } + big { set python_pack_char ">" } } # The following tests require execution. -- cgit v1.1