Do not include py-ref.h in most files

py-ref.h can really only be included from a specific spot in
python-internal.h.  The other includes are not useful, and cause
compilation errors if the includes are ever sorted.  So, remove these
includes.

Arguably, py-ref.h should simply not be a separate header.

gdb/ChangeLog
2019-01-22  Tom Tromey  <tom@tromey.com>

	* python/py-arch.c: Do not include py-ref.h.
	* python/py-bpevent.c: Do not include py-ref.h.
	* python/py-cmd.c: Do not include py-ref.h.
	* python/py-continueevent.c: Do not include py-ref.h.
	* python/py-event.h: Do not include py-ref.h.
	* python/py-evtregistry.c: Do not include py-ref.h.
	* python/py-finishbreakpoint.c: Do not include py-ref.h.
	* python/py-frame.c: Do not include py-ref.h.
	* python/py-framefilter.c: Do not include py-ref.h.
	* python/py-function.c: Do not include py-ref.h.
	* python/py-infevents.c: Do not include py-ref.h.
	* python/py-linetable.c: Do not include py-ref.h.
	* python/py-objfile.c: Do not include py-ref.h.
	* python/py-param.c: Do not include py-ref.h.
	* python/py-prettyprint.c: Do not include py-ref.h.
	* python/py-progspace.c: Do not include py-ref.h.
	* python/py-symbol.c: Do not include py-ref.h.
	* python/py-symtab.c: Do not include py-ref.h.
	* python/py-type.c: Do not include py-ref.h.
	* python/py-unwind.c: Do not include py-ref.h.
	* python/py-utils.c: Do not include py-ref.h.
	* python/py-value.c: Do not include py-ref.h.
	* python/py-varobj.c: Do not include py-ref.h.
	* python/py-xmethods.c: Do not include py-ref.h.
	* python/python.c: Do not include py-ref.h.
	* varobj.c: Do not include py-ref.h.
This commit is contained in:
Tom Tromey
2019-01-21 13:49:06 -07:00
parent 6b4d777433
commit 3fabc0163a
27 changed files with 29 additions and 26 deletions

View File

@ -1,3 +1,32 @@
2019-01-22 Tom Tromey <tom@tromey.com>
* python/py-arch.c: Do not include py-ref.h.
* python/py-bpevent.c: Do not include py-ref.h.
* python/py-cmd.c: Do not include py-ref.h.
* python/py-continueevent.c: Do not include py-ref.h.
* python/py-event.h: Do not include py-ref.h.
* python/py-evtregistry.c: Do not include py-ref.h.
* python/py-finishbreakpoint.c: Do not include py-ref.h.
* python/py-frame.c: Do not include py-ref.h.
* python/py-framefilter.c: Do not include py-ref.h.
* python/py-function.c: Do not include py-ref.h.
* python/py-infevents.c: Do not include py-ref.h.
* python/py-linetable.c: Do not include py-ref.h.
* python/py-objfile.c: Do not include py-ref.h.
* python/py-param.c: Do not include py-ref.h.
* python/py-prettyprint.c: Do not include py-ref.h.
* python/py-progspace.c: Do not include py-ref.h.
* python/py-symbol.c: Do not include py-ref.h.
* python/py-symtab.c: Do not include py-ref.h.
* python/py-type.c: Do not include py-ref.h.
* python/py-unwind.c: Do not include py-ref.h.
* python/py-utils.c: Do not include py-ref.h.
* python/py-value.c: Do not include py-ref.h.
* python/py-varobj.c: Do not include py-ref.h.
* python/py-xmethods.c: Do not include py-ref.h.
* python/python.c: Do not include py-ref.h.
* varobj.c: Do not include py-ref.h.
2019-01-22 Tom Tromey <tom@tromey.com> 2019-01-22 Tom Tromey <tom@tromey.com>
* objfiles.h (struct objfile_per_bfd_storage): Use "struct" * objfiles.h (struct objfile_per_bfd_storage): Use "struct"

View File

