From patchwork Thu Sep 6 21:13:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 29224 Received: (qmail 111590 invoked by alias); 6 Sep 2018 21:13: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 111389 invoked by uid 89); 6 Sep 2018 21:13:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=unmapped X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Sep 2018 21:13:25 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 3C61B1056A for ; Thu, 6 Sep 2018 16:13:24 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id y1aTfTNm7RPojy1aZfrrhv; Thu, 06 Sep 2018 16:13:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=UKLtCFN8vrhQpEC+k0xL/Qk6FPpnkge7iZilIBlUXhc=; b=hYOukN+PovzFttMnV3WNuLOa2E 65NuIAdFq4kPZDcfjSIfabIQHFFOFOJwbaDzsG9LGuGLiV76X/OKMuSr507jeJFZhJ5nOxFe7txSv eHCOkvAEhNtRxcLQcys79K788; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:34550 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fy1aT-0013U4-Hd; Thu, 06 Sep 2018 16:13:13 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFC 6/8] Style print_address_symbolic Date: Thu, 6 Sep 2018 15:13:01 -0600 Message-Id: <20180906211303.11029-7-tom@tromey.com> In-Reply-To: <20180906211303.11029-1-tom@tromey.com> References: <20180906211303.11029-1-tom@tromey.com> print_address_symbolic does not use ui-out, so it did not style function names. This patch changes it to use the low-level style code directly. --- gdb/printcmd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gdb/printcmd.c b/gdb/printcmd.c index c63d567e487..18721de425f 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -49,6 +49,7 @@ #include "format.h" #include "source.h" #include "common/byte-vector.h" +#include "cli/cli-style.h" /* Last specified output format. */ @@ -534,7 +535,9 @@ print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr, fputs_filtered ("<*", stream); else fputs_filtered ("<", stream); + set_output_style (stream, function_name_style.style ()); fputs_filtered (name.c_str (), stream); + set_output_style (stream, ui_file_style ()); if (offset != 0) fprintf_filtered (stream, "+%u", (unsigned int) offset); @@ -542,10 +545,12 @@ print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr, line # of this addr, if we have it; else line # of the nearest symbol. */ if (print_symbol_filename && !filename.empty ()) { + fputs_filtered (line == -1 ? " in " : " at ", stream); + set_output_style (stream, file_name_style.style ()); + fputs_filtered (filename.c_str (), stream); + set_output_style (stream, ui_file_style ()); if (line != -1) - fprintf_filtered (stream, " at %s:%d", filename.c_str (), line); - else - fprintf_filtered (stream, " in %s", filename.c_str ()); + fprintf_filtered (stream, ":%d", line); } if (unmapped) fputs_filtered ("*>", stream);