This is the mail archive of the gdb@sourceware.cygnus.com 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]

long_long.exp testsuite failure...


Hi,

The following is a fragment from testsuite/gdb.base/long_long.exp,
modified to correct a problem on ARM Linux.  It doesn't work however and
I don't understand why.

The test assigns an octal value to a long long variable oct then
attempts to print it as floating point value.

long long oct = 01234567123456701234567LL;

The problem is the ARM floating point storage format is odd.  It is
little endian, with the words swapped to be big endian.  As an example,
the above number in hex is 0xa72ee53977053977.  If in GDB, I swap the
words, setting oct = 0x77053977a72ee539 and then p/f oct, I get the
expected value -5.9822653797615723e-120.  Without the swap, I get
2.1386676354387559e+265.

I attempted the following target specific fix.  The execution path goes
through my change (I checked), but the test still fails.  

if { $sizeof_double == 8 } {
  if [istarget "arm*-*-linux*"] then {
    # ARM doubles are little endian with words swapped.
    gdb_test "p/f oct" ".*2.1386676354387559e+265.*"
  } else {
    gdb_test "p/f oct" ".*-5.9822653797615723e-120.*"
  }

} else {

    gdb_test "p/f oct" ".*-2.42716126e-15.*"
}

The following is a fragment from testsuite/gdb.log after running the
long_long.exp with the above change.  As far as I can tell, the test
should pass.  I'm hoping this is stupid user error and someone can point
out what I am doing wrong.

(gdb) PASS: gdb.base/long_long.exp: p/c oct
p/f oct
$20 = 2.1386676354387559e+265
(gdb) FAIL: gdb.base/long_long.exp: p/f oct
testcase ../../../gdb/gdb/testsuite/gdb.base/long_long.exp completed in
6 seconds

                === gdb Summary ===

# of expected passes            18
# of unexpected failures        1

This test is never going to succeed on ARM platforms, it needs to be
fixed, or setup to XFAIL.

Scott

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