Language of registers

Daniel Jacobowitz drow@false.org
Mon Nov 27 14:03:00 GMT 2006


On Sat, Nov 25, 2006 at 02:21:43PM +0300, Vladimir Prus wrote:
> 
> At the moment, MI varobj assume that register values have a language. As 
> result, if you try to look at values of $xmm1 in a C++ program, you'll find 
> that this registers has a 'public' field -- which is not reasonable.

I'm unsure.  Maybe it's actually right the way it is?  All of GDB's
other forms of output adjust with the current language.  For instance,
in the CLI:

(gdb) set lang ada
(gdb) p $xmm1
$4 = (v4_float => (0 => 0.0, 0.0, 0.0, 0.0), v2_double => (0 => 0.0, 
    0.0), v16_int8 => (0 => 0 <repeats 16 times>), v8_int16 => (0 => 
    0, 0, 0, 0, 0, 0, 0, 0), v4_int32 => (0 => 0, 0, 0, 0), 
  v2_int64 => (0 => 0, 0), 
  uint128 => 0x00000000000000000000000000000000)
(gdb) ptype $xmm1
type = record (?) is
    case ? is
        when ? =>
            v4_float: array (0 .. 3) of float;
        when ? =>
            v2_double: array (0 .. 1) of double;
        when ? =>
            v16_int8: array (0 .. 15) of int8_t;
        when ? =>
            v8_int16: array (0 .. 7) of int16_t;
        when ? =>
            v4_int32: array (0 .. 3) of int32_t;
        when ? =>
            v2_int64: array (0 .. 1) of int64_t;
        when ? =>
            uint128: int128_t;
    end case;
end record

And that might be more comfortable for an Ada programmer.

I'd suggest that we don't need the fake "public" child for things of
struct/union (as opposed to class) type that are 100% public.  We can't
reliably detect struct vs class because debug info is often lacking the
distinction, but union is easy.  I don't know if this might break some
MI frontend though.  But the "public" child isn't even documented.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb-patches mailing list