From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3070 invoked by alias); 31 Aug 2010 13:02:29 -0000 Received: (qmail 2970 invoked by uid 22791); 31 Aug 2010 13:02:28 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 31 Aug 2010 13:02:21 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7VD1vPN014635 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 31 Aug 2010 09:01:57 -0400 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7VD1ra8008148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 31 Aug 2010 09:01:56 -0400 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o7VD1rsK009521; Tue, 31 Aug 2010 15:01:53 +0200 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o7VD1qC5009518; Tue, 31 Aug 2010 15:01:52 +0200 Date: Tue, 31 Aug 2010 13:02:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: Joel Brobecker , gdb-patches@sourceware.org Subject: Re: [patch] Code cleanup: Make function typedef for find memory region Message-ID: <20100831130152.GB9173@host1.dyn.jankratochvil.net> References: <20100830085953.GA25961@host1.dyn.jankratochvil.net> <20100830141454.GG2986@adacore.com> <20100830142507.GA1356@host1.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) 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: 2010-08/txt/msg00546.txt.bz2 On Mon, 30 Aug 2010 20:38:06 +0200, Tom Tromey wrote: > >>>>> "Jan" == Jan Kratochvil writes: > > Jan> I am also for requiring comment to be placed at the function > Jan> definition and not at its declaration. Using tag jumps one will > Jan> never find the declaration and I have considered these functions to > Jan> have no comment (randomly found now > Jan> simple_displaced_step_copy_insn, it was a different function I had > Jan> the problem with). > > I think there are three cases. > > One case is the "bcache" case: you have a relatively simple data > structure with a defined public API. In this case, I find it it > convenient to be able to read the header file to see the entire exported > API, without being distracted by the implementation. This case is maybe > not as typical as we might like; many data types in gdb are semi-opaque > at best. This is definitely a disagreement. Such general guide should be in doc/gdbint.texinfo . > The second case is implementations of virtual methods. Here, the > comment belongs at the point of definition. I think commenting the > method implementation is actually (mildly) bad, because it means copying > documentation, with the problems that implies. Implementation should name the field in the interface to be able to jump there. > That said, my general rule for hacking on gdb is to just follow whatever > style is in use wherever I am hacking. I also do so but I still find it wrong. Thanks, Jan