From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25885 invoked by alias); 25 Jul 2013 02:35:47 -0000 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 Received: (qmail 25859 invoked by uid 89); 25 Jul 2013 02:35:47 -0000 X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_50,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 25 Jul 2013 02:35:45 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1V2BOx-0002LA-UL from Yao_Qi@mentor.com ; Wed, 24 Jul 2013 19:35:35 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 24 Jul 2013 19:35:35 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.2.247.3; Wed, 24 Jul 2013 19:35:35 -0700 Message-ID: <51F08ECA.4060301@codesourcery.com> Date: Thu, 25 Jul 2013 02:35:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Wei-cheng Wang CC: Subject: Re: [PATCH 1/5] Code for nds32 target References: <51DB8D14.20205@codesourcery.com> <51DC552D.3060900@gmail.com> In-Reply-To: <51DC552D.3060900@gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2013-07/txt/msg00589.txt.bz2 On 07/10/2013 02:23 AM, Wei-cheng Wang wrote: > Target description can not describe a enum-typed bit-field. > > If bit-field struct is used, I could not specify the type for > a bit-field. > > > > ... > > > If I want to specify field type, I couldn't specify size of a field. > > > > ... > > FAOD, this works in general. See testsuite/gdb.xml/extra-regs.xml. However, TYPE can't be flags. For example, I hack 'i386_eflags' in i386/32bit-core.xml, which splits eflags registers into three groups (or types), Then I get an error: Explicitly sized type can not contain non-bitfield "a" It is a limitation of and , which was mentioned in the patch submission. [patch] Add support for and in target descriptions http://sourceware.org/ml/gdb-patches/2010-02/msg00542.html I can't evaluate how much efforts are needed to fix this limitation. > All I want is to display a register in such format. > > (gdb) p $cr0 > $1 = {CFGID = [ PERF_EXT 16_EXT PERF_EXT2 COP_EXT STR_EXT ], > REV = 16, CPUID = N13} > > (cr0 consist of config flags, revision number and CPU ID.) With some hack (comment out the code which throws error) in xml-tdesc.c:tdesc_start_field, I can get something similar to yours, (gdb) p $eflags $1 = {a = [ SF ], b = [ IF ], c = [ ]} Probably, it is what you want. Looks target description is quite 'friendly' to be extended, but I don't know what to start with or how much work is needed. -- Yao (齐尧)