From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3788 invoked by alias); 25 Feb 2011 14:44:35 -0000 Received: (qmail 3768 invoked by uid 22791); 25 Feb 2011 14:44:34 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Feb 2011 14:44:28 +0000 Received: (qmail 23196 invoked from network); 25 Feb 2011 14:44:26 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Feb 2011 14:44:26 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [rfc] More intelligent indenting of multi-line table entries (Re: [RFA] Implement support for PowerPC BookE ranged breakpoints) Date: Fri, 25 Feb 2011 14:46:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-25-generic; KDE/4.6.0; x86_64; ; ) Cc: "Ulrich Weigand" , Thiago Jung Bauermann References: <201102242041.p1OKfCYx021152@d06av02.portsmouth.uk.ibm.com> In-Reply-To: <201102242041.p1OKfCYx021152@d06av02.portsmouth.uk.ibm.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201102251444.17070.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2011-02/txt/msg00767.txt.bz2 On Thursday 24 February 2011 20:41:12, Ulrich Weigand wrote: > Now the thing is, the UI table layer already knows exactly where > that column starts, so it is kind of pointless to attempt to > re-compute that offset. In particular, since the code currently > gets it completely wrong anyway: at some point, another column of > variable size was added --see print_type_col_width in breakpoint_1-- > but the wrap_indent logic was never updated. Whoops. Guilty, but it goes further back than that. It looks like it got broken when we made the "Num" column wider: 7.0: Num Type Disp Enb Address What 1 breakpoint keep y 0x080912fb in internal_error at ../../src/gdb/utils.c:1048 6.0: Num Type Disp Enb Address What 1 breakpoint keep y 0x08122147 in internal_error at ../../gdb-6.0/gdb/utils.c:807 Shows how fragile that code was. Makes me wonder about making that column's width dynamic as well. > My thought was to remove that redundancy completely, and simply > ask the UI table layer for the correct position. It turns out > that this needs some new functionality exported from that layer, > but a simply query for the field information you originally > passed to that layer suffices. >=20 > The following patch implements this suggestion; it fixes the currently > broken indentation and gets rid of the silly arguments to the > print_breakpoint_location function. >=20 > Tested on i386-linux and by manual inspection of line wrapping. >=20 > Any comments? Looks great to me. I've mentioned this before, but I think it'd really be nice that the table layout support was reworked to be able to auto wrap (and size perhaps) columns nicely, =E0 la emacs' org-mode, vis: | Num | Name | What | Other column | |-----+--------------+----------+--------------| | 1 | foo bar | foo | another | | | | bar what | broken | | | | | sentence | |-----+--------------+----------+--------------| | 2 | the other | what? | yummy | so that all colums would line-break nicely without messing their rightmost columns. (without the guide lines, of course). --=20 Pedro Alves