From: Michael Eager <eager@eagerm.com>
To: gdb-patches@sourceware.org,
Joel Brobecker <brobecker@adacore.com>,
Stan Shebs <stanshebs@earthlink.net>,
Tom Tromey <tromey@redhat.com>
Subject: Re: FYI: minsyms documentation
Date: Sun, 15 Jan 2012 18:49:00 -0000 [thread overview]
Message-ID: <4F13146D.9040301@eagerm.com> (raw)
In-Reply-To: <m3vcp972sf.fsf@fleche.redhat.com>
On 12/21/2011 06:34 PM, Tom Tromey wrote:
> I am checking this in on the trunk.
>
> Today I decided to try to document the minsyms API more or less the way
> I would like APIs to be documented in general. This patch implements
> that; it move documentation from function definitions to minsyms.h, adds
> an introductory comment about minsyms there as well, and it rearranges
> the header into a more logical order.
I realize that I'm late to this discussion, but I dislike this approach
and think that it will make maintaining GDB more difficult and makes
using and maintaining the documentation more difficult.
It requires looking in two places, the .c and the .h at the same
time. When I'm debugging something, the .c is in the debugger window
and if there are any useful comments I see them. This change requires
me to open the .h in a different editor window and search for the
function name. Most of the time I'm not going to do this, since almost
all the time, the comments don't say very much. This means that when
there is a comment which might explain what to me is an unexpected
behavior, I'm likely to see it only much later, if at all, when it
occurs to me that there might be something in the .h file which is
relevant.
Best practice, comments are best kept close to the code that they
refer to. Maintainers are likely to update comments if they are
next to the modified code, and much less likely if the comments are
somewhere else. It doesn't matter if that somewhere else is in a .h
file, or in the .texi files, or in some other area. There are actually
decades of experimental evidence in favor of keeping detailed comments
close to the relevant code, rather than removing them to a different
location.
It would be nice to see GDB documentation improve and documenting
the APIs would be great. I see this as providing high level concept
documentation which explains how a particular API works, why it exists,
and how it interacts with other APIs. Minimal documentation of each
function, without context, is not this. As far as I can tell, there
minsyms.h contains one very short paragraph which provides a bit of
context and there is no general overview.
To use an analogy, this is like giving you the description of a
spark plug, a fuel pump, and a crankshaft, and expecting you to figure
out how these interact to make a car engine turn.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
prev parent reply other threads:[~2012-01-15 18:01 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-22 4:44 Tom Tromey
2011-12-22 5:17 ` Joel Brobecker
2011-12-22 20:13 ` Stan Shebs
2011-12-22 20:21 ` Tom Tromey
2011-12-22 21:06 ` Eli Zaretskii
2011-12-23 4:21 ` Stan Shebs
2011-12-23 16:01 ` Eli Zaretskii
2012-01-02 22:08 ` Tom Tromey
2012-01-03 8:17 ` Eli Zaretskii
2011-12-24 7:45 ` Yao Qi
2011-12-24 13:21 ` Eli Zaretskii
2012-01-02 22:08 ` Tom Tromey
2012-01-03 8:18 ` Eli Zaretskii
2011-12-22 21:18 ` Stan Shebs
2011-12-23 10:38 ` Joel Brobecker
2012-01-02 22:14 ` Tom Tromey
2012-01-03 2:53 ` Joel Brobecker
2012-01-03 11:05 ` Pedro Alves
2012-01-03 13:21 ` commands.h and cli/cli-decode.h dups (was: Re: FYI: minsyms documentation) Pedro Alves
2012-01-03 14:57 ` commands.h and cli/cli-decode.h dups Tom Tromey
2012-01-03 17:11 ` Joel Brobecker
2012-01-05 11:40 ` Pedro Alves
2012-01-03 11:18 ` FYI: minsyms documentation Pedro Alves
2012-01-15 18:49 ` Michael Eager [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F13146D.9040301@eagerm.com \
--to=eager@eagerm.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=stanshebs@earthlink.net \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox