From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9474 invoked by alias); 21 Oct 2002 23:49:28 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9458 invoked from network); 21 Oct 2002 23:49:25 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 21 Oct 2002 23:49:25 -0000 Received: from localhost.redhat.com (to-dhcp51.toronto.redhat.com [172.16.14.151]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 407D1800084; Mon, 21 Oct 2002 19:49:25 -0400 (EDT) Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 572243E12; Mon, 21 Oct 2002 19:49:24 -0400 (EDT) Message-ID: <3DB49284.5040700@redhat.com> Date: Mon, 21 Oct 2002 16:49:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Buettner Cc: gdb-patches@sources.redhat.com, Jim Blandy Subject: Re: [PATCH RFA/RFC] Address class support References: <1021016004200.ZM22063@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-10/txt/msg00370.txt.bz2 > Index: dwarf2read.c > =================================================================== > RCS file: /cvs/src/src/gdb/dwarf2read.c,v > retrieving revision 1.68 > diff -u -p -r1.68 dwarf2read.c > --- dwarf2read.c 9 Oct 2002 04:43:49 -0000 1.68 > +++ dwarf2read.c 16 Oct 2002 00:15:07 -0000 > @@ -683,6 +683,10 @@ static struct complaint dwarf2_invalid_a > { > "invalid attribute class or form for '%s' in '%s'", 0, 0 > }; > +static struct complaint dwarf2_invalid_pointer_size = > +{ > + "invalid pointer size %d", 0, 0 > +}; Please use the new complaint() interface. > +F:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:char *:address_class_type_flags_to_name:int type_flags:type_flags Is it possible to ``const char *'' propogate this (address_space_int_to_name()) would need to be changed? > +F:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:char *name, int *type_flags_ptr:name, type_flags_ptr > EOF > } > > Index: gdbtypes.c > =================================================================== > RCS file: /cvs/src/src/gdb/gdbtypes.c,v > retrieving revision 1.59 > diff -u -p -r1.59 gdbtypes.c > --- gdbtypes.c 2 Oct 2002 22:01:53 -0000 1.59 > +++ gdbtypes.c 16 Oct 2002 00:15:10 -0000 > @@ -397,11 +397,15 @@ lookup_function_type (struct type *type) > extern int > address_space_name_to_int (char *space_identifier) > { > + int type_flags; > /* Check for known address space delimiters. */ > if (!strcmp (space_identifier, "code")) > return TYPE_FLAG_CODE_SPACE; > else if (!strcmp (space_identifier, "data")) > return TYPE_FLAG_DATA_SPACE; > + else if (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P () > + && ADDRESS_CLASS_NAME_TO_TYPE_FLAGS (space_identifier, &type_flags)) > + return type_flags; > else > error ("Unknown address space specifier: \"%s\"", space_identifier); > } > @@ -416,6 +420,9 @@ address_space_int_to_name (int space_fla > return "code"; > else if (space_flag & TYPE_FLAG_DATA_SPACE) > return "data"; > + else if ((space_flag & TYPE_FLAG_ADDRESS_CLASS_ALL) > + && ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P ()) > + return ADDRESS_CLASS_TYPE_FLAGS_TO_NAME (space_flag); > else > return NULL; > } Is there a lurking bug here? Is something like: @short @data valid (I think so) yet, the above can only print one of those names. Similarly should something like: @code @data be rejected? Looking at the use of these functions. Everything is refering to ``address space'' vis: address_space_id = address_space_int_to_name (TYPE_INSTANCE_FLAGS (type)); if (address_space_id) { if (did_print_modifier || need_pre_space) fprintf_filtered (stream, " "); fprintf_filtered (stream, "@%s", address_space_id); did_print_modifier = 1; } yet with this patch, that is definitly no longer true! I think the calling code needs to be updated so that it uses a more meaningful name. How would code use this to add an ``@io'' pointer? Andrew