From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11401 invoked by alias); 25 Nov 2006 11:22:12 -0000 Received: (qmail 11388 invoked by uid 22791); 25 Nov 2006 11:22:11 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 25 Nov 2006 11:22:03 +0000 Received: (qmail 10418 invoked from network); 25 Nov 2006 11:22:01 -0000 Received: from unknown (HELO ?172.16.64.38?) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Nov 2006 11:22:01 -0000 From: Vladimir Prus To: gdb-patches@sources.redhat.com Subject: Language of registers Date: Sat, 25 Nov 2006 11:22:00 -0000 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_HdCaFQmYJhCjTjv" Message-Id: <200611251421.43173.vladimir@codesourcery.com> 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/msg00291.txt.bz2 --Boundary-00=_HdCaFQmYJhCjTjv Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 439 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. The attached patch causes MI to always force the C language for register values, so no special processing takes place. OK? - Volodya * varobj.c (varobj_create): For register values, always use C as the language. --Boundary-00=_HdCaFQmYJhCjTjv Content-Type: text/x-diff; charset="us-ascii"; name="c_registers__gdb_mainline.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="c_registers__gdb_mainline.diff" Content-length: 794 === gdb/varobj.c ================================================================== --- gdb/varobj.c (/mirrors/gdb_mainline) (revision 2298) +++ gdb/varobj.c (/patches/gdb/c_registers/gdb_mainline) (revision 2298) @@ -518,7 +518,15 @@ var->type = value_type (var->value); /* Set language info */ - lang = variable_language (var); + if (VALUE_REGNUM (var->value) != -1) + /* For register values, we don't want any language + specific processing, so use the less specialized + language. Otherwise, in C++ programs registers likes + xmm1 will feature 'public' children, that makes no + sense for registers. */ + lang = vlang_c; + else + lang = variable_language (var); var->root->lang = languages[lang]; /* Set ourselves as our root */ --Boundary-00=_HdCaFQmYJhCjTjv--