From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25326 invoked by alias); 31 Dec 2018 08:13:32 -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 25307 invoked by uid 89); 31 Dec 2018 08:13:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=3rd, thinks, breaks, silent X-HELO: mailsec103.isp.belgacom.be Received: from mailsec103.isp.belgacom.be (HELO mailsec103.isp.belgacom.be) (195.238.20.99) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 31 Dec 2018 08:13:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1546244008; x=1577780008; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=CiH7+v1Y3pdNOOHQfV/lYxuQ6XqKIccBtDXkWZwBS34=; b=SFTI/mn8MqMoyV5E6/GdHZ7JpjaaDzkHGHztCEqL+dq3xDVty+4Sjp1T bEYIUgzW54PbQhG1IWrF7320/j6BDQ==; 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; 31 Dec 2018 09:13:25 +0100 Message-ID: <1546244005.12900.20.camel@skynet.be> Subject: Re: GDB ui word wrapping broken/interferes with 'set style' ? From: Philippe Waroquiers To: Tom Tromey Cc: gdb-patches@sourceware.org Date: Mon, 31 Dec 2018 08:13:00 -0000 In-Reply-To: <877efqlgu6.fsf@tromey.com> References: <1546181481.12900.10.camel@skynet.be> <87ftuelq21.fsf@tromey.com> <877efqlgu6.fsf@tromey.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00445.txt.bz2 On Sun, 2018-12-30 at 16:45 -0700, Tom Tromey wrote: > Tom> Seems very likely. Thanks for the report, I will look into it. > > Please try this. I think it fixes both of the styling problems you > reported, but it's better if you check it too. If it works for you I > will write a test case. Function and address colors are now as expected in the backtrace. For word wrapping, I could not make it split addresses anymore, but I still see differences with the 8.2 behaviour, where the new gdb git+patch still splits filenames or some values. 8.2:  (gdb) bt #0 proc_in_c () at /bd/home/philippe/gdb/git/smallthing/gdb/testsuite/gdb.ada/info_auto_lang/some_c.c:26 #1 0x0000555555555477 in proc_in_ada () at /bd/home/philippe/gdb/git/smallthing/gdb/testsuite/gdb.ada/info_auto_lang/proc_in_ada.adb:22 (gdb) git+patch: (gdb) bt #0 proc_in_c () at /bd/home/philippe/gdb/git/smallthing/gdb/testsuite/gdb.ada/info_auto_lang/some_c.c:26 #1 0x0000555555555477 in proc_in_ada () at /bd/home/philippe/gdb/git/smallthing/gdb/testsuite/gdb.ada/info_auto_lan g/proc_in_ada.adb:22 (gdb) (in both cases, 'show width' shows 116). In a top-gdb debugging itself, I e.g. got the 'style' value which is split after FUNCTIO: Breakpoint 3, cli_ui_out::do_field_string (this=0x562a4563f010, fldno=, width=, align= ui_noalign, fldname=, string=0x7ffd643d1ac8 "proc_in_ada", style=ui_out_style_kind::FUNCTIO N) at ../../smallthing/gdb/cli-out.c:174 174 fstyle = function_name_style.style (); (top-gdb) show width Number of characters gdb thinks are in a line is 116. If I change the width, the new gdb gives: (gdb) set width 40 (gdb) bt #0 proc_in_c () at /bd/home/philippe/gd b/git/smallthing/gdb/testsuite/gdb.ada/info_auto_lang/some_c.c:26 #1 0x0000555555555477 in proc_in_ada () at /bd/home/philippe/gdb/git/smal lthing/gdb/testsuite/gdb.ada/info_auto_lang/proc_in_ada.adb:22 (gdb) while 8.2 gives: (gdb) set width 40 (gdb) bt #0 proc_in_c () at /bd/home/philippe/gdb/git/smallthing/gdb/testsuite/gdb.ada/info_auto_lang/some_c.c:26 #1 0x0000555555555477 in proc_in_ada () at /bd/home/philippe/gdb/git/smallthing/gdb/testsuite/gdb.ada/info_auto_lang/proc_in_ada.adb:22 (gdb) Playing further with smaller width, git+patch: > thanks, > Tom > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index 7be4360e62..0d1fcb79f1 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,7 @@ > +2018-12-30 Tom Tromey > + > + * utils.c (flush_wrap_buffer): Only flush gdb_stdout. > + > 2018-12-30 Tom Tromey > > * event-top.h (command_line_handler): Update. > diff --git a/gdb/utils.c b/gdb/utils.c > index 3a6f796f2b..753eb14280 100644 > --- a/gdb/utils.c > +++ b/gdb/utils.c > @@ -1589,7 +1589,7 @@ reinitialize_more_filter (void) > static void > flush_wrap_buffer (struct ui_file *stream) > { > - if (!wrap_buffer.empty ()) > + if (stream == gdb_stdout && !wrap_buffer.empty ()) > { > fputs_unfiltered (wrap_buffer.c_str (), stream); > wrap_buffer.clear ();