From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95588 invoked by alias); 12 Jan 2019 16:48:34 -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 95489 invoked by uid 89); 12 Jan 2019 16:48:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_00,KAM_STOCKGEN,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: mailsec110.isp.belgacom.be Received: from mailsec110.isp.belgacom.be (HELO mailsec110.isp.belgacom.be) (195.238.20.106) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 12 Jan 2019 16:48:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1547311701; x=1578847701; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=98bIRH3LskI7lKdDVJcIjjTkqcVkTk2lGnCe/bYMh9Y=; b=IPUROwrVE9KXzwviamM9O4T2DGF1o+rK1VFgyTZncxoHJQb4duQ6NQCv /XTDnx615QDlMw3dwxYMRcpbEpOdSg==; Received: from 184.205-67-87.adsl-dyn.isp.belgacom.be (HELO md) ([87.67.205.184]) by relay.skynet.be with ESMTP/TLS/AES256-GCM-SHA384; 12 Jan 2019 17:48:18 +0100 Message-ID: <1547311697.5979.7.camel@skynet.be> Subject: Re: [RFA 3/3] Make symtab.c better styled. From: Philippe Waroquiers To: Tom Tromey Cc: gdb-patches@sourceware.org Date: Sat, 12 Jan 2019 16:48:00 -0000 In-Reply-To: <8736pxx2ow.fsf@tromey.com> References: <20190110220113.26169-1-philippe.waroquiers@skynet.be> <20190110220113.26169-4-philippe.waroquiers@skynet.be> <8736pxx2ow.fsf@tromey.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00286.txt.bz2 On Sat, 2019-01-12 at 09:26 -0700, Tom Tromey wrote: > > > > > > "Philippe" == Philippe Waroquiers writes: > > Philippe> 2019-01-10 Philippe Waroquiers > Philippe> * symtab.c (output_source_filename): Use file name style > Philippe> to print file name. > Philippe> (print_symbol_info): Likewise. > Philippe> (print_msymbol_info): Use address style to print addresses. > > Thanks, this is ok. > > Philippe> + printf_filtered (" %s\n", > Philippe> + MSYMBOL_PRINT_NAME (msymbol.minsym)); > > I suppose this could look at the minsymbol type and use either the > function or variable styling. That looks relatively easy to do. To differentiate between data and text, would the condition in expand_symtab_containing_pc be ok ? i.e. variable styling would be used for data, i.e. : (MSYMBOL_TYPE (msymbol.minsym) == mst_data   || MSYMBOL_TYPE (msymbol.minsym) == mst_bss   || MSYMBOL_TYPE (msymbol.minsym) == mst_abs   || MSYMBOL_TYPE (msymbol.minsym) == mst_file_data   || MSYMBOL_TYPE (msymbol.minsym) == mst_file_bss)) and function name styling would be used for the rest i.e.:   mst_text, /* Generally executable instructions */   mst_text_gnu_ifunc,           /* Executable code returning address    of executable code */   mst_data_gnu_ifunc, /* Executable code returning address    of executable code */   mst_slot_got_plt, /* GOT entries for .plt sections */   mst_solib_trampoline, /* Shared library trampoline code */   mst_file_text, /* Static version of mst_text */ Philippe