Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>,
	       gdb-patches@sourceware.org
Subject: Re: [PATCH] Always include defs.h first.
Date: Thu, 08 Nov 2012 19:37:00 -0000	[thread overview]
Message-ID: <87625fj383.fsf@fleche.redhat.com> (raw)
In-Reply-To: <509BE8F3.4090605@redhat.com> (Pedro Alves's message of "Thu, 08	Nov 2012 17:16:35 +0000")

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> 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  <tromey@redhat.com>

	* 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 <http://www.gnu.org/licenses/>.  */
 
+#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 <http://www.gnu.org/licenses/>.  */
 
+#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 <http://www.gnu.org/licenses/>.  */
 
+#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 <http://www.gnu.org/licenses/>.  */
 
+#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 <http://www.gnu.org/licenses/>.  */
 
+#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 <http://www.gnu.org/licenses/>.  */
 
+#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 <http://www.gnu.org/licenses/>.  */
 
+#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 <http://www.gnu.org/licenses/>.  */
 
+#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 <http://www.gnu.org/licenses/>.  */
 
+#include "defs.h"
 #include "py-event.h"
 
 /* thread events can either be thread specific or process wide.  If gdb is


      reply	other threads:[~2012-11-08 19:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07 20:11 Pedro Alves
2012-11-08  1:34 ` Doug Evans
2012-11-08 16:49   ` Pedro Alves
2012-11-08 18:12     ` Doug Evans
2012-11-08 18:39       ` Joel Brobecker
2012-11-08 18:50         ` Pedro Alves
2012-11-08 18:55       ` Pedro Alves
2012-11-08 19:00         ` Doug Evans
2012-11-08 19:15         ` Joel Brobecker
2012-11-08 19:21     ` Tom Tromey
2012-11-08  3:49 ` Yao Qi
2012-11-08  5:04   ` Joel Brobecker
2012-11-08 16:56   ` Pedro Alves
2012-11-09  8:12     ` Yao Qi
2012-11-08 17:04 ` Pierre Muller
2012-11-08 17:16   ` Pedro Alves
2012-11-08 19:37     ` Tom Tromey [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=87625fj383.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    /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