From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11775 invoked by alias); 1 Mar 2010 00:15:16 -0000 Received: (qmail 11737 invoked by uid 22791); 1 Mar 2010 00:15:14 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org Received: from mail-ww0-f41.google.com (HELO mail-ww0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Mar 2010 00:15:09 +0000 Received: by wwb24 with SMTP id 24so975165wwb.0 for ; Sun, 28 Feb 2010 16:15:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.87.140 with SMTP id y12mr2564731wee.36.1267402506701; Sun, 28 Feb 2010 16:15:06 -0800 (PST) In-Reply-To: <20100222164509.GE30100@caradoc.them.org> References: <20100222164509.GE30100@caradoc.them.org> Date: Mon, 01 Mar 2010 00:15:00 -0000 Message-ID: <6dc9ffc81002281615s376df02cm1807b3b1189fd0f0@mail.gmail.com> Subject: Re: [patch] Add support for and in target descriptions From: "H.J. Lu" To: gdb-patches@sourceware.org, "H.J. Lu" , Eli Zaretskii Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2010-03/txt/msg00000.txt.bz2 On Mon, Feb 22, 2010 at 8:45 AM, Daniel Jacobowitz w= rote: > Hi H.J., > > This patch adds support to the XML language. =A0Could you try > using this to move the two x86 flags registers from out of > target-descriptions.c? > > The flags support is straightforward and covered by the manual. > It's not tested because I couldn't find a way to do so; you can't > ptype a flags register, and you can't add dummy registers whose value > you can get at, only for ptype. > > The patch also adds , which is a little more interesting. > It's got two forms: > > * Register containing integer bitfields. =A0Each field must be > explicitly positioned. =A0The size must be pre-declared - otherwise > the representation GDB uses for big-endian bitfields can't figure out > how far from the MSB edge of the register the field is. > > * Register containing typed non-bitfield structures. =A0Each field must > be implicitly positioned. =A0There's no support for padding. > > These are somewhat annoying limitations, but they suffice for > everything I've needed this for since I wrote the patch, which was > originally several years ago; it's been stuck in my submission queue > because it was tangled up with other local patches. =A0Since they are > "must" restrictions, they are easy to lift in the future; we can make > GDB more permissive. > > These I was able to type, although I'd have liked more exhaustive > tests... for that, I'd need typeof, which turns out to be annoyingly > hard to implement in GDB's parser :-( > > Eli, how's the documentation? > > -- > Daniel Jacobowitz > CodeSourcery > > 2010-02-22 =A0Daniel Jacobowitz =A0 > > =A0 =A0 =A0 =A0* gdbtypes.c (append_composite_type_field_raw): New. > =A0 =A0 =A0 =A0(append_composite_type_field_aligned): Use the new functio= n. > =A0 =A0 =A0 =A0* gdbtypes.h (append_composite_type_field_raw): Declare. > =A0 =A0 =A0 =A0* target-descriptions.c (struct tdesc_type_field): Add sta= rt and end. > =A0 =A0 =A0 =A0(struct tdesc_type_flag): New type. > =A0 =A0 =A0 =A0(struct tdesc_type): Add TDESC_TYPE_STRUCT and TDESC_TYPE_= FLAGS to > =A0 =A0 =A0 =A0kind. =A0Add size to u.u. =A0Add u.f for flags. > =A0 =A0 =A0 =A0(tdesc_gdb_type): Handle TDESC_TYPE_STRUCT and TDESC_TYPE_= FLAGS. > =A0 =A0 =A0 =A0(tdesc_free_type): Likewise. > =A0 =A0 =A0 =A0(tdesc_create_struct, tdesc_set_struct_size, tdesc_create_= flags): New. > =A0 =A0 =A0 =A0(tdesc_add_field): Handle TDESC_TYPE_STRUCT. > =A0 =A0 =A0 =A0(tdesc_add_bitfield, tdesc_add_flag): New. > =A0 =A0 =A0 =A0* target-descriptions.h (tdesc_create_struct, tdesc_set_st= ruct_size) > =A0 =A0 =A0 =A0(tdesc_create_flags, tdesc_add_bitfield, tdesc_add_flag): = Declare. > =A0 =A0 =A0 =A0* xml-tdesc.c (struct tdesc_parsing_data): Rename current_= union to > =A0 =A0 =A0 =A0current_type. =A0Add current_type_size and current_type_is= _flags. > =A0 =A0 =A0 =A0(tdesc_start_union): Clear the new fields. > =A0 =A0 =A0 =A0(tdesc_start_struct, tdesc_start_flags): New. > =A0 =A0 =A0 =A0(tdesc_start_field): Handle struct fields, including bitfi= elds. > =A0 =A0 =A0 =A0(field_attributes): Make type optional. =A0Add start and e= nd. > =A0 =A0 =A0 =A0(union_children): Rename to struct_union_children. > =A0 =A0 =A0 =A0(union_attributes): Rename to struct_union_attributes. =A0= Add optional > =A0 =A0 =A0 =A0size. > =A0 =A0 =A0 =A0(flags_attributes): New. > =A0 =A0 =A0 =A0(feature_children): Add struct and flags. > =A0 =A0 =A0 =A0* features/gdb-target.dtd: Add flags and struct to feature= s. > =A0 =A0 =A0 =A0Make field type optional. =A0Add field start and end. > > =A0 =A0 =A0 =A0* gdb.texinfo (Types): Describe and . > > =A0 =A0 =A0 =A0* gdb.xml/extra-regs.xml: Add struct1, struct2, and flags > =A0 =A0 =A0 =A0types. =A0Add structreg, bitfields, and flags registers. > =A0 =A0 =A0 =A0* gdb.xml/tdesc-regs.exp: Test structreg and bitfields > =A0 =A0 =A0 =A0registers. > It doesn't work. "case TDESC_TYPE_FLAGS:" is missing in maint_print_c_tdesc_cmd. --=20 H.J.