From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20936 invoked by alias); 27 Jan 2003 17:43:23 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 20927 invoked from network); 27 Jan 2003 17:43:23 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 172.16.49.205 with SMTP; 27 Jan 2003 17:43:23 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18dFAv-0003Sy-00; Mon, 27 Jan 2003 13:44:09 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18dDIQ-0002Iw-00; Mon, 27 Jan 2003 12:43:46 -0500 Date: Mon, 27 Jan 2003 17:43:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: gdb@sources.redhat.com Subject: Re: gdb_indent vs. dwarf2read Message-ID: <20030127174346.GA23136@nevyn.them.org> Mail-Followup-To: Andrew Cagney , gdb@sources.redhat.com References: <20030127031101.GA17969@nevyn.them.org> <3E356CAD.1000306@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3E356CAD.1000306@redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-01/txt/msg00435.txt.bz2 On Mon, Jan 27, 2003 at 12:30:21PM -0500, Andrew Cagney wrote: > >What do people think about adding "-T bfd -T asection" to gdb_indent.sh? > >That's the majority style in current GDB, and we do it for some other > >similar types. > > I thought they were already.... Nope. We scan _our_ headers, but not BFD's. We could scan all of BFD's headers in gdb_indent.sh, but I suspect it's not worth it. > >[I'd like to re-indent dwarf2read.c, so I was looking over the results of > >gdb_indent.sh on it before posting the patch. Other churn: structs moved > >from two spaces indented to the left column > > Structs should not be indented two spaces. > > There was one release of indent that did the two space struct. GDB, > unfortunatly, happened to do its jumbo re-indent using that version. > Ever since then, re-indents have been `fixing' this foobar. Ah OK, that, makes sense. > > which matches the general style > >in GDB; and comments like: > > 1) foo > > bar > >reindented to > > 1) foo > > bar > > Can you give a real example? It might be a bug. There is also the > no-indent comment mechanism for comments that really should not be > re-indented. Here's the first one in the file: /* We use dwarf2_tmp_obstack for objects that don't need to survive the partial symbol scan, like attribute values. We could reduce our peak memory consumption during partial symbol table construction by freeing stuff from this obstack more often --- say, after processing each compilation unit, or each die --- but it turns out that this saves almost nothing. For an executable with 11Mb of Dwarf 2 data, I found about 64k allocated on dwarf2_tmp_obstack. Some investigation showed: 1) 69% of the attributes used forms DW_FORM_addr, DW_FORM_data*, DW_FORM_flag, DW_FORM_[su]data, and DW_FORM_ref*. These are all fixed-length values not requiring dynamic allocation. The indented block is reflowed to something like: 1) 69% of the attributes used forms DW_FORM_addr, DW_FORM_data*, DW_FORM_flag, DW_FORM_[su]data, and DW_FORM_ref*. These are all fixed-length values not requiring dynamic allocation. I personally wish indent didn't do this; I write this kind of comment. But at the same time it's useful that it reflows text in comments, especially since I edit in a >80 column terminal. > >. Should we slavishly obey GNU indent in this, or should I reformat the > >comments by hand before posting the reindentation patch?] > > GDB's indentation is defined by the output of indent. That one isn't > open to negotation. OK; but if people prefer to write formatted comments, we could specify indent options, couldn't we? Or are we defined by the decisions of the Indent maintainers? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer