From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10624 invoked by alias); 26 May 2010 16:05:07 -0000 Received: (qmail 10530 invoked by uid 22791); 26 May 2010 16:05:05 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Wed, 26 May 2010 16:05:01 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4QG50JS020509 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 26 May 2010 12:05:00 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4QG50Kw000876 for ; Wed, 26 May 2010 12:05:00 -0400 Received: from [10.15.16.55] (toner.yyz.redhat.com [10.15.16.55]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o4QG4xbl022560 for ; Wed, 26 May 2010 12:04:59 -0400 Message-ID: <4BFD440E.8080507@redhat.com> Date: Wed, 26 May 2010 16:55:00 -0000 From: sami wagiaalla User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [patch] Change cplus_specific to an alocated struct References: <4BFD4230.3030600@redhat.com> In-Reply-To: <4BFD4230.3030600@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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-05/txt/msg00596.txt.bz2 On 05/26/2010 11:45 AM, sami wagiaalla wrote: > diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c > index 3b3894c..62e1251 100644 > --- a/gdb/ada-lang.c > +++ b/gdb/ada-lang.c > @@ -1142,32 +1142,32 @@ static struct htab *decoded_names_store; > char * > ada_decode_symbol (const struct general_symbol_info *gsymbol) > { > - char **resultp = > - (char **)&gsymbol->language_specific.cplus_specific.demangled_name; > - if (*resultp == NULL) > + char *result = symbol_get_cplus_demangled_name (gsymbol); > + Changed char **resultp to char *result since demangled_name no longer necessarily has an address. I didn't see why a pointer pointer was needed so I hope I am not missing anything. My guess was that it is an artifact left over from an earlier form of the function. Also, both locations which call ada_decode_symbol (symbol_natural_name, and symbol_demangled_name) check before call the function cplus_specific.demangled_name. So, the check can perhaps be removed from either the caller or callee.