@ -22,7 +22,6 @@
#include "arch-utils.h" #include "arch-utils.h"
#include "disasm.h" #include "disasm.h"
#include "python-internal.h" #include "python-internal.h"
#include "py-ref.h"
typedef struct arch_object_type_object { typedef struct arch_object_type_object {
PyObject_HEAD PyObject_HEAD

View File

@ -19,7 +19,6 @@
#include "defs.h" #include "defs.h"
#include "py-stopevent.h" #include "py-stopevent.h"
#include "py-ref.h"
/* Create and initialize a BreakpointEvent object. This acquires new /* Create and initialize a BreakpointEvent object. This acquires new
references to BREAKPOINT_LIST and FIRST_BP. */ references to BREAKPOINT_LIST and FIRST_BP. */

View File

@ -27,7 +27,6 @@
#include "cli/cli-decode.h" #include "cli/cli-decode.h"
#include "completer.h" #include "completer.h"
#include "language.h" #include "language.h"
#include "py-ref.h"
/* Struct representing built-in completion types. */ /* Struct representing built-in completion types. */
struct cmdpy_completer struct cmdpy_completer

View File

@ -19,7 +19,6 @@
#include "defs.h" #include "defs.h"
#include "py-event.h" #include "py-event.h"
#include "py-ref.h"
#include "gdbthread.h" #include "gdbthread.h"
/* Create a gdb.ContinueEvent event. gdb.ContinueEvent is-a /* Create a gdb.ContinueEvent event. gdb.ContinueEvent is-a

View File

@ -24,7 +24,6 @@
#include "command.h" #include "command.h"
#include "python-internal.h" #include "python-internal.h"
#include "inferior.h" #include "inferior.h"
#include "py-ref.h"
/* Declare all event types. */ /* Declare all event types. */
#define GDB_PY_DEFINE_EVENT_TYPE(name, py_name, doc, base) \ #define GDB_PY_DEFINE_EVENT_TYPE(name, py_name, doc, base) \

View File

@ -20,7 +20,6 @@
#include "defs.h" #include "defs.h"
#include "command.h" #include "command.h"
#include "py-events.h" #include "py-events.h"
#include "py-ref.h"
events_object gdb_py_events; events_object gdb_py_events;

View File

@ -30,7 +30,6 @@
#include "inferior.h" #include "inferior.h"
#include "block.h" #include "block.h"
#include "location.h" #include "location.h"
#include "py-ref.h"
/* Function that is called when a Python finish bp is found out of scope. */ /* Function that is called when a Python finish bp is found out of scope. */
static const char outofscope_func[] = "out_of_scope"; static const char outofscope_func[] = "out_of_scope";

View File

@ -28,7 +28,6 @@
#include "symfile.h" #include "symfile.h"
#include "objfiles.h" #include "objfiles.h"
#include "user-regs.h" #include "user-regs.h"
#include "py-ref.h"
typedef struct { typedef struct {
PyObject_HEAD PyObject_HEAD

View File

@ -30,7 +30,6 @@
#include "demangle.h" #include "demangle.h"
#include "mi/mi-cmds.h" #include "mi/mi-cmds.h"
#include "python-internal.h" #include "python-internal.h"
#include "py-ref.h"
#include "common/gdb_optional.h" #include "common/gdb_optional.h"
enum mi_print_types enum mi_print_types

View File

@ -27,7 +27,6 @@
#include "completer.h" #include "completer.h"
#include "expression.h" #include "expression.h"
#include "language.h" #include "language.h"
#include "py-ref.h"
extern PyTypeObject fnpy_object_type extern PyTypeObject fnpy_object_type
CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("PyObject"); CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("PyObject");

View File

@ -19,7 +19,6 @@
#include "defs.h" #include "defs.h"
#include "py-event.h" #include "py-event.h"
#include "py-ref.h"
/* Construct either a gdb.InferiorCallPreEvent or a /* Construct either a gdb.InferiorCallPreEvent or a
gdb.InferiorCallPostEvent. */ gdb.InferiorCallPostEvent. */

View File

@ -19,7 +19,6 @@
#include "defs.h" #include "defs.h"
#include "python-internal.h" #include "python-internal.h"
#include "py-ref.h"
typedef struct { typedef struct {
PyObject_HEAD PyObject_HEAD

View File

@ -24,7 +24,6 @@
#include "language.h" #include "language.h"
#include "build-id.h" #include "build-id.h"
#include "symtab.h" #include "symtab.h"
#include "py-ref.h"
typedef struct typedef struct
{ {

View File

@ -27,7 +27,6 @@
#include "completer.h" #include "completer.h"
#include "language.h" #include "language.h"
#include "arch-utils.h" #include "arch-utils.h"
#include "py-ref.h"
/* Parameter constants and their values. */ /* Parameter constants and their values. */
struct parm_constant struct parm_constant

View File

@ -25,7 +25,6 @@
#include "extension-priv.h" #include "extension-priv.h"
#include "python.h" #include "python.h"
#include "python-internal.h" #include "python-internal.h"
#include "py-ref.h"
/* Return type of print_string_repr. */ /* Return type of print_string_repr. */

View File

@ -24,7 +24,6 @@
#include "objfiles.h" #include "objfiles.h"
#include "language.h" #include "language.h"
#include "arch-utils.h" #include "arch-utils.h"
#include "py-ref.h"
#include "solib.h" #include "solib.h"
#include "block.h" #include "block.h"

View File

@ -23,7 +23,6 @@
#include "symtab.h" #include "symtab.h"
#include "python-internal.h" #include "python-internal.h"
#include "objfiles.h" #include "objfiles.h"
#include "py-ref.h"
typedef struct sympy_symbol_object { typedef struct sympy_symbol_object {
PyObject_HEAD PyObject_HEAD

View File

@ -24,7 +24,6 @@
#include "python-internal.h" #include "python-internal.h"
#include "objfiles.h" #include "objfiles.h"
#include "block.h" #include "block.h"
#include "py-ref.h"
typedef struct stpy_symtab_object { typedef struct stpy_symtab_object {
PyObject_HEAD PyObject_HEAD

View File

@ -28,7 +28,6 @@
#include "language.h" #include "language.h"
#include "vec.h" #include "vec.h"
#include "typeprint.h" #include "typeprint.h"
#include "py-ref.h"
typedef struct pyty_type_object typedef struct pyty_type_object
{ {

View File

@ -28,7 +28,6 @@
#include "regcache.h" #include "regcache.h"
#include "valprint.h" #include "valprint.h"
#include "user-regs.h" #include "user-regs.h"
#include "py-ref.h"
#define TRACE_PY_UNWIND(level, args...) if (pyuw_debug >= level) \ #define TRACE_PY_UNWIND(level, args...) if (pyuw_debug >= level) \
{ fprintf_unfiltered (gdb_stdlog, args); } { fprintf_unfiltered (gdb_stdlog, args); }

View File

@ -21,7 +21,6 @@
#include "charset.h" #include "charset.h"
#include "value.h" #include "value.h"
#include "python-internal.h" #include "python-internal.h"
#include "py-ref.h"
/* Converts a Python 8-bit string to a unicode string object. Assumes the /* Converts a Python 8-bit string to a unicode string object. Assumes the
8-bit string is in the host charset. If an error occurs during conversion, 8-bit string is in the host charset. If an error occurs during conversion,

View File

@ -29,7 +29,6 @@
#include "python.h" #include "python.h"
#include "python-internal.h" #include "python-internal.h"
#include "py-ref.h"
/* Even though Python scalar types directly map to host types, we use /* Even though Python scalar types directly map to host types, we use
target types here to remain consistent with the values system in target types here to remain consistent with the values system in

View File

@ -17,7 +17,6 @@
#include "python-internal.h" #include "python-internal.h"
#include "varobj.h" #include "varobj.h"
#include "varobj-iter.h" #include "varobj-iter.h"
#include "py-ref.h"
/* A dynamic varobj iterator "class" for python pretty-printed /* A dynamic varobj iterator "class" for python pretty-printed
varobjs. This inherits struct varobj_iter. */ varobjs. This inherits struct varobj_iter. */

View File

@ -26,7 +26,6 @@
#include "python.h" #include "python.h"
#include "python-internal.h" #include "python-internal.h"
#include "py-ref.h"
static const char enabled_field_name[] = "enabled"; static const char enabled_field_name[] = "enabled";
static const char match_method_name[] = "match"; static const char match_method_name[] = "match";

View File

@ -98,7 +98,6 @@ const struct extension_language_defn extension_language_python =
#include "gdbthread.h" #include "gdbthread.h"
#include "interps.h" #include "interps.h"
#include "event-top.h" #include "event-top.h"
#include "py-ref.h"
#include "py-event.h" #include "py-event.h"
/* True if Python has been successfully initialized, false /* True if Python has been successfully initialized, false

View File

@ -35,7 +35,6 @@
#if HAVE_PYTHON #if HAVE_PYTHON
#include "python/python.h" #include "python/python.h"
#include "python/python-internal.h" #include "python/python-internal.h"
#include "python/py-ref.h"
#else #else
typedef int PyObject; typedef int PyObject;
#endif #endif