diff options
author | Tom Tromey <tromey@adacore.com> | 2019-11-25 11:13:52 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-12-04 09:31:18 -0700 |
commit | 103a685e7fd27bb1347a2459c07e648aac7a6f54 (patch) | |
tree | e6bb66acd930d577df869b04fa8546ab1f8578d6 /gdb/testsuite | |
parent | 7a9e9f9f1e78a085fdf60faadd83990c3ca6d18c (diff) | |
download | gdb-103a685e7fd27bb1347a2459c07e648aac7a6f54.zip gdb-103a685e7fd27bb1347a2459c07e648aac7a6f54.tar.gz gdb-103a685e7fd27bb1347a2459c07e648aac7a6f54.tar.bz2 |
Add scalar_storage_order support for floating point
Testing the scalar_storage_order patch pointed out that it does not
handle floating point properly. This patch fixes this problem.
gdb/ChangeLog
2019-12-04 Tom Tromey <tromey@adacore.com>
* dwarf2read.c (dwarf2_init_float_type)
(dwarf2_init_complex_target_type): Add byte_order parameter.
(read_base_type): Compute byte order earlier.
* gdbtypes.c (init_float_type): Add byte_order parameter.
* gdbtypes.h (init_float_type): Add byte_order parameter.
gdb/testsuite/ChangeLog
2019-12-04 Tom Tromey <tromey@adacore.com>
* gdb.base/endianity.c (struct otherendian) <f>: New field.
(main): Initialize it.
* gdb.base/endianity.exp: Update.
Change-Id: Ic02eb711d80ce678ef0ecf8c506a626e441b8440
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/endianity.c | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/endianity.exp | 8 |
3 files changed, 16 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 112049f..1c8aa86 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2019-12-04 Tom Tromey <tromey@adacore.com> + + * gdb.base/endianity.c (struct otherendian) <f>: New field. + (main): Initialize it. + * gdb.base/endianity.exp: Update. + 2019-12-04 Andrew Burgess <andrew.burgess@embecosm.com> * gdb.mi/mi-sym-info.exp: Add tests for -max-results parameter. diff --git a/gdb/testsuite/gdb.base/endianity.c b/gdb/testsuite/gdb.base/endianity.c index 5ab090d..42ee9ae 100644 --- a/gdb/testsuite/gdb.base/endianity.c +++ b/gdb/testsuite/gdb.base/endianity.c @@ -21,6 +21,9 @@ struct otherendian { int v; short w; + float f; + __complex__ float cplx; + double d; } #if defined __GNUC__ && (__GNUC__ >= 6) #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ @@ -39,7 +42,7 @@ do_nothing (struct otherendian *c) int main (void) { - struct otherendian o = {3,2}; + struct otherendian o = {3, 2, 23.5, 1.25 + 7.25i, 75}; do_nothing (&o); /* START */ } diff --git a/gdb/testsuite/gdb.base/endianity.exp b/gdb/testsuite/gdb.base/endianity.exp index 80df012..4277c1f 100644 --- a/gdb/testsuite/gdb.base/endianity.exp +++ b/gdb/testsuite/gdb.base/endianity.exp @@ -25,10 +25,13 @@ if ![runto "endianity.c:$bp_location" ] then { return -1 } -gdb_test "print o" "= {v = 3, w = 2}" "print o before assignment" +gdb_test "print o" "= {v = 3, w = 2, f = 23.5, cplx = 1.25 \\+ 7.25 \\* I, d = 75}" \ + "print o before assignment" gdb_test "print o.v = 4" "= 4" gdb_test "print o.w = 3" "= 3" +gdb_test "print o.f = 1.5" "= 1.5" +gdb_test "print o.d = -23.125" "= -23.125" # scalar_storage_order requires gcc >= 6 if { ([test_compiler_info {gcc-[0-5]-*}] || ![test_compiler_info gcc*]) } { @@ -37,4 +40,5 @@ if { ([test_compiler_info {gcc-[0-5]-*}] || ![test_compiler_info gcc*]) } { gdb_test "x/x &o.v" "0x04000000" gdb_test "x/xh &o.w" "0x0300" -gdb_test "print o" "= {v = 4, w = 3}" "print o after assignment" +gdb_test "print o" "= {v = 4, w = 3, f = 1.5, cplx = 1.25 \\+ 7.25 \\* I, d = -23.125}" \ + "print o after assignment" |