From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25985 invoked by alias); 27 Nov 2006 14:03:56 -0000 Received: (qmail 25966 invoked by uid 22791); 27 Nov 2006 14:03:52 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Mon, 27 Nov 2006 14:03:47 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1Goh5E-0008WP-On; Mon, 27 Nov 2006 09:03:44 -0500 Date: Mon, 27 Nov 2006 14:03:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Subject: Re: Language of registers Message-ID: <20061127140344.GA32528@nevyn.them.org> Mail-Followup-To: Vladimir Prus , gdb-patches@sources.redhat.com References: <200611251421.43173.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200611251421.43173.vladimir@codesourcery.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00296.txt.bz2 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 ), 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