From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52479 invoked by alias); 7 May 2015 17:05:17 -0000 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 Received: (qmail 51845 invoked by uid 89); 7 May 2015 17:05:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 07 May 2015 17:05:15 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id B0763C1F1A; Thu, 7 May 2015 17:05:14 +0000 (UTC) Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t47H5DQg002290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 May 2015 13:05:14 -0400 Message-ID: <554B9B49.60701@redhat.com> Date: Thu, 07 May 2015 17:05:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Doug Evans CC: gdb-patches@sourceware.org Subject: Re: [PATCH v3 4/9] Explicit locations: introduce address locations References: <20150217220619.1312.39861.stgit@valrhona.uglyboxes.com> <20150217220646.1312.56251.stgit@valrhona.uglyboxes.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00148.txt.bz2 On 03/01/2015 01:02 PM, Doug Evans wrote: > Keith Seitz writes: >> +/* Convert the given ADDRESS into SaLs. */ >> + >> +static struct symtabs_and_lines >> +convert_address_location_to_sals (struct linespec_state *self, >> + CORE_ADDR address) >> +{ >> + struct symtab_and_line sal; >> + struct symtabs_and_lines sals = {NULL, 0}; >> + >> + sal = find_pc_line (address, 0); >> + sal.pc = address; >> + sal.section = find_pc_overlay (address); >> + sal.explicit_pc = 1; >> + add_sal_to_sals (self, &sals, &sal, core_addr_to_string (address), 1); >> + >> + if (self->canonical != NULL) >> + self->canonical->location = new_address_location (address); > > ==== > Modifying self->canonical->location is an undocumented side-effect. > Can you augment the function comment to document and explain this? In general, all of the convert_*_location_to_sals functions will canonicalize the location into linespec_state.canonical. Address locations are, though, completely specified, unlike some linespecs/explicit locations, where we might have to "fill-in" some missing bits, e.g., "b 30" -> "30" -> "sourcefile.c:30". In that vein, I am simply going to remove this. It is not needed anymore. Keith