From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27224 invoked by alias); 2 Aug 2011 16:08:43 -0000 Received: (qmail 27213 invoked by uid 22791); 2 Aug 2011 16:08:42 -0000 X-SWARE-Spam-Status: No, hits=-7.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Aug 2011 16:08:28 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p72G8SIR018175 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 2 Aug 2011 12:08:28 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p72G8RON030594; Tue, 2 Aug 2011 12:08:27 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p72G8Qd1025505; Tue, 2 Aug 2011 12:08:26 -0400 From: Tom Tromey To: Keith Seitz Cc: gdb-patches@sourceware.org Subject: Re: [RFA] c++/12266 (again) References: <4E31EE1A.5040204@redhat.com> Date: Tue, 02 Aug 2011 16:08:00 -0000 In-Reply-To: <4E31EE1A.5040204@redhat.com> (Keith Seitz's message of "Thu, 28 Jul 2011 16:17:46 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2011-08/txt/msg00030.txt.bz2 >>>>> "Keith" == Keith Seitz writes: Keith> +static const char *ignore_typedefs[] = Maybe 'static const char * const'? Keith> +typedef char *namep; defs.h already has 'char_ptr' for this purpose. Keith> +static void Keith> +replace_typedefs (struct demangle_parse_info *info, Indent this line somehow. Keith> + while (TYPE_CODE (TYPE_TARGET_TYPE (last)) == TYPE_CODE_TYPEDEF) Keith> + last = TYPE_TARGET_TYPE (last); It seems like you could construct a test case where the type is a stub type, so TYPE_TARGET_TYPE == NULL, causing a crash. Keith> + /* If there is only one typedef for this anonymous type, Keith> + do not substitute it. */ I don't understand this comment. How does this code check if this anonymous type only had one typedef? Keith> + (void) inspect_type (info, ret_comp, free_list); Don't cast to void. Keith> + /* Free any memory allocated during typedef replacement. */ Keith> + if (!VEC_empty (namep, free_list)) Keith> + { Keith> + int i; Keith> + char *iter; Keith> + Keith> + for (i = 0; VEC_iterate (namep, free_list, i, iter); ++i) Keith> + xfree (iter); You don't need the VEC_empty check here; vec.h will do the right thing if you try to iterate an empty (or NULL) VEC. Keith> + cleanup = make_cleanup (null_cleanup, NULL); Keith> + if (current_language->la_language == language_cplus) Keith> + { Keith> + char *canon = cp_canonicalize_string_no_typedefs (copy); Keith> + Keith> + if (canon != NULL) Keith> + { Keith> + name = canon; Keith> + make_cleanup (xfree, name); Keith> + } This change in linespec checks current_language, but the other does not. Why is that? Tom