summaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-arch.c8
-rw-r--r--gdb/python/py-auto-load.c12
-rw-r--r--gdb/python/py-block.c8
-rw-r--r--gdb/python/py-bpevent.c2
-rw-r--r--gdb/python/py-breakpoint.c22
-rw-r--r--gdb/python/py-cmd.c14
-rw-r--r--gdb/python/py-continueevent.c4
-rw-r--r--gdb/python/py-event.c2
-rw-r--r--gdb/python/py-event.h4
-rw-r--r--gdb/python/py-events.h4
-rw-r--r--gdb/python/py-evtregistry.c6
-rw-r--r--gdb/python/py-evts.c2
-rw-r--r--gdb/python/py-exitedevent.c2
-rw-r--r--gdb/python/py-finishbreakpoint.c12
-rw-r--r--gdb/python/py-frame.c14
-rw-r--r--gdb/python/py-framefilter.c24
-rw-r--r--gdb/python/py-function.c12
-rw-r--r--gdb/python/py-gdb-readline.c8
-rw-r--r--gdb/python/py-inferior.c18
-rw-r--r--gdb/python/py-infevents.c2
-rw-r--r--gdb/python/py-infthread.c6
-rw-r--r--gdb/python/py-instruction.c2
-rw-r--r--gdb/python/py-lazy-string.c8
-rw-r--r--gdb/python/py-linetable.c2
-rw-r--r--gdb/python/py-newobjfileevent.c2
-rw-r--r--gdb/python/py-objfile.c8
-rw-r--r--gdb/python/py-param.c14
-rw-r--r--gdb/python/py-prettyprint.c12
-rw-r--r--gdb/python/py-progspace.c12
-rw-r--r--gdb/python/py-record-btrace.c14
-rw-r--r--gdb/python/py-record-full.c2
-rw-r--r--gdb/python/py-record.c8
-rw-r--r--gdb/python/py-record.h4
-rw-r--r--gdb/python/py-signalevent.c2
-rw-r--r--gdb/python/py-stopevent.c2
-rw-r--r--gdb/python/py-symbol.c8
-rw-r--r--gdb/python/py-symtab.c12
-rw-r--r--gdb/python/py-threadevent.c6
-rw-r--r--gdb/python/py-type.c16
-rw-r--r--gdb/python/py-unwind.c8
-rw-r--r--gdb/python/py-utils.c6
-rw-r--r--gdb/python/py-value.c17
-rw-r--r--gdb/python/py-varobj.c6
-rw-r--r--gdb/python/py-xmethods.c11
-rw-r--r--gdb/python/python-internal.h2
-rw-r--r--gdb/python/python.c32
46 files changed, 282 insertions, 120 deletions
diff --git a/gdb/python/py-arch.c b/gdb/python/py-arch.c
index 23cb2c58326..2a7a1b02b95 100644
--- a/gdb/python/py-arch.c
+++ b/gdb/python/py-arch.c
@@ -18,10 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbarch.h"
+
+/* Local non-gdb includes. */
+#include "python-internal.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "disasm.h"
-#include "python-internal.h"
+#include "gdbarch.h"
typedef struct arch_object_type_object {
PyObject_HEAD
diff --git a/gdb/python/py-auto-load.c b/gdb/python/py-auto-load.c
index c7b9afdb112..31e630c959a 100644
--- a/gdb/python/py-auto-load.c
+++ b/gdb/python/py-auto-load.c
@@ -18,12 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "top.h"
-#include "gdbcmd.h"
-#include "objfiles.h"
+
+/* Local non-gdb includes. */
+#include "python-internal.h"
#include "python.h"
+
+/* Local includes. */
#include "auto-load.h"
-#include "python-internal.h"
+#include "gdbcmd.h"
+#include "objfiles.h"
+#include "top.h"
/* User-settable option to enable/disable auto-loading of Python scripts:
set auto-load python-scripts on|off
diff --git a/gdb/python/py-block.c b/gdb/python/py-block.c
index 90140ebc34a..2c46d282085 100644
--- a/gdb/python/py-block.c
+++ b/gdb/python/py-block.c
@@ -18,11 +18,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "python-internal.h"
+
+/* Local includes. */
#include "block.h"
#include "dictionary.h"
-#include "symtab.h"
-#include "python-internal.h"
#include "objfiles.h"
+#include "symtab.h"
typedef struct blpy_block_object {
PyObject_HEAD
diff --git a/gdb/python/py-bpevent.c b/gdb/python/py-bpevent.c
index 64bd50e6cf5..1bfe109d074 100644
--- a/gdb/python/py-bpevent.c
+++ b/gdb/python/py-bpevent.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "py-stopevent.h"
/* Create and initialize a BreakpointEvent object. This acquires new
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index ba3b4f0fc38..128cb826fd3 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -18,21 +18,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "value.h"
+
+/* Local non-gdb includes. */
+#include "py-event.h"
#include "python-internal.h"
#include "python.h"
-#include "charset.h"
-#include "breakpoint.h"
-#include "gdbcmd.h"
-#include "gdbthread.h"
-#include "observable.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-script.h"
+
+/* Local includes. */
#include "ada-lang.h"
#include "arch-utils.h"
+#include "breakpoint.h"
+#include "charset.h"
+#include "gdbcmd.h"
+#include "gdbthread.h"
#include "language.h"
-#include "location.h"
-#include "py-event.h"
#include "linespec.h"
+#include "location.h"
+#include "observable.h"
+#include "value.h"
/* Number of live breakpoints. */
static int bppy_live;
diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c
index 1677c3dcec9..d10165669d1 100644
--- a/gdb/python/py-cmd.c
+++ b/gdb/python/py-cmd.c
@@ -19,14 +19,20 @@
#include "defs.h"
-#include "arch-utils.h"
-#include "value.h"
+
+/* Local non-gdb includes. */
#include "python-internal.h"
-#include "charset.h"
-#include "gdbcmd.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-decode.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "charset.h"
#include "completer.h"
+#include "gdbcmd.h"
#include "language.h"
+#include "value.h"
/* Struct representing built-in completion types. */
struct cmdpy_completer
diff --git a/gdb/python/py-continueevent.c b/gdb/python/py-continueevent.c
index b9de1971d91..8840fd8f0fa 100644
--- a/gdb/python/py-continueevent.c
+++ b/gdb/python/py-continueevent.c
@@ -18,7 +18,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "py-event.h"
+
+/* Local includes. */
#include "gdbthread.h"
/* Create a gdb.ContinueEvent event. gdb.ContinueEvent is-a
diff --git a/gdb/python/py-event.c b/gdb/python/py-event.c
index 6816f5314f7..e01b50d26da 100644
--- a/gdb/python/py-event.c
+++ b/gdb/python/py-event.c
@@ -18,7 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "py-event.h"
+#include "python/py-event.h"
void
evpy_dealloc (PyObject *self)
diff --git a/gdb/python/py-event.h b/gdb/python/py-event.h
index fb8057c2b03..4dd7f9407db 100644
--- a/gdb/python/py-event.h
+++ b/gdb/python/py-event.h
@@ -21,8 +21,10 @@
#define PYTHON_PY_EVENT_H
#include "py-events.h"
-#include "command.h"
#include "python-internal.h"
+
+/* Local includes. */
+#include "command.h"
#include "inferior.h"
/* Declare all event types. */
diff --git a/gdb/python/py-events.h b/gdb/python/py-events.h
index 7d357ad3ca3..739234d5f2c 100644
--- a/gdb/python/py-events.h
+++ b/gdb/python/py-events.h
@@ -20,8 +20,10 @@
#ifndef PYTHON_PY_EVENTS_H
#define PYTHON_PY_EVENTS_H
-#include "command.h"
#include "python-internal.h"
+
+/* Local includes. */
+#include "command.h"
#include "inferior.h"
/* Stores a list of objects to be notified when the event for which this
diff --git a/gdb/python/py-evtregistry.c b/gdb/python/py-evtregistry.c
index cf3505e6542..847d55cfa83 100644
--- a/gdb/python/py-evtregistry.c
+++ b/gdb/python/py-evtregistry.c
@@ -18,9 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "command.h"
+
+/* Local non-gdb includes. */
#include "py-events.h"
+/* Local includes. */
+#include "command.h"
+
events_object gdb_py_events;
extern PyTypeObject eventregistry_object_type
diff --git a/gdb/python/py-evts.c b/gdb/python/py-evts.c
index f388781fcaf..3494b477294 100644
--- a/gdb/python/py-evts.c
+++ b/gdb/python/py-evts.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "py-events.h"
#ifdef IS_PY3K
diff --git a/gdb/python/py-exitedevent.c b/gdb/python/py-exitedevent.c
index 5e9dabf15e7..3ea448aa87f 100644
--- a/gdb/python/py-exitedevent.c
+++ b/gdb/python/py-exitedevent.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "py-event.h"
static gdbpy_ref<>
diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c
index f3affbd0f43..e38dc486058 100644
--- a/gdb/python/py-finishbreakpoint.c
+++ b/gdb/python/py-finishbreakpoint.c
@@ -20,16 +20,20 @@
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "python-internal.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "block.h"
#include "breakpoint.h"
#include "frame.h"
#include "gdbthread.h"
-#include "arch-utils.h"
-#include "language.h"
-#include "observable.h"
#include "inferior.h"
-#include "block.h"
+#include "language.h"
#include "location.h"
+#include "observable.h"
/* Function that is called when a Python finish bp is found out of scope. */
static const char outofscope_func[] = "out_of_scope";
diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
index 0eef6543f84..da857bdd94d 100644
--- a/gdb/python/py-frame.c
+++ b/gdb/python/py-frame.c
@@ -18,16 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "charset.h"
+
+/* Local non-gdb includes. */
+#include "python-internal.h"
+
+/* Local includes. */
#include "block.h"
+#include "charset.h"
#include "frame.h"
-#include "symtab.h"
+#include "objfiles.h"
#include "stack.h"
-#include "value.h"
-#include "python-internal.h"
#include "symfile.h"
-#include "objfiles.h"
+#include "symtab.h"
#include "user-regs.h"
+#include "value.h"
typedef struct {
PyObject_HEAD
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
index 7b241bbed89..aadf8fe2097 100644
--- a/gdb/python/py-framefilter.c
+++ b/gdb/python/py-framefilter.c
@@ -18,19 +18,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "demangle.h"
+#include "hashtab.h"
+#include "python-internal.h"
+#include "python.h"
+
+/* Local subdirectory includes. */
+#include "common/gdb_optional.h"
+#include "mi/mi-cmds.h"
+
+/* Local includes. */
+#include "annotate.h"
+#include "arch-utils.h"
+#include "language.h"
#include "objfiles.h"
#include "symtab.h"
-#include "language.h"
-#include "arch-utils.h"
-#include "python.h"
#include "ui-out.h"
#include "valprint.h"
-#include "annotate.h"
-#include "hashtab.h"
-#include "demangle.h"
-#include "mi/mi-cmds.h"
-#include "python-internal.h"
-#include "common/gdb_optional.h"
enum mi_print_types
{
diff --git a/gdb/python/py-function.c b/gdb/python/py-function.c
index 46a66cf3ece..1f642d043fa 100644
--- a/gdb/python/py-function.c
+++ b/gdb/python/py-function.c
@@ -19,14 +19,20 @@
#include "defs.h"
-#include "value.h"
+
+/* Local non-gdb includes. */
#include "python-internal.h"
-#include "charset.h"
-#include "gdbcmd.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-decode.h"
+
+/* Local includes. */
+#include "charset.h"
#include "completer.h"
#include "expression.h"
+#include "gdbcmd.h"
#include "language.h"
+#include "value.h"
extern PyTypeObject fnpy_object_type
CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("PyObject");
diff --git a/gdb/python/py-gdb-readline.c b/gdb/python/py-gdb-readline.c
index 1e6cd739d6a..e022a3a6306 100644
--- a/gdb/python/py-gdb-readline.c
+++ b/gdb/python/py-gdb-readline.c
@@ -18,10 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "python-internal.h"
-#include "top.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-utils.h"
+/* Local includes. */
+#include "top.h"
+
/* Readline function suitable for PyOS_ReadlineFunctionPointer, which
is used for Python's interactive parser and raw_input. In both
cases, sys_stdin and sys_stdout are always stdin and stdout
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c
index 72fbf6d90b9..4f7365d336f 100644
--- a/gdb/python/py-inferior.c
+++ b/gdb/python/py-inferior.c
@@ -18,17 +18,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "py-event.h"
+#include "py-stopevent.h"
+#include "python-internal.h"
+
+/* Local subdirectory includes. */
+#include "common/gdb_signals.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "gdbcore.h"
#include "gdbthread.h"
#include "inferior.h"
+#include "language.h"
#include "objfiles.h"
#include "observable.h"
-#include "python-internal.h"
-#include "arch-utils.h"
-#include "language.h"
-#include "common/gdb_signals.h"
-#include "py-event.h"
-#include "py-stopevent.h"
struct threadlist_entry {
thread_object *thread_obj;
diff --git a/gdb/python/py-infevents.c b/gdb/python/py-infevents.c
index 60bafc5b41c..171ba1fbf3c 100644
--- a/gdb/python/py-infevents.c
+++ b/gdb/python/py-infevents.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "py-event.h"
/* Construct either a gdb.InferiorCallPreEvent or a
diff --git a/gdb/python/py-infthread.c b/gdb/python/py-infthread.c
index bf90d08ae6e..cef6fb53d88 100644
--- a/gdb/python/py-infthread.c
+++ b/gdb/python/py-infthread.c
@@ -18,9 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "python-internal.h"
+
+/* Local includes. */
#include "gdbthread.h"
#include "inferior.h"
-#include "python-internal.h"
extern PyTypeObject thread_object_type
CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("thread_object");
diff --git a/gdb/python/py-instruction.c b/gdb/python/py-instruction.c
index 071ea08b85a..a54cdf6c1e1 100644
--- a/gdb/python/py-instruction.c
+++ b/gdb/python/py-instruction.c
@@ -18,7 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "py-instruction.h"
+#include "python/py-instruction.h"
/* See py-instruction.h. */
diff --git a/gdb/python/py-lazy-string.c b/gdb/python/py-lazy-string.c
index 443aeb7f45b..10aacc16bb0 100644
--- a/gdb/python/py-lazy-string.c
+++ b/gdb/python/py-lazy-string.c
@@ -18,11 +18,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "python-internal.h"
+
+/* Local includes. */
#include "charset.h"
-#include "value.h"
-#include "valprint.h"
#include "language.h"
+#include "valprint.h"
+#include "value.h"
typedef struct {
PyObject_HEAD
diff --git a/gdb/python/py-linetable.c b/gdb/python/py-linetable.c
index b9d74b8aa3d..41c2043070b 100644
--- a/gdb/python/py-linetable.c
+++ b/gdb/python/py-linetable.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "python-internal.h"
typedef struct {
diff --git a/gdb/python/py-newobjfileevent.c b/gdb/python/py-newobjfileevent.c
index bd12a1686e3..cf330541111 100644
--- a/gdb/python/py-newobjfileevent.c
+++ b/gdb/python/py-newobjfileevent.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "py-event.h"
static gdbpy_ref<>
diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
index 67f63b314e3..07eac33e5ea 100644
--- a/gdb/python/py-objfile.c
+++ b/gdb/python/py-objfile.c
@@ -18,11 +18,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "python-internal.h"
+
+/* Local includes. */
+#include "build-id.h"
#include "charset.h"
-#include "objfiles.h"
#include "language.h"
-#include "build-id.h"
+#include "objfiles.h"
#include "symtab.h"
typedef struct
diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c
index 3b79a5c4fd7..7bca8d306a0 100644
--- a/gdb/python/py-param.c
+++ b/gdb/python/py-param.c
@@ -19,14 +19,20 @@
#include "defs.h"
-#include "value.h"
+
+/* Local non-gdb includes. */
#include "python-internal.h"
-#include "charset.h"
-#include "gdbcmd.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-decode.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "charset.h"
#include "completer.h"
+#include "gdbcmd.h"
#include "language.h"
-#include "arch-utils.h"
+#include "value.h"
/* Parameter constants and their values. */
struct parm_constant
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index e64d1f88af8..0d9d5834752 100644
--- a/gdb/python/py-prettyprint.c
+++ b/gdb/python/py-prettyprint.c
@@ -18,13 +18,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "python-internal.h"
+#include "python.h"
+
+/* Local includes. */
+#include "extension-priv.h"
+#include "language.h"
#include "objfiles.h"
#include "symtab.h"
-#include "language.h"
#include "valprint.h"
-#include "extension-priv.h"
-#include "python.h"
-#include "python-internal.h"
/* Return type of print_string_repr. */
diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c
index b82a91b44d5..ff543da1b6f 100644
--- a/gdb/python/py-progspace.c
+++ b/gdb/python/py-progspace.c
@@ -18,14 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "python-internal.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "block.h"
#include "charset.h"
-#include "progspace.h"
-#include "objfiles.h"
#include "language.h"
-#include "arch-utils.h"
+#include "objfiles.h"
+#include "progspace.h"
#include "solib.h"
-#include "block.h"
typedef struct
{
diff --git a/gdb/python/py-record-btrace.c b/gdb/python/py-record-btrace.c
index 229a3b8756b..4e43efdccbe 100644
--- a/gdb/python/py-record-btrace.c
+++ b/gdb/python/py-record-btrace.c
@@ -18,14 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
+#include "python/py-record-btrace.h"
+
+/* Local non-gdb includes. */
+#include "py-record.h"
+
+/* Local includes. */
+#include "btrace.h"
+#include "disasm.h"
#include "gdbcmd.h"
+#include "gdbcore.h"
#include "gdbthread.h"
-#include "btrace.h"
-#include "py-record.h"
-#include "py-record-btrace.h"
#include "record-btrace.h"
-#include "disasm.h"
#if defined (IS_PY3K)
diff --git a/gdb/python/py-record-full.c b/gdb/python/py-record-full.c
index 40d5177f605..e4ee798b740 100644
--- a/gdb/python/py-record-full.c
+++ b/gdb/python/py-record-full.c
@@ -18,7 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "py-record-full.h"
+#include "python/py-record-full.h"
/* Implementation of
BtraceRecord.method [str]. */
diff --git a/gdb/python/py-record.c b/gdb/python/py-record.c
index e818560174e..d4c1a26dd85 100644
--- a/gdb/python/py-record.c
+++ b/gdb/python/py-record.c
@@ -18,12 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "python/py-record.h"
+
+/* Local non-gdb includes. */
#include "py-instruction.h"
-#include "py-record.h"
#include "py-record-btrace.h"
#include "py-record-full.h"
-#include "target.h"
+
+/* Local includes. */
#include "gdbthread.h"
+#include "target.h"
/* Python Record type. */
diff --git a/gdb/python/py-record.h b/gdb/python/py-record.h
index 74da1bdc4d6..ad7eb984dd1 100644
--- a/gdb/python/py-record.h
+++ b/gdb/python/py-record.h
@@ -20,8 +20,10 @@
#ifndef PYTHON_PY_RECORD_H
#define PYTHON_PY_RECORD_H
-#include "inferior.h"
#include "python-internal.h"
+
+/* Local includes. */
+#include "inferior.h"
#include "record.h"
/* Python Record object. */
diff --git a/gdb/python/py-signalevent.c b/gdb/python/py-signalevent.c
index ffb3a2051b3..361244ec18c 100644
--- a/gdb/python/py-signalevent.c
+++ b/gdb/python/py-signalevent.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "py-stopevent.h"
gdbpy_ref<>
diff --git a/gdb/python/py-stopevent.c b/gdb/python/py-stopevent.c
index b57fd570140..fed8ea5ad7a 100644
--- a/gdb/python/py-stopevent.c
+++ b/gdb/python/py-stopevent.c
@@ -18,7 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "py-stopevent.h"
+#include "python/py-stopevent.h"
gdbpy_ref<>
create_stop_event_object (PyTypeObject *py_type)
diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
index afff9950689..67eb438125c 100644
--- a/gdb/python/py-symbol.c
+++ b/gdb/python/py-symbol.c
@@ -18,11 +18,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "python-internal.h"
+
+/* Local includes. */
#include "block.h"
#include "frame.h"
-#include "symtab.h"
-#include "python-internal.h"
#include "objfiles.h"
+#include "symtab.h"
typedef struct sympy_symbol_object {
PyObject_HEAD
diff --git a/gdb/python/py-symtab.c b/gdb/python/py-symtab.c
index 15af3001505..2a811c8a6e6 100644
--- a/gdb/python/py-symtab.c
+++ b/gdb/python/py-symtab.c
@@ -18,12 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "charset.h"
-#include "symtab.h"
-#include "source.h"
+
+/* Local non-gdb includes. */
#include "python-internal.h"
-#include "objfiles.h"
+
+/* Local includes. */
#include "block.h"
+#include "charset.h"
+#include "objfiles.h"
+#include "source.h"
+#include "symtab.h"
typedef struct stpy_symtab_object {
PyObject_HEAD
diff --git a/gdb/python/py-threadevent.c b/gdb/python/py-threadevent.c
index c2af2fa3c15..c7090445226 100644
--- a/gdb/python/py-threadevent.c
+++ b/gdb/python/py-threadevent.c
@@ -16,9 +16,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "py-event.h"
-#include "infrun.h"
+
+/* Local includes. */
#include "gdbthread.h"
+#include "infrun.h"
/* See py-event.h. */
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index c908ec62de6..a88357615bd 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -18,16 +18,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "value.h"
+
+/* Local non-gdb includes. */
+#include "demangle.h"
#include "python-internal.h"
+
+/* Local subdirectory includes. */
+#include "common/vec.h"
+
+/* Local includes. */
#include "charset.h"
-#include "gdbtypes.h"
#include "cp-support.h"
-#include "demangle.h"
-#include "objfiles.h"
+#include "gdbtypes.h"
#include "language.h"
-#include "common/vec.h"
+#include "objfiles.h"
#include "typeprint.h"
+#include "value.h"
typedef struct pyty_type_object
{
diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c
index f07a8d8fa20..53c5635fa55 100644
--- a/gdb/python/py-unwind.c
+++ b/gdb/python/py-unwind.c
@@ -18,16 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "python-internal.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "frame-unwind.h"
#include "gdb_obstack.h"
#include "gdbcmd.h"
#include "language.h"
#include "observable.h"
-#include "python-internal.h"
#include "regcache.h"
-#include "valprint.h"
#include "user-regs.h"
+#include "valprint.h"
#define TRACE_PY_UNWIND(level, args...) if (pyuw_debug >= level) \
{ fprintf_unfiltered (gdb_stdlog, args); }
diff --git a/gdb/python/py-utils.c b/gdb/python/py-utils.c
index d4700002195..36da23f20b7 100644
--- a/gdb/python/py-utils.c
+++ b/gdb/python/py-utils.c
@@ -18,9 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "python-internal.h"
+
+/* Local includes. */
#include "charset.h"
#include "value.h"
-#include "python-internal.h"
/* 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,
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index dd6a536b6ad..39e40daea2b 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -18,17 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "python-internal.h"
+#include "python.h"
+
+/* Local includes. */
#include "charset.h"
-#include "value.h"
+#include "cp-abi.h"
+#include "expression.h"
+#include "infcall.h"
#include "language.h"
#include "target-float.h"
#include "valprint.h"
-#include "infcall.h"
-#include "expression.h"
-#include "cp-abi.h"
-#include "python.h"
-
-#include "python-internal.h"
+#include "value.h"
/* Even though Python scalar types directly map to host types, we use
target types here to remain consistent with the values system in
diff --git a/gdb/python/py-varobj.c b/gdb/python/py-varobj.c
index 611c4ca76f2..178e71173f5 100644
--- a/gdb/python/py-varobj.c
+++ b/gdb/python/py-varobj.c
@@ -14,9 +14,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "python-internal.h"
-#include "varobj.h"
+
+/* Local includes. */
#include "varobj-iter.h"
+#include "varobj.h"
/* A dynamic varobj iterator "class" for python pretty-printed
varobjs. This inherits struct varobj_iter. */
diff --git a/gdb/python/py-xmethods.c b/gdb/python/py-xmethods.c
index 8606f409750..f1fd5a6b330 100644
--- a/gdb/python/py-xmethods.c
+++ b/gdb/python/py-xmethods.c
@@ -18,14 +18,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "python-internal.h"
+#include "python.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "extension-priv.h"
+#include "language.h"
#include "objfiles.h"
#include "value.h"
-#include "language.h"
-
-#include "python.h"
-#include "python-internal.h"
static const char enabled_field_name[] = "enabled";
static const char match_method_name[] = "match";
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 449926ca874..908baac23d8 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -20,8 +20,8 @@
#ifndef PYTHON_PYTHON_INTERNAL_H
#define PYTHON_PYTHON_INTERNAL_H
-#include "extension.h"
#include "extension-priv.h"
+#include "extension.h"
/* These WITH_* macros are defined by the CPython API checker that
comes with the Python plugin for GCC. See:
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 0d9415ce807..4117ba816f1 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -18,24 +18,32 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "python/python.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
+#include "readline/tilde.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-script.h"
+#include "cli/cli-utils.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "command.h"
-#include "ui-out.h"
-#include "cli/cli-script.h"
-#include "gdbcmd.h"
-#include "progspace.h"
-#include "objfiles.h"
-#include "value.h"
-#include "language.h"
#include "event-loop.h"
-#include "serial.h"
-#include "readline/tilde.h"
-#include "python.h"
#include "extension-priv.h"
-#include "cli/cli-utils.h"
-#include <ctype.h>
+#include "gdbcmd.h"
+#include "language.h"
#include "location.h"
+#include "objfiles.h"
+#include "progspace.h"
#include "ser-event.h"
+#include "serial.h"
+#include "ui-out.h"
+#include "value.h"
/* Declared constants and enum for python stack printing. */
static const char python_excp_none[] = "none";