MIPS bit field failures in gdb.base/store.exp
authorLuis Machado <lgustavo@codesourcery.com>
Fri, 3 Oct 2014 11:21:33 +0000 (08:21 -0300)
committerLuis Machado <lgustavo@codesourcery.com>
Fri, 3 Oct 2014 11:21:33 +0000 (08:21 -0300)
commit3e87153251d9a117182decbe57dd7d9d2a47c2b3
tree3423b788b470fbfea88b89b21ffe015b890f66d2
parentec48dc8bd4d90fa5c1b7cb4088fbc60a33344688
MIPS bit field failures in gdb.base/store.exp

On MIPS64 little endian, attempting an assignment to a bit field
that lives in a register yields the wrong result. It just corrupts
the data in the register depending on the specific position of the
bit field inside the structure.

FAIL: gdb.base/store.exp: f_1.j
FAIL: gdb.base/store.exp: f_1.k
FAIL: gdb.base/store.exp: F_1.i
FAIL: gdb.base/store.exp: F_1.j
FAIL: gdb.base/store.exp: F_1.k
FAIL: gdb.base/store.exp: f_2.j
FAIL: gdb.base/store.exp: f_2.k
FAIL: gdb.base/store.exp: F_2.i
FAIL: gdb.base/store.exp: F_2.j
FAIL: gdb.base/store.exp: F_2.k
FAIL: gdb.base/store.exp: f_3.j
FAIL: gdb.base/store.exp: f_3.k
FAIL: gdb.base/store.exp: F_3.i
FAIL: gdb.base/store.exp: F_3.j
FAIL: gdb.base/store.exp: F_3.k
FAIL: gdb.base/store.exp: f_4.j
FAIL: gdb.base/store.exp: f_4.k
FAIL: gdb.base/store.exp: F_4.i
FAIL: gdb.base/store.exp: F_4.j
FAIL: gdb.base/store.exp: F_4.k

                === gdb Summary ===

Now, GDB knows how to do bit field assignment properly, but MIPS is
one of those architectures that uses a hook for the register-to-value
conversion. Although we can properly tell when the type being passed
is a structure or union, we cannot tell when it is a bit field,
because the bit field data lives in a value structure.  Such data
only lives in a "type" structure when the parent structure is being
referenced, thus you can collect them from the flds_bnds members.

A bit field type structure looks pretty much the same as any other
primitive type like int or char, so we can't distinguish them.
Forcing more fields into the type structure wouldn't help much,
because the type structs are shared.

2014-10-03  Luis Machado  <lgustavo@codesourcery.com>

* valops.c (value_assign): Check for bit field assignments
before calling architecture-specific register value
conversion functions.
gdb/ChangeLog
gdb/valops.c
This page took 0.025773 seconds and 4 git commands to generate.