From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85053 invoked by alias); 1 Jun 2018 21:23:03 -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 85039 invoked by uid 89); 1 Jun 2018 21:23:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=qualify, Hx-languages-length:1919 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 ESMTP; Fri, 01 Jun 2018 21:23:01 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 46FE8C04AC58; Fri, 1 Jun 2018 21:23:00 +0000 (UTC) Received: from theo.uglyboxes.com (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 101D4608EE; Fri, 1 Jun 2018 21:23:00 +0000 (UTC) Subject: Re: [RFA 5/6] Add validity bits for psymtab high and low fields To: Tom Tromey , gdb-patches@sourceware.org References: <20180503223621.22544-1-tom@tromey.com> <20180503223621.22544-6-tom@tromey.com> From: Keith Seitz Message-ID: <9b460d82-3c69-21dd-eb9e-1c4598e8e9a8@redhat.com> Date: Fri, 01 Jun 2018 21:23:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180503223621.22544-6-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00036.txt.bz2 On 05/03/2018 03:36 PM, Tom Tromey wrote: > Right now some psymtab code checks whether a psymtab's textlow or > texthigh fields are valid by comparing against 0. > > I imagine this is mildly wrong in the current environment, but once > psymtabs are relocated dynamically, it will no longer be correct, > because it will be much more normal to see a psymtab with a textlow of > zero -- this will just mean it appears at the start of the text > section. > Also wrong if 0 is a valid address! [as a recent patch* serves to remind] > This patch introduces validity bits to handle this situation more > nicely, and changes users of the code to follow. > > ChangeLog > 2018-05-03 Tom Tromey > > * dbxread.c (end_psymtab): Use texthigh_valid and textlow_valid. Does this line not also qualify for texthigh_valid: if (PSYMTAB_TEXTHIGH (pst) == 0 && last_function_name && gdbarch_sofun_address_maybe_missing (gdbarch)) ? There's also this line in dbx_read_symtab that might qualify (from case N_SCOPE): valu = nlist.n_value + last_function_start; if (PSYMTAB_TEXTHIGH (pst) == 0 || valu > PSYMTAB_TEXTHIGH (pst)) SET_PSYMTAB_TEXTHIGH (pst, valu); break; Also in this function, can textlow_not_set be replaced by textlow_valid? [The same with the textlow_not_set parameter to dbx_end_psymtab?] > * mdebugread.c (parse_partial_symbols): Use textlow_valid. > (psymtab_to_symtab_1): Use texthigh_valid and textlow_valid. > * psympriv.h (struct partial_symtab) : Update > comment. > : New fields. > (set_psymtab_textlow, set_psymtab_texthigh): New inline functions. > (SET_PSYMTAB_TEXTLOW, SET_PSYMTAB_TEXTHIGH): Redefine. > * xcoffread.c (scan_xcoff_symtab): Use textlow_valid. Otherwise, this all LGTM (IANAM). Keith * https://sourceware.org/ml/gdb-patches/2018-05/msg00325.html