From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 811 invoked by alias); 10 Jan 2002 21:25:09 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 761 invoked from network); 10 Jan 2002 21:25:05 -0000 Received: from unknown (HELO prospero.cambridge.redhat.com) (62.30.164.150) by sources.redhat.com with SMTP; 10 Jan 2002 21:25:05 -0000 Received: (from jason@localhost) by prospero.cambridge.redhat.com (8.11.6/8.11.6) id g0ALOio10182; Thu, 10 Jan 2002 21:24:44 GMT X-Authentication-Warning: localhost.localdomain: jason set sender to jason@redhat.com using -f To: Michael Elizabeth Chastain Cc: gdb@sources.redhat.com, fnf@redhat.com, Jason Merrill Subject: Re: gdb.c++ failures References: <200201101712.LAA18053@duracef.shout.net> <20020110143328.B9479@nevyn.them.org> From: Jason Merrill In-Reply-To: <20020110143328.B9479@nevyn.them.org> (Daniel Jacobowitz's message of "Thu, 10 Jan 2002 14:33:28 -0500") Date: Thu, 10 Jan 2002 13:25:00 -0000 Message-ID: User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2002-01/txt/msg00109.txt.bz2 --=-=-= Content-length: 886 >>>>> "Daniel" == Daniel Jacobowitz writes: > On Thu, Jan 10, 2002 at 07:21:18PM +0000, Jason Merrill wrote: >> The stabs output from gcc ignores const and volatile. There is even a >> comment saying that "stabs does not distinguish const and volatile". >> The method qualifiers are described, and gdb could do the work to apply >> them to the type of 'this', but it's probably fine just to leave it as it >> is. > There are documented extensions to STABS to express both const and > volatile. GDB supports them, and documents them - see info stabs. > They're originally Sun extensions. > Could I persuade you to add them to GCC? It would take you less time > than I. Give this a whirl. The output looks right to me, but gdb doesn't seem to like it much. 2002-01-10 Jason Merrill * dbxout.c (dbxout_type): Support const and volatile. --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-length: 2369 *** dbxout.c.~1~ Thu Jan 10 15:48:14 2002 --- dbxout.c Thu Jan 10 21:22:53 2002 *************** dbxout_type (type, full) *** 1050,1067 **** type = integer_type_node; else { - /* Try to find the "main variant" with the same name but not const - or volatile. (Since stabs does not distinguish const and volatile, - there is no need to make them separate types. But types with - different names are usefully distinguished.) */ - - for (tem = TYPE_MAIN_VARIANT (type); tem; tem = TYPE_NEXT_VARIANT (tem)) - if (!TYPE_READONLY (tem) && !TYPE_VOLATILE (tem) - && TYPE_NAME (tem) == TYPE_NAME (type)) - { - type = tem; - break; - } if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL && TYPE_DECL_SUPPRESS_DEBUG (TYPE_NAME (type))) --- 1050,1055 ---- *************** dbxout_type (type, full) *** 1157,1168 **** typevec[TYPE_SYMTAB_ADDRESS (type)].status = TYPE_DEFINED; ! if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL ! && DECL_ORIGINAL_TYPE (TYPE_NAME (type))) ! { ! dbxout_type (DECL_ORIGINAL_TYPE (TYPE_NAME (type)), 0); ! return; ! } switch (TREE_CODE (type)) { --- 1145,1182 ---- typevec[TYPE_SYMTAB_ADDRESS (type)].status = TYPE_DEFINED; ! /* If this type is a variant of some other, hand off. Types with ! different names are usefully distinguished. */ ! { ! tree main_variant; ! ! if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL ! && DECL_ORIGINAL_TYPE (TYPE_NAME (type))) ! main_variant = TREE_TYPE (TYPE_NAME (type)); ! else ! main_variant = TYPE_MAIN_VARIANT (type); ! ! if (TYPE_READONLY (type) > TYPE_READONLY (main_variant)) ! { ! putc ('k', asmfile); ! CHARS (1); ! dbxout_type (build_type_variant (type, 0, TYPE_VOLATILE (type)), 0); ! return; ! } ! else if (TYPE_VOLATILE (type) > TYPE_VOLATILE (main_variant)) ! { ! putc ('B', asmfile); ! CHARS (1); ! dbxout_type (build_type_variant (type, TYPE_READONLY (type), 0), 0); ! return; ! } ! else if (main_variant != TYPE_MAIN_VARIANT (type)) ! { ! dbxout_type (DECL_ORIGINAL_TYPE (TYPE_NAME (type)), 0); ! return; ! } ! /* else this isn't a cv-variant, so keep going. */ ! } switch (TREE_CODE (type)) { --=-=-=--