From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22049 invoked by alias); 5 May 2012 06:03:36 -0000 Received: (qmail 22034 invoked by uid 22791); 5 May 2012 06:03:32 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,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; Sat, 05 May 2012 06:03:17 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4563G63027901 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 5 May 2012 02:03:16 -0400 Received: from host2.jankratochvil.net (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q4563CsX002884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 5 May 2012 02:03:15 -0400 Date: Sat, 05 May 2012 06:03:00 -0000 From: Jan Kratochvil To: Sergio Durigan Junior Cc: gdb-patches@sourceware.org, Gary Benson Subject: Re: [RFA] Improved linker-debugger interface Message-ID: <20120505060312.GA7019@host2.jankratochvil.net> References: <20120504152129.GA7418@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-05/txt/msg00150.txt.bz2 On Sat, 05 May 2012 06:38:57 +0200, Sergio Durigan Junior wrote: > On Friday, May 04 2012, Gary Benson wrote: > > +struct probe_info > > + { > > + /* The name of the probe. */ > > + const char *name; > > + > > + /* Nonzero if this probe must be stopped at even when > > + stop-on-solib-events is off. */ > > + int mandatory; > > I don't know what others think about it, but the `mandatory' flag can be > a bitfield, like this: > > int mandatory_p : 1; In such case 'unsigned mandatory_p : 1' as otherwise its true value is -1. > Also, since this is a predicate to indicate whether or not something > happens, it's better to put the `_p' suffix. '_p' as a predicate usually flags validity of some other field (such as a hypothetical field 'mandatory' in this case). I do not see the 'predicate' need to be valid here, this is normal flag. > > +static const struct probe_info probe_info[] = > > +{ > > + {"rtld_init_start", 0}, > > + {"rtld_init_complete", 1}, > > + {"rtld_map_start", 0}, > > + {"rtld_reloc_complete", 1}, > > + {"rtld_unmap_start", 0}, > > + {"rtld_unmap_complete", 1}, > > +}; [...] > The brackets should be indented like this: > > struct foo bar[] = > { > { "bla", 0 }, > ... > }; No - see GNU Coding Standards, there is an example for it. Current GDB codebase is not always correct in this regard. > Also, I've been thinking about creating some predicate that would > confirm if some probe is of certain type of not. There is that gdb_assert (probe_generic->pops == &stap_probe_ops); for this purpose. (This is not a Gary's patch review yet.) Thanks, Jan