From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34511 invoked by alias); 28 Nov 2018 00:16:09 -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 33262 invoked by uid 89); 28 Nov 2018 00:15:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=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= X-HELO: gateway22.websitewelcome.com Received: from gateway22.websitewelcome.com (HELO gateway22.websitewelcome.com) (192.185.47.163) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Nov 2018 00:15:51 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway22.websitewelcome.com (Postfix) with ESMTP id F2CD7156A7 for ; Tue, 27 Nov 2018 18:14:39 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id RnV1gAfwaPvAdRnV1gqWFG; Tue, 27 Nov 2018 18:14:39 -0600 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=XMfzfaBewUwtVrwngfcPEHsGduVE6EvDKD/haShcOA4=; b=juQTUKAioD7eROJbxOB3Hpsraw 4zGM/eSciCEKvHtEAUKo1ZCr/BDigjzHwGHSP9ZBWsKJ7QYj3HBpw0OY/wDcvLglE6snJ9WZdhm6Y NyI6QU7yHNzHNj1YCrMSvwy0x; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:33804 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gRnV1-004MMp-Oh; Tue, 27 Nov 2018 18:14:39 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 08/16] Style locations when setting a breakpoint Date: Wed, 28 Nov 2018 00:16:00 -0000 Message-Id: <20181128001435.12703-9-tom@tromey.com> In-Reply-To: <20181128001435.12703-1-tom@tromey.com> References: <20181128001435.12703-1-tom@tromey.com> X-SW-Source: 2018-11/txt/msg00502.txt.bz2 say_where does not use ui-out, so function and file names printed by it were not styled. This patch changes say_where to use the low-level style code directly. gdb/ChangeLog 2018-11-27 Tom Tromey * breakpoint.c (say_where): Style file name. gdb/testsuite/ChangeLog 2018-11-27 Tom Tromey * gdb.base/style.exp: Add test for breakpoint setting. --- gdb/ChangeLog | 4 ++++ gdb/breakpoint.c | 12 +++++++++--- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/style.exp | 5 ++++- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 53763e0254..b99b0fb27c 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -68,6 +68,7 @@ #include "format.h" #include "thread-fsm.h" #include "tid-parse.h" +#include "cli/cli-style.h" /* readline include files */ #include "readline/readline.h" @@ -12195,9 +12196,14 @@ say_where (struct breakpoint *b) /* If there is a single location, we can print the location more nicely. */ if (b->loc->next == NULL) - printf_filtered (": file %s, line %d.", - symtab_to_filename_for_display (b->loc->symtab), - b->loc->line_number); + { + puts_filtered (": file "); + fputs_styled (symtab_to_filename_for_display (b->loc->symtab), + file_name_style.style (), + gdb_stdout); + printf_filtered (", line %d.", + b->loc->line_number); + } else /* This is not ideal, but each location may have a different file name, and this at least reflects the diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index 1ab9d68431..df73e25a16 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -33,10 +33,13 @@ save_vars { env(TERM) } { gdb_test_no_output "set style enabled on" set main_expr "\033\\\[33mmain\033\\\[m" - set file_expr "\033\\\[32m.*style\\.c\033\\\[m:\[0-9\]" + set base_file_expr "\033\\\[32m.*style\\.c\033\\\[m" + set file_expr "$base_file_expr:\[0-9\]" set arg_expr "\033\\\[36marg.\033\\\[m" gdb_test "frame" \ "$main_expr.*$arg_expr.*$arg_expr.*$file_expr.*" gdb_test "info breakpoints" "$main_expr at $file_expr.*" + + gdb_test "break main" "file $base_file_expr.*" } -- 2.17.2