From patchwork Thu Jan 10 22:01:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 31028 Received: (qmail 83866 invoked by alias); 10 Jan 2019 22:01:28 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 83773 invoked by uid 89); 10 Jan 2019 22:01:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:output_, HContent-Transfer-Encoding:8bit X-HELO: mailsec102.isp.belgacom.be Received: from mailsec102.isp.belgacom.be (HELO mailsec102.isp.belgacom.be) (195.238.20.98) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Jan 2019 22:01:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1547157686; x=1578693686; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=c9oNYUklHtf0BmJ+MPTGDnKRkDgDKl7oBSaLcndzsqE=; b=ltbRY9OapI3/xiYg0bnF/n1ExC+bIiAmQonoV8DtKdads5fG86h9WSaV Uh4uAHovwNzi1rzxihvJCavQt5fpkw==; Received: from 184.205-67-87.adsl-dyn.isp.belgacom.be (HELO md.home) ([87.67.205.184]) by relay.skynet.be with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 10 Jan 2019 23:01:18 +0100 From: Philippe Waroquiers To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [RFA 3/3] Make symtab.c better styled. Date: Thu, 10 Jan 2019 23:01:13 +0100 Message-Id: <20190110220113.26169-4-philippe.waroquiers@skynet.be> In-Reply-To: <20190110220113.26169-1-philippe.waroquiers@skynet.be> References: <20190110220113.26169-1-philippe.waroquiers@skynet.be> MIME-Version: 1.0 X-IsSubscribed: yes 2019-01-10 Philippe Waroquiers * symtab.c (output_source_filename): Use file name style to print file name. (print_symbol_info): Likewise. (print_msymbol_info): Use address style to print addresses. --- gdb/symtab.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gdb/symtab.c b/gdb/symtab.c index d5e18a64d0..9363bf555a 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -41,6 +41,7 @@ #include "p-lang.h" #include "addrmap.h" #include "cli/cli-utils.h" +#include "cli/cli-style.h" #include "fnmatch.h" #include "hashtab.h" #include "typeprint.h" @@ -4168,7 +4169,7 @@ output_source_filename (const char *name, data->first = 0; wrap_here (""); - fputs_filtered (name, gdb_stdout); + fputs_styled (name, file_name_style.style (), gdb_stdout); } /* A callback for map_partial_symbol_filenames. */ @@ -4620,7 +4621,7 @@ print_symbol_info (enum search_domain kind, if (filename_cmp (last, s_filename) != 0) { fputs_filtered ("\nFile ", gdb_stdout); - fputs_filtered (s_filename, gdb_stdout); + fputs_styled (s_filename, file_name_style.style (), gdb_stdout); fputs_filtered (":\n", gdb_stdout); } @@ -4667,8 +4668,9 @@ print_msymbol_info (struct bound_minimal_symbol msymbol) else tmp = hex_string_custom (BMSYMBOL_VALUE_ADDRESS (msymbol), 16); - printf_filtered ("%s %s\n", - tmp, MSYMBOL_PRINT_NAME (msymbol.minsym)); + fputs_styled (tmp, address_style.style (), gdb_stdout); + printf_filtered (" %s\n", + MSYMBOL_PRINT_NAME (msymbol.minsym)); } /* This is the guts of the commands "info functions", "info types", and