Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gdb_indent vs. dwarf2read
@ 2003-01-27  3:10 Daniel Jacobowitz
  2003-01-27 17:11 ` Kevin Buettner
  2003-01-27 17:30 ` Andrew Cagney
  0 siblings, 2 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2003-01-27  3:10 UTC (permalink / raw)
  To: gdb

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'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, which matches the general style
in GDB; and comments like:
  1) foo
     bar
reindented to
  1) foo
  bar
.  Should we slavishly obey GNU indent in this, or should I reformat the
comments by hand before posting the reindentation patch?]

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gdb_indent vs. dwarf2read
  2003-01-27  3:10 gdb_indent vs. dwarf2read Daniel Jacobowitz
@ 2003-01-27 17:11 ` Kevin Buettner
  2003-01-27 17:30 ` Andrew Cagney
  1 sibling, 0 replies; 8+ messages in thread
From: Kevin Buettner @ 2003-01-27 17:11 UTC (permalink / raw)
  To: Daniel Jacobowitz, gdb

On Jan 26, 10:11pm, Daniel Jacobowitz wrote:

> What do people think about adding "-T bfd -T asection" to gdb_indent.sh? 

I think it makes sense.

> [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, which matches the general style
> in GDB; and comments like:
>   1) foo
>      bar
> reindented to
>   1) foo
>   bar
> .  Should we slavishly obey GNU indent in this, or should I reformat the
> comments by hand before posting the reindentation patch?]

The problem with reformatting the comments (or anything else) by hand
is that someone else who runs GNU indent probably won't do the same
hand formatting.  If there's something you don't want indent to touch,
use /* *INDENT-OFF* */ (and later on, at the right point, /* *INDENT-ON* */.

Kevin


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gdb_indent vs. dwarf2read
  2003-01-27  3:10 gdb_indent vs. dwarf2read Daniel Jacobowitz
  2003-01-27 17:11 ` Kevin Buettner
@ 2003-01-27 17:30 ` Andrew Cagney
  2003-01-27 17:43   ` Daniel Jacobowitz
  1 sibling, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2003-01-27 17:30 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

> 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....

> [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.

 > 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.

> .  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.

Andrew



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gdb_indent vs. dwarf2read
  2003-01-27 17:30 ` Andrew Cagney
@ 2003-01-27 17:43   ` Daniel Jacobowitz
  2003-01-27 19:05     ` Andrew Cagney
  2003-01-27 20:02     ` breakpoints jacques
  0 siblings, 2 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2003-01-27 17:43 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gdb_indent vs. dwarf2read
  2003-01-27 17:43   ` Daniel Jacobowitz
@ 2003-01-27 19:05     ` Andrew Cagney
  2003-01-27 19:17       ` Daniel Jacobowitz
  2003-01-27 20:02     ` breakpoints jacques
  1 sibling, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2003-01-27 19:05 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

> .  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?

GDB's indentation is defined by the output of indent.  That one isn't 
open to negotation.

Please don't waste this lists time by re-visiting a dead issue.

Andrew



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gdb_indent vs. dwarf2read
  2003-01-27 19:05     ` Andrew Cagney
@ 2003-01-27 19:17       ` Daniel Jacobowitz
  2003-01-27 20:44         ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2003-01-27 19:17 UTC (permalink / raw)
  To: gdb

On Mon, Jan 27, 2003 at 02:05:00PM -0500, Andrew Cagney wrote:
> >.  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?
> 
> GDB's indentation is defined by the output of indent.  That one isn't 
> open to negotation.
> 
> Please don't waste this lists time by re-visiting a dead issue.

Please don't shoot me in the head for asking an honest question.  It's
apparently been dead for longer than I've been on the GDB lists, and
the issue is not mentioned in MAINTAINERS or in the GDB internals
documentation.  Or even in a comment in gdb_indent.sh.  It wasn't
obvious to me that writing comments with indentation was against GDB's
formatting policies.

It should be documented, obviously.  It would be nice if there were
also a brief rationale, to prevent recurring arguments about what seems
at first glance to be a completely arbitrary decision.  I'm somewhat
unsettled by your response.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 8+ messages in thread

* breakpoints
  2003-01-27 17:43   ` Daniel Jacobowitz
  2003-01-27 19:05     ` Andrew Cagney
@ 2003-01-27 20:02     ` jacques
  1 sibling, 0 replies; 8+ messages in thread
From: jacques @ 2003-01-27 20:02 UTC (permalink / raw)
  Cc: gdb

How do I set a breakpoint right after the last expression in a for loop? 
Thanks.
--Jacques


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gdb_indent vs. dwarf2read
  2003-01-27 19:17       ` Daniel Jacobowitz
@ 2003-01-27 20:44         ` Andrew Cagney
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Cagney @ 2003-01-27 20:44 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

> On Mon, Jan 27, 2003 at 02:05:00PM -0500, Andrew Cagney wrote:
> 
>> >.  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?
> 
>> 
>> GDB's indentation is defined by the output of indent.  That one isn't 
>> open to negotation.
>> 
>> Please don't waste this lists time by re-visiting a dead issue.
> 
> 
> Please don't shoot me in the head for asking an honest question.  It's
> apparently been dead for longer than I've been on the GDB lists, and
> the issue is not mentioned in MAINTAINERS or in the GDB internals
> documentation.  Or even in a comment in gdb_indent.sh.

The original indent occured ~99.

Search for `shebs indent' in the gdb@ mailing list.  There are a number 
of threads and that appears to find most of them.

Stan Shebs considered the comment problem but, in the end, went with 
straight indent with no arguments and used INDENT-ON / INDENT-OFF where 
he decided the output was too nasty.

gdb_indent.sh was added ~ November 2001.

 >  It wasn't
 > obvious to me that writing comments with indentation was against GDB's
 > formatting policies.

You can certainly format comments anyway you like.  Just don't be 
suprised if someone runs gdb_indent.sh over the file causing them to be 
reformatted.

> It should be documented, obviously.  It would be nice if there were
> also a brief rationale, to prevent recurring arguments about what seems
> at first glance to be a completely arbitrary decision.  I'm somewhat
> unsettled by your response.

PR gdb/712. PR gdb/698.

Indent's default mode (i.e., with no formattting arguments) should match 
the GNU coding style.  gdb_indent.sh runs indent in that mode so that 
it's indentation style matches the GNU coding style (-T isn't a 
formatting option).

Like I said, dead issue, lets get on to the real problems at hand.

Andrew



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-01-27 20:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-27  3:10 gdb_indent vs. dwarf2read Daniel Jacobowitz
2003-01-27 17:11 ` Kevin Buettner
2003-01-27 17:30 ` Andrew Cagney
2003-01-27 17:43   ` Daniel Jacobowitz
2003-01-27 19:05     ` Andrew Cagney
2003-01-27 19:17       ` Daniel Jacobowitz
2003-01-27 20:44         ` Andrew Cagney
2003-01-27 20:02     ` breakpoints jacques

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox