From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15574 invoked by alias); 8 Nov 2012 19:37:40 -0000 Received: (qmail 15162 invoked by uid 22791); 8 Nov 2012 19:37:38 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS 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; Thu, 08 Nov 2012 19:37:25 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA8JbJCD030534 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 8 Nov 2012 14:37:20 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qA8JbGsj005866 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 8 Nov 2012 14:37:17 -0500 From: Tom Tromey To: Pedro Alves Cc: Pierre Muller , gdb-patches@sourceware.org Subject: Re: [PATCH] Always include defs.h first. References: <20121107201107.25258.47267.stgit@brno.lan> <000301cdbdd3$1b0f7780$512e6680$@muller@ics-cnrs.unistra.fr> <509BE8F3.4090605@redhat.com> Date: Thu, 08 Nov 2012 19:37:00 -0000 In-Reply-To: <509BE8F3.4090605@redhat.com> (Pedro Alves's message of "Thu, 08 Nov 2012 17:16:35 +0000") Message-ID: <87625fj383.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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-11/txt/msg00208.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> Yeah. They're getting it from those headers. IMO, this makes it Pedro> easy to forget about it, and risk some change adding the inclusion Pedro> of a system header before including py-events.h, etc. But since Pedro> we don't have consensus, I'll leave it at that. My view is that the uses of defs.h in python/*.h are just review errors. If I had noticed this when the patches went in, I would have prevented it. Furthermore I think it doesn't really make sense to approach this halfway. There's no principled reason that only python/*.c should fail to include defs.h first. It makes gdb less consistent but not to any end. Finally, the defs.h rule is in gdbint.texinfo. On the basis of this last point, I am committing the appended. Tested by rebuilding. Tom 2012-11-08 Tom Tromey * python/py-bpevent.c: Include defs.h. * python/py-continueevent.c: Include defs.h. * python/py-event.c: Include defs.h. * python/py-event.h: Don't include defs.h. * python/py-events.h: Don't include defs.h. * python/py-evts.c: Include defs.h. * python/py-exitedevent.c: Include defs.h. * python/py-newobjfileevent.c: Include defs.h. * python/py-signalevent.c: Include defs.h. * python/py-stopevent.c: Include defs.h. * python/py-threadevent.c: Include defs.h. Index: python/py-bpevent.c =================================================================== RCS file: /cvs/src/src/gdb/python/py-bpevent.c,v retrieving revision 1.4 diff -u -r1.4 py-bpevent.c --- python/py-bpevent.c 15 Aug 2012 14:22:02 -0000 1.4 +++ python/py-bpevent.c 8 Nov 2012 19:31:13 -0000 @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "defs.h" #include "py-stopevent.h" static PyTypeObject breakpoint_event_object_type; Index: python/py-continueevent.c =================================================================== RCS file: /cvs/src/src/gdb/python/py-continueevent.c,v retrieving revision 1.3 diff -u -r1.3 py-continueevent.c --- python/py-continueevent.c 1 Mar 2012 21:06:54 -0000 1.3 +++ python/py-continueevent.c 8 Nov 2012 19:31:13 -0000 @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "defs.h" #include "py-event.h" static PyTypeObject continue_event_object_type; Index: python/py-event.c =================================================================== RCS file: /cvs/src/src/gdb/python/py-event.c,v retrieving revision 1.4 diff -u -r1.4 py-event.c --- python/py-event.c 15 Aug 2012 14:22:02 -0000 1.4 +++ python/py-event.c 8 Nov 2012 19:31:13 -0000 @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "defs.h" #include "py-event.h" void Index: python/py-event.h =================================================================== RCS file: /cvs/src/src/gdb/python/py-event.h,v retrieving revision 1.5 diff -u -r1.5 py-event.h --- python/py-event.h 4 Jan 2012 08:17:25 -0000 1.5 +++ python/py-event.h 8 Nov 2012 19:31:13 -0000 @@ -20,7 +20,6 @@ #ifndef GDB_PY_EVENT_H #define GDB_PY_EVENT_H -#include "defs.h" #include "py-events.h" #include "command.h" #include "python-internal.h" Index: python/py-events.h =================================================================== RCS file: /cvs/src/src/gdb/python/py-events.h,v retrieving revision 1.4 diff -u -r1.4 py-events.h --- python/py-events.h 4 Jan 2012 08:17:25 -0000 1.4 +++ python/py-events.h 8 Nov 2012 19:31:13 -0000 @@ -20,7 +20,6 @@ #ifndef GDB_PY_EVENTS_H #define GDB_PY_EVENTS_H -#include "defs.h" #include "command.h" #include "python-internal.h" #include "inferior.h" Index: python/py-evts.c =================================================================== RCS file: /cvs/src/src/gdb/python/py-evts.c,v retrieving revision 1.4 diff -u -r1.4 py-evts.c --- python/py-evts.c 4 Jan 2012 08:17:25 -0000 1.4 +++ python/py-evts.c 8 Nov 2012 19:31:13 -0000 @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "defs.h" #include "py-events.h" /* Initialize python events. */ Index: python/py-exitedevent.c =================================================================== RCS file: /cvs/src/src/gdb/python/py-exitedevent.c,v retrieving revision 1.5 diff -u -r1.5 py-exitedevent.c --- python/py-exitedevent.c 15 Aug 2012 14:22:02 -0000 1.5 +++ python/py-exitedevent.c 8 Nov 2012 19:31:13 -0000 @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "defs.h" #include "py-event.h" static PyTypeObject exited_event_object_type; Index: python/py-newobjfileevent.c =================================================================== RCS file: /cvs/src/src/gdb/python/py-newobjfileevent.c,v retrieving revision 1.5 diff -u -r1.5 py-newobjfileevent.c --- python/py-newobjfileevent.c 6 Sep 2012 20:14:13 -0000 1.5 +++ python/py-newobjfileevent.c 8 Nov 2012 19:31:13 -0000 @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "defs.h" #include "py-event.h" static PyTypeObject new_objfile_event_object_type; Index: python/py-signalevent.c =================================================================== RCS file: /cvs/src/src/gdb/python/py-signalevent.c,v retrieving revision 1.4 diff -u -r1.4 py-signalevent.c --- python/py-signalevent.c 15 Aug 2012 14:22:02 -0000 1.4 +++ python/py-signalevent.c 8 Nov 2012 19:31:13 -0000 @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "defs.h" #include "py-stopevent.h" static PyTypeObject signal_event_object_type; Index: python/py-stopevent.c =================================================================== RCS file: /cvs/src/src/gdb/python/py-stopevent.c,v retrieving revision 1.6 diff -u -r1.6 py-stopevent.c --- python/py-stopevent.c 15 Aug 2012 14:22:02 -0000 1.6 +++ python/py-stopevent.c 8 Nov 2012 19:31:13 -0000 @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "defs.h" #include "py-stopevent.h" PyObject * Index: python/py-threadevent.c =================================================================== RCS file: /cvs/src/src/gdb/python/py-threadevent.c,v retrieving revision 1.3 diff -u -r1.3 py-threadevent.c --- python/py-threadevent.c 15 Aug 2012 14:22:02 -0000 1.3 +++ python/py-threadevent.c 8 Nov 2012 19:31:13 -0000 @@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "defs.h" #include "py-event.h" /* thread events can either be thread specific or process wide. If gdb is