summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-03-30 11:29:17 -0600
committerTom Tromey <tom@tromey.com>2019-03-30 11:36:53 -0600
commit268f4c4cd7b229f7f23ebbf6006973ebe0a05888 (patch)
treec97516c90aa5bf6ccb54c494c275339d42dc03aa
parentae2b14c73cd42b067e9687219155ed044210f0c1 (diff)
downloadbinutils-gdb-users/tromey/sort-includes.tar.gz
-rw-r--r--gdb/ChangeLog733
-rw-r--r--gdb/aarch32-linux-nat.c10
-rw-r--r--gdb/aarch64-fbsd-nat.c12
-rw-r--r--gdb/aarch64-fbsd-tdep.c9
-rw-r--r--gdb/aarch64-linux-nat.c36
-rw-r--r--gdb/aarch64-linux-tdep.c40
-rw-r--r--gdb/aarch64-newlib-tdep.c3
-rw-r--r--gdb/aarch64-ravenscar-thread.c8
-rw-r--r--gdb/aarch64-tdep.c66
-rw-r--r--gdb/ada-lang.c77
-rw-r--r--gdb/ada-tasks.c12
-rw-r--r--gdb/ada-typeprint.c36
-rw-r--r--gdb/ada-valprint.c20
-rw-r--r--gdb/ada-varobj.c4
-rw-r--r--gdb/addrmap.c6
-rw-r--r--gdb/agent.c6
-rw-r--r--gdb/aix-thread.c25
-rw-r--r--gdb/alpha-bsd-nat.c19
-rw-r--r--gdb/alpha-bsd-tdep.c5
-rw-r--r--gdb/alpha-linux-nat.c15
-rw-r--r--gdb/alpha-linux-tdep.c10
-rw-r--r--gdb/alpha-mdebug-tdep.c15
-rw-r--r--gdb/alpha-nbsd-tdep.c11
-rw-r--r--gdb/alpha-obsd-tdep.c9
-rw-r--r--gdb/alpha-tdep.c40
-rw-r--r--gdb/amd64-bsd-nat.c3
-rw-r--r--gdb/amd64-darwin-tdep.c29
-rw-r--r--gdb/amd64-dicos-tdep.c8
-rw-r--r--gdb/amd64-fbsd-nat.c23
-rw-r--r--gdb/amd64-fbsd-tdep.c15
-rw-r--r--gdb/amd64-linux-nat.c30
-rw-r--r--gdb/amd64-linux-tdep.c31
-rw-r--r--gdb/amd64-nat.c9
-rw-r--r--gdb/amd64-nbsd-nat.c7
-rw-r--r--gdb/amd64-nbsd-tdep.c13
-rw-r--r--gdb/amd64-obsd-nat.c9
-rw-r--r--gdb/amd64-obsd-tdep.c21
-rw-r--r--gdb/amd64-sol2-tdep.c13
-rw-r--r--gdb/amd64-tdep.c38
-rw-r--r--gdb/amd64-windows-nat.c9
-rw-r--r--gdb/amd64-windows-tdep.c32
-rw-r--r--gdb/annotate.c11
-rw-r--r--gdb/annotate.h2
-rw-r--r--gdb/arc-newlib-tdep.c3
-rw-r--r--gdb/arc-tdep.c5
-rw-r--r--gdb/arch-utils.c28
-rw-r--r--gdb/arch/aarch64-insn.c2
-rw-r--r--gdb/arch/aarch64.c7
-rw-r--r--gdb/arch/amd64.c10
-rw-r--r--gdb/arch/amd64.h4
-rw-r--r--gdb/arch/arm-get-next-pcs.c10
-rw-r--r--gdb/arch/arm-linux.c8
-rw-r--r--gdb/arch/arm.c4
-rw-r--r--gdb/arch/i386.c17
-rw-r--r--gdb/arch/i386.h4
-rw-r--r--gdb/arch/ppc-linux-common.c2
-rw-r--r--gdb/arch/riscv.c9
-rw-r--r--gdb/arch/tic6x.c9
-rw-r--r--gdb/arm-bsd-tdep.c5
-rw-r--r--gdb/arm-fbsd-nat.c12
-rw-r--r--gdb/arm-fbsd-tdep.c5
-rw-r--r--gdb/arm-linux-nat.c33
-rw-r--r--gdb/arm-linux-tdep.c60
-rw-r--r--gdb/arm-nbsd-nat.c17
-rw-r--r--gdb/arm-nbsd-tdep.c5
-rw-r--r--gdb/arm-obsd-tdep.c9
-rw-r--r--gdb/arm-pikeos-tdep.c4
-rw-r--r--gdb/arm-symbian-tdep.c8
-rw-r--r--gdb/arm-tdep.c81
-rw-r--r--gdb/arm-wince-tdep.c11
-rw-r--r--gdb/auto-load.c42
-rw-r--r--gdb/auxv.c30
-rw-r--r--gdb/avr-tdep.c22
-rw-r--r--gdb/ax-gdb.c43
-rw-r--r--gdb/ax-gdb.h2
-rw-r--r--gdb/ax-general.c5
-rw-r--r--gdb/bcache.c4
-rw-r--r--gdb/bfd-target.c4
-rw-r--r--gdb/bfin-linux-tdep.c10
-rw-r--r--gdb/bfin-tdep.c32
-rw-r--r--gdb/block.c10
-rw-r--r--gdb/blockframe.c24
-rw-r--r--gdb/break-catch-sig.c19
-rw-r--r--gdb/break-catch-syscall.c16
-rw-r--r--gdb/break-catch-throw.c30
-rw-r--r--gdb/breakpoint.c84
-rw-r--r--gdb/breakpoint.h18
-rw-r--r--gdb/bsd-uthread.c8
-rw-r--r--gdb/btrace.c22
-rw-r--r--gdb/build-id.c16
-rw-r--r--gdb/build-id.h4
-rw-r--r--gdb/buildsym.c33
-rw-r--r--gdb/c-lang.c26
-rw-r--r--gdb/c-typeprint.c28
-rw-r--r--gdb/c-valprint.c17
-rw-r--r--gdb/c-varobj.c6
-rw-r--r--gdb/charset.c18
-rw-r--r--gdb/cli-out.c10
-rw-r--r--gdb/cli-out.h4
-rw-r--r--gdb/cli/cli-cmds.c49
-rw-r--r--gdb/cli/cli-decode.c16
-rw-r--r--gdb/cli/cli-dump.c24
-rw-r--r--gdb/cli/cli-interp.c16
-rw-r--r--gdb/cli/cli-logging.c4
-rw-r--r--gdb/cli/cli-script.c31
-rw-r--r--gdb/cli/cli-setshow.c20
-rw-r--r--gdb/cli/cli-style.c8
-rw-r--r--gdb/cli/cli-utils.c5
-rw-r--r--gdb/coff-pe-read.c20
-rw-r--r--gdb/coffread.c36
-rw-r--r--gdb/common/agent.c13
-rw-r--r--gdb/common/array-view.h4
-rw-r--r--gdb/common/btrace-common.c4
-rw-r--r--gdb/common/buffer.c9
-rw-r--r--gdb/common/cleanups.c4
-rw-r--r--gdb/common/common-debug.c4
-rw-r--r--gdb/common/common-exceptions.c4
-rw-r--r--gdb/common/common-exceptions.h2
-rw-r--r--gdb/common/common-regcache.c4
-rw-r--r--gdb/common/common-utils.c10
-rw-r--r--gdb/common/common-utils.h1
-rw-r--r--gdb/common/def-vector.h2
-rw-r--r--gdb/common/environ.c6
-rw-r--r--gdb/common/environ.h2
-rw-r--r--gdb/common/errors.c4
-rw-r--r--gdb/common/fileio.c8
-rw-r--r--gdb/common/fileio.h4
-rw-r--r--gdb/common/filestuff.c16
-rw-r--r--gdb/common/format.c4
-rw-r--r--gdb/common/forward-scope-exit.h4
-rw-r--r--gdb/common/gdb_tilde_expand.c6
-rw-r--r--gdb/common/gdb_vecs.c6
-rw-r--r--gdb/common/job-control.c6
-rw-r--r--gdb/common/mingw-strerror.c3
-rw-r--r--gdb/common/netstuff.c6
-rw-r--r--gdb/common/pathstuff.c8
-rw-r--r--gdb/common/poison.h2
-rw-r--r--gdb/common/posix-strerror.c2
-rw-r--r--gdb/common/print-utils.c5
-rw-r--r--gdb/common/ptid.c4
-rw-r--r--gdb/common/rsp-low.c4
-rw-r--r--gdb/common/run-time-clock.c6
-rw-r--r--gdb/common/scope-exit.h2
-rw-r--r--gdb/common/scoped_fd.h2
-rw-r--r--gdb/common/scoped_mmap.c11
-rw-r--r--gdb/common/selftest.c12
-rw-r--r--gdb/common/signals-state-save-restore.c5
-rw-r--r--gdb/common/signals.c4
-rw-r--r--gdb/common/tdesc.c2
-rw-r--r--gdb/common/vec.c4
-rw-r--r--gdb/common/xml-utils.c4
-rw-r--r--gdb/compile/compile-c-support.c16
-rw-r--r--gdb/compile/compile-c-symbols.c18
-rw-r--r--gdb/compile/compile-c-types.c8
-rw-r--r--gdb/compile/compile-c.h4
-rw-r--r--gdb/compile/compile-cplus-symbols.c26
-rw-r--r--gdb/compile/compile-cplus-types.c30
-rw-r--r--gdb/compile/compile-cplus.h4
-rw-r--r--gdb/compile/compile-loc2c.c18
-rw-r--r--gdb/compile/compile-object-load.c28
-rw-r--r--gdb/compile/compile-object-load.h4
-rw-r--r--gdb/compile/compile-object-run.c16
-rw-r--r--gdb/compile/compile.c38
-rw-r--r--gdb/complaints.c6
-rw-r--r--gdb/completer.c29
-rw-r--r--gdb/completer.h2
-rw-r--r--gdb/continuations.c4
-rw-r--r--gdb/corefile.c26
-rw-r--r--gdb/corelow.c44
-rw-r--r--gdb/cp-abi.c5
-rw-r--r--gdb/cp-namespace.c22
-rw-r--r--gdb/cp-support.c32
-rw-r--r--gdb/cp-valprint.c28
-rw-r--r--gdb/cris-linux-tdep.c7
-rw-r--r--gdb/cris-tdep.c39
-rw-r--r--gdb/csky-linux-tdep.c10
-rw-r--r--gdb/csky-tdep.c60
-rw-r--r--gdb/ctf.c22
-rw-r--r--gdb/d-lang.c12
-rw-r--r--gdb/d-namespace.c8
-rw-r--r--gdb/d-valprint.c8
-rw-r--r--gdb/darwin-nat-info.c29
-rw-r--r--gdb/darwin-nat.c73
-rw-r--r--gdb/darwin-nat.h4
-rw-r--r--gdb/dcache.c8
-rw-r--r--gdb/dcache.h2
-rw-r--r--gdb/demangle.c12
-rw-r--r--gdb/dicos-tdep.c8
-rw-r--r--gdb/dictionary.c16
-rw-r--r--gdb/disasm-selftests.c2
-rw-r--r--gdb/disasm.c24
-rw-r--r--gdb/disasm.h2
-rw-r--r--gdb/dtrace-probe.c22
-rw-r--r--gdb/dummy-frame.c12
-rw-r--r--gdb/dwarf-index-cache.c19
-rw-r--r--gdb/dwarf-index-cache.h4
-rw-r--r--gdb/dwarf-index-write.c25
-rw-r--r--gdb/dwarf-index-write.h2
-rw-r--r--gdb/dwarf2-frame-tailcall.c12
-rw-r--r--gdb/dwarf2-frame.c24
-rw-r--r--gdb/dwarf2expr.c18
-rw-r--r--gdb/dwarf2expr.h2
-rw-r--r--gdb/dwarf2loc.c48
-rw-r--r--gdb/dwarf2read.c108
-rw-r--r--gdb/dwarf2read.h2
-rw-r--r--gdb/elfread.c36
-rw-r--r--gdb/eval.c32
-rw-r--r--gdb/event-loop.c6
-rw-r--r--gdb/event-top.c34
-rw-r--r--gdb/exceptions.c14
-rw-r--r--gdb/exec.c50
-rw-r--r--gdb/exec.h4
-rw-r--r--gdb/expprint.c19
-rw-r--r--gdb/extension-priv.h6
-rw-r--r--gdb/extension.c16
-rw-r--r--gdb/extension.h4
-rw-r--r--gdb/f-lang.c27
-rw-r--r--gdb/f-typeprint.c14
-rw-r--r--gdb/f-valprint.c18
-rw-r--r--gdb/fbsd-nat.c42
-rw-r--r--gdb/fbsd-nat.h4
-rw-r--r--gdb/fbsd-tdep.c19
-rw-r--r--gdb/features/aarch64-sve.c3
-rw-r--r--gdb/filename-seen-cache.c2
-rw-r--r--gdb/filename-seen-cache.h4
-rw-r--r--gdb/filesystem.c2
-rw-r--r--gdb/findcmd.c18
-rw-r--r--gdb/findvar.c24
-rw-r--r--gdb/fork-child.c16
-rw-r--r--gdb/frame-base.c2
-rw-r--r--gdb/frame-unwind.c8
-rw-r--r--gdb/frame.c36
-rw-r--r--gdb/frv-linux-tdep.c20
-rw-r--r--gdb/frv-tdep.c34
-rw-r--r--gdb/ft32-tdep.c36
-rw-r--r--gdb/gcore.c38
-rw-r--r--gdb/gdb.c4
-rw-r--r--gdb/gdb_bfd.c11
-rw-r--r--gdb/gdb_bfd.h4
-rw-r--r--gdb/gdb_regex.c2
-rw-r--r--gdb/gdb_usleep.c6
-rw-r--r--gdb/gdbcmd.h4
-rw-r--r--gdb/gdbserver/ChangeLog67
-rw-r--r--gdb/gdbserver/ax.c6
-rw-r--r--gdb/gdbserver/debug.c3
-rw-r--r--gdb/gdbserver/dll.c1
-rw-r--r--gdb/gdbserver/event-loop.c4
-rw-r--r--gdb/gdbserver/fork-child.c8
-rw-r--r--gdb/gdbserver/gdbthread.h7
-rw-r--r--gdb/gdbserver/hostio-errno.c2
-rw-r--r--gdb/gdbserver/hostio.c11
-rw-r--r--gdb/gdbserver/i387-fp.c2
-rw-r--r--gdb/gdbserver/inferiors.c7
-rw-r--r--gdb/gdbserver/inferiors.h4
-rw-r--r--gdb/gdbserver/linux-aarch32-low.c12
-rw-r--r--gdb/gdbserver/linux-aarch64-ipa.c10
-rw-r--r--gdb/gdbserver/linux-aarch64-low.c41
-rw-r--r--gdb/gdbserver/linux-aarch64-tdesc-selftest.c6
-rw-r--r--gdb/gdbserver/linux-aarch64-tdesc.c11
-rw-r--r--gdb/gdbserver/linux-amd64-ipa.c10
-rw-r--r--gdb/gdbserver/linux-arm-low.c14
-rw-r--r--gdb/gdbserver/linux-bfin-low.c6
-rw-r--r--gdb/gdbserver/linux-cris-low.c4
-rw-r--r--gdb/gdbserver/linux-crisv32-low.c4
-rw-r--r--gdb/gdbserver/linux-i386-ipa.c10
-rw-r--r--gdb/gdbserver/linux-ia64-low.c5
-rw-r--r--gdb/gdbserver/linux-low.c57
-rw-r--r--gdb/gdbserver/linux-low.h9
-rw-r--r--gdb/gdbserver/linux-m32r-low.c5
-rw-r--r--gdb/gdbserver/linux-m68k-low.c2
-rw-r--r--gdb/gdbserver/linux-mips-low.c10
-rw-r--r--gdb/gdbserver/linux-nios2-low.c14
-rw-r--r--gdb/gdbserver/linux-ppc-ipa.c16
-rw-r--r--gdb/gdbserver/linux-ppc-low.c18
-rw-r--r--gdb/gdbserver/linux-s390-ipa.c12
-rw-r--r--gdb/gdbserver/linux-s390-low.c18
-rw-r--r--gdb/gdbserver/linux-sh-low.c2
-rw-r--r--gdb/gdbserver/linux-sparc-low.c4
-rw-r--r--gdb/gdbserver/linux-tic6x-low.c10
-rw-r--r--gdb/gdbserver/linux-tile-low.c7
-rw-r--r--gdb/gdbserver/linux-x86-low.c12
-rw-r--r--gdb/gdbserver/linux-x86-tdesc-selftest.c4
-rw-r--r--gdb/gdbserver/linux-x86-tdesc.c7
-rw-r--r--gdb/gdbserver/linux-xtensa-low.c2
-rw-r--r--gdb/gdbserver/lynx-i386-low.c12
-rw-r--r--gdb/gdbserver/lynx-low.c19
-rw-r--r--gdb/gdbserver/lynx-ppc-low.c6
-rw-r--r--gdb/gdbserver/mem-break.c5
-rw-r--r--gdb/gdbserver/notif.h4
-rw-r--r--gdb/gdbserver/nto-low.c13
-rw-r--r--gdb/gdbserver/nto-x86-low.c15
-rw-r--r--gdb/gdbserver/regcache.c10
-rw-r--r--gdb/gdbserver/remote-utils.c65
-rw-r--r--gdb/gdbserver/server.c44
-rw-r--r--gdb/gdbserver/spu-low.c13
-rw-r--r--gdb/gdbserver/symbol.c2
-rw-r--r--gdb/gdbserver/target.c3
-rw-r--r--gdb/gdbserver/target.h16
-rw-r--r--gdb/gdbserver/tdesc.c2
-rw-r--r--gdb/gdbserver/tdesc.h7
-rw-r--r--gdb/gdbserver/thread-db.c1
-rw-r--r--gdb/gdbserver/tracepoint.c17
-rw-r--r--gdb/gdbserver/utils.c1
-rw-r--r--gdb/gdbserver/win32-arm-low.c2
-rw-r--r--gdb/gdbserver/win32-i386-low.c5
-rw-r--r--gdb/gdbserver/win32-low.c30
-rw-r--r--gdb/gdbserver/wincecompat.c2
-rw-r--r--gdb/gdbtypes.c28
-rw-r--r--gdb/glibc-tdep.c9
-rw-r--r--gdb/gnu-nat.c1
-rw-r--r--gdb/gnu-v2-abi.c16
-rw-r--r--gdb/gnu-v3-abi.c16
-rw-r--r--gdb/go-lang.c17
-rw-r--r--gdb/go-typeprint.c4
-rw-r--r--gdb/go-valprint.c6
-rw-r--r--gdb/go32-nat.c50
-rw-r--r--gdb/guile/guile.c19
-rw-r--r--gdb/guile/scm-arch.c8
-rw-r--r--gdb/guile/scm-auto-load.c16
-rw-r--r--gdb/guile/scm-block.c6
-rw-r--r--gdb/guile/scm-breakpoint.c18
-rw-r--r--gdb/guile/scm-cmd.c14
-rw-r--r--gdb/guile/scm-disasm.c10
-rw-r--r--gdb/guile/scm-exception.c4
-rw-r--r--gdb/guile/scm-frame.c8
-rw-r--r--gdb/guile/scm-gsmob.c6
-rw-r--r--gdb/guile/scm-iterator.c2
-rw-r--r--gdb/guile/scm-lazy-string.c10
-rw-r--r--gdb/guile/scm-math.c10
-rw-r--r--gdb/guile/scm-objfile.c8
-rw-r--r--gdb/guile/scm-param.c16
-rw-r--r--gdb/guile/scm-ports.c12
-rw-r--r--gdb/guile/scm-pretty-print.c10
-rw-r--r--gdb/guile/scm-progspace.c12
-rw-r--r--gdb/guile/scm-safe-call.c4
-rw-r--r--gdb/guile/scm-string.c6
-rw-r--r--gdb/guile/scm-symbol.c8
-rw-r--r--gdb/guile/scm-symtab.c12
-rw-r--r--gdb/guile/scm-type.c18
-rw-r--r--gdb/guile/scm-utils.c2
-rw-r--r--gdb/guile/scm-value.c10
-rw-r--r--gdb/h8300-tdep.c14
-rw-r--r--gdb/hppa-bsd-tdep.c12
-rw-r--r--gdb/hppa-linux-nat.c21
-rw-r--r--gdb/hppa-linux-tdep.c24
-rw-r--r--gdb/hppa-nbsd-nat.c11
-rw-r--r--gdb/hppa-nbsd-tdep.c8
-rw-r--r--gdb/hppa-obsd-nat.c13
-rw-r--r--gdb/hppa-obsd-tdep.c7
-rw-r--r--gdb/hppa-tdep.c12
-rw-r--r--gdb/i386-bsd-nat.c17
-rw-r--r--gdb/i386-bsd-tdep.c7
-rw-r--r--gdb/i386-cygwin-tdep.c12
-rw-r--r--gdb/i386-darwin-nat.c25
-rw-r--r--gdb/i386-darwin-tdep.c27
-rw-r--r--gdb/i386-dicos-tdep.c4
-rw-r--r--gdb/i386-fbsd-nat.c18
-rw-r--r--gdb/i386-fbsd-tdep.c15
-rw-r--r--gdb/i386-gnu-nat.c3
-rw-r--r--gdb/i386-gnu-tdep.c5
-rw-r--r--gdb/i386-go32-tdep.c8
-rw-r--r--gdb/i386-linux-nat.c32
-rw-r--r--gdb/i386-linux-tdep.c31
-rw-r--r--gdb/i386-nbsd-nat.c7
-rw-r--r--gdb/i386-nbsd-tdep.c13
-rw-r--r--gdb/i386-nto-tdep.c11
-rw-r--r--gdb/i386-obsd-nat.c14
-rw-r--r--gdb/i386-obsd-tdep.c19
-rw-r--r--gdb/i386-sol2-nat.c9
-rw-r--r--gdb/i386-sol2-tdep.c7
-rw-r--r--gdb/i386-tdep.c59
-rw-r--r--gdb/i386-windows-nat.c9
-rw-r--r--gdb/i387-tdep.c11
-rw-r--r--gdb/ia64-libunwind-tdep.c22
-rw-r--r--gdb/ia64-linux-nat.c24
-rw-r--r--gdb/ia64-linux-tdep.c15
-rw-r--r--gdb/ia64-tdep.c32
-rw-r--r--gdb/ia64-vms-tdep.c6
-rw-r--r--gdb/inf-child.c27
-rw-r--r--gdb/inf-child.h2
-rw-r--r--gdb/inf-loop.c16
-rw-r--r--gdb/inf-loop.h2
-rw-r--r--gdb/inf-ptrace.c25
-rw-r--r--gdb/infcall.c38
-rw-r--r--gdb/infcall.h4
-rw-r--r--gdb/infcmd.c64
-rw-r--r--gdb/inferior.c26
-rw-r--r--gdb/inflow.c36
-rw-r--r--gdb/infrun.c80
-rw-r--r--gdb/infrun.h4
-rw-r--r--gdb/inline-frame.c16
-rw-r--r--gdb/interps.c12
-rw-r--r--gdb/iq2000-tdep.c18
-rw-r--r--gdb/jit.c21
-rw-r--r--gdb/language.c32
-rw-r--r--gdb/language.h4
-rw-r--r--gdb/linespec.c56
-rw-r--r--gdb/linux-fork.c32
-rw-r--r--gdb/linux-nat-trad.c3
-rw-r--r--gdb/linux-nat.c88
-rw-r--r--gdb/linux-nat.h6
-rw-r--r--gdb/linux-record.c10
-rw-r--r--gdb/linux-tdep.c41
-rw-r--r--gdb/linux-thread-db.c48
-rw-r--r--gdb/lm32-tdep.c30
-rw-r--r--gdb/location.c19
-rw-r--r--gdb/m2-lang.c14
-rw-r--r--gdb/m2-typeprint.c22
-rw-r--r--gdb/m2-valprint.c14
-rw-r--r--gdb/m32c-tdep.c22
-rw-r--r--gdb/m32r-linux-nat.c18
-rw-r--r--gdb/m32r-linux-tdep.c19
-rw-r--r--gdb/m32r-tdep.c28
-rw-r--r--gdb/m68hc11-tdep.c31
-rw-r--r--gdb/m68k-bsd-nat.c14
-rw-r--r--gdb/m68k-bsd-tdep.c9
-rw-r--r--gdb/m68k-linux-nat.c35
-rw-r--r--gdb/m68k-linux-tdep.c29
-rw-r--r--gdb/m68k-tdep.c22
-rw-r--r--gdb/machoread.c28
-rw-r--r--gdb/macrocmd.c10
-rw-r--r--gdb/macroexp.c6
-rw-r--r--gdb/macroscope.c11
-rw-r--r--gdb/macrotab.c16
-rw-r--r--gdb/main.c51
-rw-r--r--gdb/maint.c35
-rw-r--r--gdb/maint.h4
-rw-r--r--gdb/mdebugread.c44
-rw-r--r--gdb/mdebugread.h2
-rw-r--r--gdb/mem-break.c5
-rw-r--r--gdb/memattr.c20
-rw-r--r--gdb/memrange.c2
-rw-r--r--gdb/mep-tdep.c36
-rw-r--r--gdb/mi/mi-cmd-break.c24
-rw-r--r--gdb/mi/mi-cmd-catch.c12
-rw-r--r--gdb/mi/mi-cmd-disas.c12
-rw-r--r--gdb/mi/mi-cmd-env.c24
-rw-r--r--gdb/mi/mi-cmd-file.c12
-rw-r--r--gdb/mi/mi-cmd-info.c6
-rw-r--r--gdb/mi/mi-cmd-stack.c34
-rw-r--r--gdb/mi/mi-cmd-target.c4
-rw-r--r--gdb/mi/mi-cmd-var.c22
-rw-r--r--gdb/mi/mi-cmds.c8
-rw-r--r--gdb/mi/mi-common.c2
-rw-r--r--gdb/mi/mi-console.c2
-rw-r--r--gdb/mi/mi-getopt.c3
-rw-r--r--gdb/mi/mi-interp.c35
-rw-r--r--gdb/mi/mi-main.c75
-rw-r--r--gdb/mi/mi-out.c4
-rw-r--r--gdb/mi/mi-parse.c13
-rw-r--r--gdb/mi/mi-parse.h8
-rw-r--r--gdb/mi/mi-symbol-cmds.c6
-rw-r--r--gdb/microblaze-linux-tdep.c22
-rw-r--r--gdb/microblaze-tdep.c38
-rw-r--r--gdb/mingw-hdep.c14
-rw-r--r--gdb/minidebug.c10
-rw-r--r--gdb/minsyms.c31
-rw-r--r--gdb/mips-fbsd-nat.c16
-rw-r--r--gdb/mips-fbsd-tdep.c12
-rw-r--r--gdb/mips-linux-nat.c29
-rw-r--r--gdb/mips-linux-tdep.c39
-rw-r--r--gdb/mips-nbsd-nat.c16
-rw-r--r--gdb/mips-nbsd-tdep.c14
-rw-r--r--gdb/mips-sde-tdep.c16
-rw-r--r--gdb/mips-tdep.c58
-rw-r--r--gdb/mips64-obsd-nat.c14
-rw-r--r--gdb/mips64-obsd-tdep.c9
-rw-r--r--gdb/mipsread.c20
-rw-r--r--gdb/mn10300-linux-tdep.c14
-rw-r--r--gdb/mn10300-tdep.c27
-rw-r--r--gdb/moxie-tdep.c33
-rw-r--r--gdb/msp430-tdep.c29
-rw-r--r--gdb/namespace.h4
-rw-r--r--gdb/nat/aarch64-linux-hw-point.c15
-rw-r--r--gdb/nat/aarch64-linux-hw-point.h2
-rw-r--r--gdb/nat/aarch64-linux.c15
-rw-r--r--gdb/nat/aarch64-sve-linux-ptrace.c16
-rw-r--r--gdb/nat/aarch64-sve-linux-ptrace.h4
-rw-r--r--gdb/nat/amd64-linux-siginfo.c6
-rw-r--r--gdb/nat/amd64-linux-siginfo.h2
-rw-r--r--gdb/nat/fork-inferior.c18
-rw-r--r--gdb/nat/linux-btrace.c18
-rw-r--r--gdb/nat/linux-namespaces.c14
-rw-r--r--gdb/nat/linux-osdata.c28
-rw-r--r--gdb/nat/linux-procfs.c8
-rw-r--r--gdb/nat/linux-ptrace.c14
-rw-r--r--gdb/nat/linux-waitpid.c1
-rw-r--r--gdb/nat/mips-linux-watch.c4
-rw-r--r--gdb/nat/mips-linux-watch.h2
-rw-r--r--gdb/nat/ppc-linux.c9
-rw-r--r--gdb/nat/ppc-linux.h2
-rw-r--r--gdb/nat/x86-dregs.c4
-rw-r--r--gdb/nat/x86-linux-dregs.c12
-rw-r--r--gdb/nat/x86-linux.c4
-rw-r--r--gdb/nbsd-nat.c1
-rw-r--r--gdb/nbsd-tdep.c4
-rw-r--r--gdb/nds32-tdep.c42
-rw-r--r--gdb/nios2-linux-tdep.c14
-rw-r--r--gdb/nios2-tdep.c33
-rw-r--r--gdb/nto-procfs.c26
-rw-r--r--gdb/nto-tdep.c22
-rw-r--r--gdb/nto-tdep.h4
-rw-r--r--gdb/objc-lang.c45
-rw-r--r--gdb/objfiles.c49
-rw-r--r--gdb/objfiles.h22
-rw-r--r--gdb/obsd-nat.c14
-rw-r--r--gdb/obsd-tdep.c7
-rw-r--r--gdb/observable.c2
-rw-r--r--gdb/opencl-lang.c10
-rw-r--r--gdb/or1k-linux-tdep.c10
-rw-r--r--gdb/or1k-tdep.c39
-rw-r--r--gdb/osabi.c10
-rw-r--r--gdb/osdata.c12
-rw-r--r--gdb/p-lang.c18
-rw-r--r--gdb/p-typeprint.c22
-rw-r--r--gdb/p-valprint.c35
-rw-r--r--gdb/parse.c34
-rw-r--r--gdb/parser-defs.h2
-rw-r--r--gdb/posix-hdep.c3
-rw-r--r--gdb/ppc-fbsd-nat.c22
-rw-r--r--gdb/ppc-fbsd-tdep.c15
-rw-r--r--gdb/ppc-linux-nat.c32
-rw-r--r--gdb/ppc-linux-tdep.c114
-rw-r--r--gdb/ppc-linux-tdep.h2
-rw-r--r--gdb/ppc-nbsd-nat.c17
-rw-r--r--gdb/ppc-nbsd-tdep.c9
-rw-r--r--gdb/ppc-obsd-nat.c20
-rw-r--r--gdb/ppc-obsd-tdep.c11
-rw-r--r--gdb/ppc-ravenscar-thread.c8
-rw-r--r--gdb/ppc-sysv-tdep.c20
-rw-r--r--gdb/ppc64-tdep.c8
-rw-r--r--gdb/printcmd.c56
-rw-r--r--gdb/probe.c36
-rw-r--r--gdb/proc-api.c4
-rw-r--r--gdb/proc-service.c15
-rw-r--r--gdb/process-stratum-target.c2
-rw-r--r--gdb/procfs.c23
-rw-r--r--gdb/producer.c2
-rw-r--r--gdb/progspace-and-thread.c2
-rw-r--r--gdb/progspace-and-thread.h2
-rw-r--r--gdb/progspace.c9
-rw-r--r--gdb/progspace.h10
-rw-r--r--gdb/prologue-value.c2
-rw-r--r--gdb/psympriv.h2
-rw-r--r--gdb/psymtab.c33
-rw-r--r--gdb/psymtab.h6
-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
-rw-r--r--gdb/ravenscar-thread.c16
-rw-r--r--gdb/record-btrace.c38
-rw-r--r--gdb/record-full.c41
-rw-r--r--gdb/record.c19
-rw-r--r--gdb/record.h2
-rw-r--r--gdb/regcache-dump.c10
-rw-r--r--gdb/regcache.c18
-rw-r--r--gdb/regcache.h4
-rw-r--r--gdb/reggroups.c10
-rw-r--r--gdb/remote-fileio.c24
-rw-r--r--gdb/remote-notif.c10
-rw-r--r--gdb/remote-notif.h2
-rw-r--r--gdb/remote-sim.c34
-rw-r--r--gdb/remote.c89
-rw-r--r--gdb/reverse.c8
-rw-r--r--gdb/riscv-fbsd-nat.c12
-rw-r--r--gdb/riscv-fbsd-tdep.c4
-rw-r--r--gdb/riscv-linux-nat.c16
-rw-r--r--gdb/riscv-linux-tdep.c10
-rw-r--r--gdb/riscv-tdep.c62
-rw-r--r--gdb/rl78-tdep.c29
-rw-r--r--gdb/rs6000-aix-tdep.c30
-rw-r--r--gdb/rs6000-lynx178-tdep.c6
-rw-r--r--gdb/rs6000-nat.c52
-rw-r--r--gdb/rs6000-tdep.c94
-rw-r--r--gdb/rust-lang.c16
-rw-r--r--gdb/rx-tdep.c31
-rw-r--r--gdb/s12z-tdep.c13
-rw-r--r--gdb/s390-linux-nat.c38
-rw-r--r--gdb/s390-linux-tdep.c42
-rw-r--r--gdb/s390-tdep.c16
-rw-r--r--gdb/score-tdep.c22
-rw-r--r--gdb/selftest-arch.c1
-rw-r--r--gdb/sentinel-frame.c6
-rw-r--r--gdb/ser-base.c10
-rw-r--r--gdb/ser-base.h2
-rw-r--r--gdb/ser-event.c6
-rw-r--r--gdb/ser-go32.c3
-rw-r--r--gdb/ser-mingw.c13
-rw-r--r--gdb/ser-pipe.c21
-rw-r--r--gdb/ser-tcp.c21
-rw-r--r--gdb/ser-uds.c7
-rw-r--r--gdb/ser-unix.c16
-rw-r--r--gdb/serial.c10
-rw-r--r--gdb/sh-linux-tdep.c11
-rw-r--r--gdb/sh-nbsd-nat.c10
-rw-r--r--gdb/sh-nbsd-tdep.c7
-rw-r--r--gdb/sh-tdep.c30
-rw-r--r--gdb/skip.c36
-rw-r--r--gdb/sol-thread.c26
-rw-r--r--gdb/sol2-tdep.c7
-rw-r--r--gdb/solib-aix.c14
-rw-r--r--gdb/solib-darwin.c34
-rw-r--r--gdb/solib-dsbt.c18
-rw-r--r--gdb/solib-frv.c20
-rw-r--r--gdb/solib-spu.c25
-rw-r--r--gdb/solib-svr4.c36
-rw-r--r--gdb/solib-target.c14
-rw-r--r--gdb/solib.c43
-rw-r--r--gdb/source-cache.c6
-rw-r--r--gdb/source.c53
-rw-r--r--gdb/sparc-linux-nat.c12
-rw-r--r--gdb/sparc-linux-tdep.c10
-rw-r--r--gdb/sparc-nat.c20
-rw-r--r--gdb/sparc-nbsd-nat.c7
-rw-r--r--gdb/sparc-nbsd-tdep.c9
-rw-r--r--gdb/sparc-obsd-tdep.c13
-rw-r--r--gdb/sparc-ravenscar-thread.c8
-rw-r--r--gdb/sparc-sol2-nat.c8
-rw-r--r--gdb/sparc-sol2-tdep.c13
-rw-r--r--gdb/sparc-tdep.c21
-rw-r--r--gdb/sparc64-fbsd-nat.c8
-rw-r--r--gdb/sparc64-fbsd-tdep.c11
-rw-r--r--gdb/sparc64-linux-nat.c14
-rw-r--r--gdb/sparc64-linux-tdep.c12
-rw-r--r--gdb/sparc64-nat.c5
-rw-r--r--gdb/sparc64-nbsd-nat.c7
-rw-r--r--gdb/sparc64-nbsd-tdep.c13
-rw-r--r--gdb/sparc64-obsd-nat.c9
-rw-r--r--gdb/sparc64-obsd-tdep.c15
-rw-r--r--gdb/sparc64-sol2-tdep.c11
-rw-r--r--gdb/sparc64-tdep.c9
-rw-r--r--gdb/spu-linux-nat.c26
-rw-r--r--gdb/spu-multiarch.c17
-rw-r--r--gdb/spu-tdep.c42
-rw-r--r--gdb/stabsread.c35
-rw-r--r--gdb/stack.c55
-rw-r--r--gdb/stap-probe.c35
-rw-r--r--gdb/std-regs.c5
-rw-r--r--gdb/stubs/ChangeLog7
-rw-r--r--gdb/stubs/i386-stub.c3
-rw-r--r--gdb/stubs/m68k-stub.c5
-rw-r--r--gdb/stubs/sh-stub.c5
-rw-r--r--gdb/stubs/sparc-stub.c5
-rw-r--r--gdb/symfile-debug.c4
-rw-r--r--gdb/symfile-mem.c18
-rw-r--r--gdb/symfile.c88
-rw-r--r--gdb/symmisc.c31
-rw-r--r--gdb/symtab.c87
-rw-r--r--gdb/symtab.h12
-rw-r--r--gdb/target-dcache.c2
-rw-r--r--gdb/target-descriptions.c27
-rw-r--r--gdb/target-float.c8
-rw-r--r--gdb/target-memory.c13
-rw-r--r--gdb/target.c50
-rw-r--r--gdb/target/waitstatus.c2
-rw-r--r--gdb/thread-fsm.h2
-rw-r--r--gdb/thread-iter.c2
-rw-r--r--gdb/thread.c45
-rw-r--r--gdb/tic6x-linux-tdep.c12
-rw-r--r--gdb/tic6x-tdep.c46
-rw-r--r--gdb/tid-parse.c8
-rw-r--r--gdb/tilegx-linux-nat.c16
-rw-r--r--gdb/tilegx-linux-tdep.c14
-rw-r--r--gdb/tilegx-tdep.c38
-rw-r--r--gdb/top.c58
-rw-r--r--gdb/top.h2
-rw-r--r--gdb/tracefile-tfile.c28
-rw-r--r--gdb/tracefile.c6
-rw-r--r--gdb/tracefile.h4
-rw-r--r--gdb/tracepoint.c68
-rw-r--r--gdb/tracepoint.h11
-rw-r--r--gdb/trad-frame.c6
-rw-r--r--gdb/trad-frame.h2
-rw-r--r--gdb/tramp-frame.c6
-rw-r--r--gdb/tramp-frame.h2
-rw-r--r--gdb/tui/tui-command.c10
-rw-r--r--gdb/tui/tui-data.c8
-rw-r--r--gdb/tui/tui-data.h6
-rw-r--r--gdb/tui/tui-disasm.c31
-rw-r--r--gdb/tui/tui-disasm.h4
-rw-r--r--gdb/tui/tui-file.c8
-rw-r--r--gdb/tui/tui-hooks.c48
-rw-r--r--gdb/tui/tui-interp.c26
-rw-r--r--gdb/tui/tui-io.c31
-rw-r--r--gdb/tui/tui-layout.c27
-rw-r--r--gdb/tui/tui-layout.h2
-rw-r--r--gdb/tui/tui-out.c8
-rw-r--r--gdb/tui/tui-regs.c33
-rw-r--r--gdb/tui/tui-regs.h2
-rw-r--r--gdb/tui/tui-source.c23
-rw-r--r--gdb/tui/tui-stack.c29
-rw-r--r--gdb/tui/tui-win.c43
-rw-r--r--gdb/tui/tui-windata.c10
-rw-r--r--gdb/tui/tui-wingeneral.c7
-rw-r--r--gdb/tui/tui-winsource.c27
-rw-r--r--gdb/tui/tui.c26
-rw-r--r--gdb/typeprint.c36
-rw-r--r--gdb/ui-file.c6
-rw-r--r--gdb/ui-file.h2
-rw-r--r--gdb/ui-out.c9
-rw-r--r--gdb/ui-out.h1
-rw-r--r--gdb/unittests/array-view-selftests.c8
-rw-r--r--gdb/unittests/child-path-selftests.c2
-rw-r--r--gdb/unittests/cli-utils-selftests.c2
-rw-r--r--gdb/unittests/common-utils-selftests.c3
-rw-r--r--gdb/unittests/copy_bitwise-selftests.c4
-rw-r--r--gdb/unittests/environ-selftests.c8
-rw-r--r--gdb/unittests/format_pieces-selftests.c2
-rw-r--r--gdb/unittests/function-view-selftests.c4
-rw-r--r--gdb/unittests/lookup_name_info-selftests.c4
-rw-r--r--gdb/unittests/memory-map-selftests.c4
-rw-r--r--gdb/unittests/memrange-selftests.c4
-rw-r--r--gdb/unittests/mkdir-recursive-selftests.c5
-rw-r--r--gdb/unittests/observable-selftests.c4
-rw-r--r--gdb/unittests/offset-type-selftests.c4
-rw-r--r--gdb/unittests/optional-selftests.c4
-rw-r--r--gdb/unittests/parse-connection-spec-selftests.c9
-rw-r--r--gdb/unittests/ptid-selftests.c6
-rw-r--r--gdb/unittests/rsp-low-selftests.c4
-rw-r--r--gdb/unittests/scoped_fd-selftests.c5
-rw-r--r--gdb/unittests/scoped_mmap-selftests.c5
-rw-r--r--gdb/unittests/scoped_restore-selftests.c4
-rw-r--r--gdb/unittests/style-selftests.c4
-rw-r--r--gdb/unittests/tracepoint-selftests.c4
-rw-r--r--gdb/unittests/unpack-selftests.c8
-rw-r--r--gdb/unittests/utils-selftests.c6
-rw-r--r--gdb/unittests/xml-utils-selftests.c4
-rw-r--r--gdb/user-regs.c10
-rw-r--r--gdb/utils.c19
-rw-r--r--gdb/utils.h8
-rw-r--r--gdb/v850-tdep.c22
-rw-r--r--gdb/valarith.c16
-rw-r--r--gdb/valops.c38
-rw-r--r--gdb/valprint.c36
-rw-r--r--gdb/value.c44
-rw-r--r--gdb/value.h6
-rw-r--r--gdb/varobj.c21
-rw-r--r--gdb/varobj.h6
-rw-r--r--gdb/vax-bsd-nat.c14
-rw-r--r--gdb/vax-nbsd-tdep.c5
-rw-r--r--gdb/vax-tdep.c11
-rw-r--r--gdb/windows-nat.c28
-rw-r--r--gdb/windows-tdep.c24
-rw-r--r--gdb/x86-bsd-nat.c5
-rw-r--r--gdb/x86-linux-nat.c19
-rw-r--r--gdb/x86-linux-nat.h6
-rw-r--r--gdb/x86-nat.c2
-rw-r--r--gdb/x86-nat.h4
-rw-r--r--gdb/xcoffread.c18
-rw-r--r--gdb/xml-support.c16
-rw-r--r--gdb/xml-support.h6
-rw-r--r--gdb/xml-syscall.c6
-rw-r--r--gdb/xml-tdesc.c18
-rw-r--r--gdb/xml-tdesc.h4
-rw-r--r--gdb/xstormy16-tdep.c26
-rw-r--r--gdb/xtensa-linux-nat.c27
-rw-r--r--gdb/xtensa-linux-tdep.c6
-rw-r--r--gdb/xtensa-tdep.c50
801 files changed, 8641 insertions, 4961 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a3dfd316987..eba307db064 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,736 @@
+2019-03-30 Tom Tromey <tom@tromey.com>
+
+ * xtensa-tdep.c: Sort headers.
+ * xtensa-linux-tdep.c: Sort headers.
+ * xtensa-linux-nat.c: Sort headers.
+ * xstormy16-tdep.c: Sort headers.
+ * xml-tdesc.h: Sort headers.
+ * xml-tdesc.c: Sort headers.
+ * xml-syscall.c: Sort headers.
+ * xml-support.h: Sort headers.
+ * xml-support.c: Sort headers.
+ * xcoffread.c: Sort headers.
+ * x86-nat.h: Sort headers.
+ * x86-nat.c: Sort headers.
+ * x86-linux-nat.h: Sort headers.
+ * x86-linux-nat.c: Sort headers.
+ * x86-bsd-nat.c: Sort headers.
+ * windows-tdep.c: Sort headers.
+ * windows-nat.c: Sort headers.
+ * vax-tdep.c: Sort headers.
+ * vax-nbsd-tdep.c: Sort headers.
+ * vax-bsd-nat.c: Sort headers.
+ * varobj.h: Sort headers.
+ * varobj.c: Sort headers.
+ * value.h: Sort headers.
+ * value.c: Sort headers.
+ * valprint.c: Sort headers.
+ * valops.c: Sort headers.
+ * valarith.c: Sort headers.
+ * v850-tdep.c: Sort headers.
+ * utils.h: Sort headers.
+ * utils.c: Sort headers.
+ * user-regs.c: Sort headers.
+ * unittests/xml-utils-selftests.c: Sort headers.
+ * unittests/utils-selftests.c: Sort headers.
+ * unittests/unpack-selftests.c: Sort headers.
+ * unittests/tracepoint-selftests.c: Sort headers.
+ * unittests/style-selftests.c: Sort headers.
+ * unittests/scoped_restore-selftests.c: Sort headers.
+ * unittests/scoped_mmap-selftests.c: Sort headers.
+ * unittests/scoped_fd-selftests.c: Sort headers.
+ * unittests/rsp-low-selftests.c: Sort headers.
+ * unittests/ptid-selftests.c: Sort headers.
+ * unittests/parse-connection-spec-selftests.c: Sort headers.
+ * unittests/optional-selftests.c: Sort headers.
+ * unittests/offset-type-selftests.c: Sort headers.
+ * unittests/observable-selftests.c: Sort headers.
+ * unittests/mkdir-recursive-selftests.c: Sort headers.
+ * unittests/memrange-selftests.c: Sort headers.
+ * unittests/memory-map-selftests.c: Sort headers.
+ * unittests/lookup_name_info-selftests.c: Sort headers.
+ * unittests/function-view-selftests.c: Sort headers.
+ * unittests/format_pieces-selftests.c: Sort headers.
+ * unittests/environ-selftests.c: Sort headers.
+ * unittests/copy_bitwise-selftests.c: Sort headers.
+ * unittests/common-utils-selftests.c: Sort headers.
+ * unittests/cli-utils-selftests.c: Sort headers.
+ * unittests/child-path-selftests.c: Sort headers.
+ * unittests/array-view-selftests.c: Sort headers.
+ * ui-out.h: Sort headers.
+ * ui-out.c: Sort headers.
+ * ui-file.h: Sort headers.
+ * ui-file.c: Sort headers.
+ * typeprint.c: Sort headers.
+ * tui/tui.c: Sort headers.
+ * tui/tui-winsource.c: Sort headers.
+ * tui/tui-wingeneral.c: Sort headers.
+ * tui/tui-windata.c: Sort headers.
+ * tui/tui-win.c: Sort headers.
+ * tui/tui-stack.c: Sort headers.
+ * tui/tui-source.c: Sort headers.
+ * tui/tui-regs.h: Sort headers.
+ * tui/tui-regs.c: Sort headers.
+ * tui/tui-out.c: Sort headers.
+ * tui/tui-layout.h: Sort headers.
+ * tui/tui-layout.c: Sort headers.
+ * tui/tui-io.c: Sort headers.
+ * tui/tui-interp.c: Sort headers.
+ * tui/tui-hooks.c: Sort headers.
+ * tui/tui-file.c: Sort headers.
+ * tui/tui-disasm.h: Sort headers.
+ * tui/tui-disasm.c: Sort headers.
+ * tui/tui-data.h: Sort headers.
+ * tui/tui-data.c: Sort headers.
+ * tui/tui-command.c: Sort headers.
+ * tramp-frame.h: Sort headers.
+ * tramp-frame.c: Sort headers.
+ * trad-frame.h: Sort headers.
+ * trad-frame.c: Sort headers.
+ * tracepoint.h: Sort headers.
+ * tracepoint.c: Sort headers.
+ * tracefile.h: Sort headers.
+ * tracefile.c: Sort headers.
+ * tracefile-tfile.c: Sort headers.
+ * top.h: Sort headers.
+ * top.c: Sort headers.
+ * tilegx-tdep.c: Sort headers.
+ * tilegx-linux-tdep.c: Sort headers.
+ * tilegx-linux-nat.c: Sort headers.
+ * tid-parse.c: Sort headers.
+ * tic6x-tdep.c: Sort headers.
+ * tic6x-linux-tdep.c: Sort headers.
+ * thread.c: Sort headers.
+ * thread-iter.c: Sort headers.
+ * thread-fsm.h: Sort headers.
+ * target/waitstatus.c: Sort headers.
+ * target.c: Sort headers.
+ * target-memory.c: Sort headers.
+ * target-float.c: Sort headers.
+ * target-descriptions.c: Sort headers.
+ * target-dcache.c: Sort headers.
+ * symtab.h: Sort headers.
+ * symtab.c: Sort headers.
+ * symmisc.c: Sort headers.
+ * symfile.c: Sort headers.
+ * symfile-mem.c: Sort headers.
+ * symfile-debug.c: Sort headers.
+ * std-regs.c (value_of_builtin_frame_fp_reg): Sort headers.
+ * stap-probe.c: Sort headers.
+ * stack.c: Sort headers.
+ * stabsread.c: Sort headers.
+ * spu-tdep.c: Sort headers.
+ * spu-multiarch.c: Sort headers.
+ * spu-linux-nat.c: Sort headers.
+ * sparc64-tdep.c: Sort headers.
+ * sparc64-sol2-tdep.c: Sort headers.
+ * sparc64-obsd-tdep.c: Sort headers.
+ * sparc64-obsd-nat.c: Sort headers.
+ * sparc64-nbsd-tdep.c: Sort headers.
+ * sparc64-nbsd-nat.c: Sort headers.
+ * sparc64-nat.c: Sort headers.
+ * sparc64-linux-tdep.c: Sort headers.
+ * sparc64-linux-nat.c: Sort headers.
+ * sparc64-fbsd-tdep.c: Sort headers.
+ * sparc64-fbsd-nat.c: Sort headers.
+ * sparc-tdep.c: Sort headers.
+ * sparc-sol2-tdep.c: Sort headers.
+ * sparc-sol2-nat.c: Sort headers.
+ * sparc-ravenscar-thread.c: Sort headers.
+ * sparc-obsd-tdep.c: Sort headers.
+ * sparc-nbsd-tdep.c: Sort headers.
+ * sparc-nbsd-nat.c: Sort headers.
+ * sparc-nat.c: Sort headers.
+ * sparc-linux-tdep.c: Sort headers.
+ * sparc-linux-nat.c: Sort headers.
+ * source.c: Sort headers.
+ * source-cache.c: Sort headers.
+ * solib.c: Sort headers.
+ * solib-target.c: Sort headers.
+ * solib-svr4.c: Sort headers.
+ * solib-spu.c: Sort headers.
+ * solib-frv.c: Sort headers.
+ * solib-dsbt.c: Sort headers.
+ * solib-darwin.c: Sort headers.
+ * solib-aix.c: Sort headers.
+ * sol2-tdep.c: Sort headers.
+ * sol-thread.c: Sort headers.
+ * skip.c: Sort headers.
+ * sh-tdep.c: Sort headers.
+ * sh-nbsd-tdep.c: Sort headers.
+ * sh-nbsd-nat.c: Sort headers.
+ * sh-linux-tdep.c: Sort headers.
+ * serial.c: Sort headers.
+ * ser-unix.c: Sort headers.
+ * ser-uds.c: Sort headers.
+ * ser-tcp.c: Sort headers.
+ * ser-pipe.c: Sort headers.
+ * ser-mingw.c: Sort headers.
+ * ser-go32.c: Sort headers.
+ * ser-event.c: Sort headers.
+ * ser-base.h: Sort headers.
+ * ser-base.c: Sort headers.
+ * sentinel-frame.c: Sort headers.
+ * selftest-arch.c: Sort headers.
+ * score-tdep.c: Sort headers.
+ * s390-tdep.c: Sort headers.
+ * s390-linux-tdep.c: Sort headers.
+ * s390-linux-nat.c: Sort headers.
+ * s12z-tdep.c: Sort headers.
+ * rx-tdep.c: Sort headers.
+ * rust-lang.c: Sort headers.
+ * rs6000-tdep.c: Sort headers.
+ * rs6000-nat.c (__LDINFO_PTRACE32__): Sort headers.
+ * rs6000-lynx178-tdep.c: Sort headers.
+ * rs6000-aix-tdep.c: Sort headers.
+ * rl78-tdep.c: Sort headers.
+ * riscv-tdep.c: Sort headers.
+ * riscv-linux-tdep.c: Sort headers.
+ * riscv-linux-nat.c: Sort headers.
+ * riscv-fbsd-tdep.c: Sort headers.
+ * riscv-fbsd-nat.c: Sort headers.
+ * reverse.c: Sort headers.
+ * remote.c: Sort headers.
+ * remote-sim.c: Sort headers.
+ * remote-notif.h: Sort headers.
+ * remote-notif.c: Sort headers.
+ * remote-fileio.c: Sort headers.
+ * reggroups.c: Sort headers.
+ * regcache.h: Sort headers.
+ * regcache.c: Sort headers.
+ * regcache-dump.c: Sort headers.
+ * record.h: Sort headers.
+ * record.c: Sort headers.
+ * record-full.c: Sort headers.
+ * record-btrace.c: Sort headers.
+ * ravenscar-thread.c: Sort headers.
+ * python/python.c: Sort headers.
+ * python/python-internal.h: Sort headers.
+ * python/py-xmethods.c: Sort headers.
+ * python/py-varobj.c: Sort headers.
+ * python/py-value.c: Sort headers.
+ * python/py-utils.c: Sort headers.
+ * python/py-unwind.c: Sort headers.
+ * python/py-type.c: Sort headers.
+ * python/py-threadevent.c: Sort headers.
+ * python/py-symtab.c: Sort headers.
+ * python/py-symbol.c: Sort headers.
+ * python/py-stopevent.c: Sort headers.
+ * python/py-signalevent.c: Sort headers.
+ * python/py-record.h: Sort headers.
+ * python/py-record.c: Sort headers.
+ * python/py-record-full.c: Sort headers.
+ * python/py-record-btrace.c: Sort headers.
+ * python/py-progspace.c: Sort headers.
+ * python/py-prettyprint.c: Sort headers.
+ * python/py-param.c: Sort headers.
+ * python/py-objfile.c: Sort headers.
+ * python/py-newobjfileevent.c: Sort headers.
+ * python/py-linetable.c: Sort headers.
+ * python/py-lazy-string.c: Sort headers.
+ * python/py-instruction.c: Sort headers.
+ * python/py-infthread.c: Sort headers.
+ * python/py-infevents.c: Sort headers.
+ * python/py-inferior.c: Sort headers.
+ * python/py-gdb-readline.c: Sort headers.
+ * python/py-function.c: Sort headers.
+ * python/py-framefilter.c: Sort headers.
+ * python/py-frame.c: Sort headers.
+ * python/py-finishbreakpoint.c: Sort headers.
+ * python/py-exitedevent.c: Sort headers.
+ * python/py-evts.c: Sort headers.
+ * python/py-evtregistry.c: Sort headers.
+ * python/py-events.h: Sort headers.
+ * python/py-event.h: Sort headers.
+ * python/py-event.c: Sort headers.
+ * python/py-continueevent.c: Sort headers.
+ * python/py-cmd.c: Sort headers.
+ * python/py-breakpoint.c: Sort headers.
+ * python/py-bpevent.c: Sort headers.
+ * python/py-block.c: Sort headers.
+ * python/py-auto-load.c: Sort headers.
+ * python/py-arch.c: Sort headers.
+ * psymtab.h: Sort headers.
+ * psymtab.c: Sort headers.
+ * psympriv.h: Sort headers.
+ * prologue-value.c: Sort headers.
+ * progspace.h: Sort headers.
+ * progspace.c: Sort headers.
+ * progspace-and-thread.h: Sort headers.
+ * progspace-and-thread.c: Sort headers.
+ * producer.c: Sort headers.
+ * procfs.c: Sort headers.
+ * process-stratum-target.c: Sort headers.
+ * proc-service.c: Sort headers.
+ * proc-api.c: Sort headers.
+ * probe.c: Sort headers.
+ * printcmd.c: Sort headers.
+ * ppc64-tdep.c: Sort headers.
+ * ppc-sysv-tdep.c: Sort headers.
+ * ppc-ravenscar-thread.c: Sort headers.
+ * ppc-obsd-tdep.c: Sort headers.
+ * ppc-obsd-nat.c: Sort headers.
+ * ppc-nbsd-tdep.c: Sort headers.
+ * ppc-nbsd-nat.c: Sort headers.
+ * ppc-linux-tdep.h: Sort headers.
+ * ppc-linux-tdep.c: Sort headers.
+ * ppc-linux-nat.c: Sort headers.
+ * ppc-fbsd-tdep.c: Sort headers.
+ * ppc-fbsd-nat.c: Sort headers.
+ * posix-hdep.c: Sort headers.
+ * parser-defs.h: Sort headers.
+ * parse.c: Sort headers.
+ * p-valprint.c: Sort headers.
+ * p-typeprint.c: Sort headers.
+ * p-lang.c: Sort headers.
+ * osdata.c: Sort headers.
+ * osabi.c: Sort headers.
+ * or1k-tdep.c: Sort headers.
+ * or1k-linux-tdep.c: Sort headers.
+ * opencl-lang.c: Sort headers.
+ * observable.c: Sort headers.
+ * obsd-tdep.c: Sort headers.
+ * obsd-nat.c: Sort headers.
+ * objfiles.h: Sort headers.
+ * objfiles.c: Sort headers.
+ * objc-lang.c: Sort headers.
+ * nto-tdep.h: Sort headers.
+ * nto-tdep.c: Sort headers.
+ * nto-procfs.c: Sort headers.
+ * nios2-tdep.c: Sort headers.
+ * nios2-linux-tdep.c: Sort headers.
+ * nds32-tdep.c: Sort headers.
+ * nbsd-tdep.c: Sort headers.
+ * nbsd-nat.c: Sort headers.
+ * nat/x86-linux.c: Sort headers.
+ * nat/x86-linux-dregs.c: Sort headers.
+ * nat/x86-dregs.c: Sort headers.
+ * nat/ppc-linux.h: Sort headers.
+ * nat/ppc-linux.c: Sort headers.
+ * nat/mips-linux-watch.h: Sort headers.
+ * nat/mips-linux-watch.c: Sort headers.
+ * nat/linux-waitpid.c: Sort headers.
+ * nat/linux-ptrace.c: Sort headers.
+ * nat/linux-procfs.c: Sort headers.
+ * nat/linux-osdata.c: Sort headers.
+ * nat/linux-namespaces.c: Sort headers.
+ * nat/linux-btrace.c: Sort headers.
+ * nat/fork-inferior.c: Sort headers.
+ * nat/amd64-linux-siginfo.h: Sort headers.
+ * nat/amd64-linux-siginfo.c: Sort headers.
+ * nat/aarch64-sve-linux-ptrace.h: Sort headers.
+ * nat/aarch64-sve-linux-ptrace.c: Sort headers.
+ * nat/aarch64-linux.c: Sort headers.
+ * nat/aarch64-linux-hw-point.h: Sort headers.
+ * nat/aarch64-linux-hw-point.c: Sort headers.
+ * namespace.h: Sort headers.
+ * msp430-tdep.c: Sort headers.
+ * moxie-tdep.c: Sort headers.
+ * mn10300-tdep.c: Sort headers.
+ * mn10300-linux-tdep.c: Sort headers.
+ * mipsread.c: Sort headers.
+ * mips64-obsd-tdep.c: Sort headers.
+ * mips64-obsd-nat.c: Sort headers.
+ * mips-tdep.c: Sort headers.
+ * mips-sde-tdep.c: Sort headers.
+ * mips-nbsd-tdep.c: Sort headers.
+ * mips-nbsd-nat.c: Sort headers.
+ * mips-linux-tdep.c: Sort headers.
+ * mips-linux-nat.c: Sort headers.
+ * mips-fbsd-tdep.c: Sort headers.
+ * mips-fbsd-nat.c: Sort headers.
+ * minsyms.c: Sort headers.
+ * minidebug.c: Sort headers.
+ * mingw-hdep.c: Sort headers.
+ * microblaze-tdep.c: Sort headers.
+ * microblaze-linux-tdep.c: Sort headers.
+ * mi/mi-symbol-cmds.c: Sort headers.
+ * mi/mi-parse.h: Sort headers.
+ * mi/mi-parse.c: Sort headers.
+ * mi/mi-out.c: Sort headers.
+ * mi/mi-main.c: Sort headers.
+ * mi/mi-interp.c: Sort headers.
+ * mi/mi-getopt.c: Sort headers.
+ * mi/mi-console.c: Sort headers.
+ * mi/mi-common.c: Sort headers.
+ * mi/mi-cmds.c: Sort headers.
+ * mi/mi-cmd-var.c: Sort headers.
+ * mi/mi-cmd-target.c: Sort headers.
+ * mi/mi-cmd-stack.c: Sort headers.
+ * mi/mi-cmd-info.c: Sort headers.
+ * mi/mi-cmd-file.c: Sort headers.
+ * mi/mi-cmd-env.c: Sort headers.
+ * mi/mi-cmd-disas.c: Sort headers.
+ * mi/mi-cmd-catch.c: Sort headers.
+ * mi/mi-cmd-break.c: Sort headers.
+ * mep-tdep.c: Sort headers.
+ * memrange.c: Sort headers.
+ * memattr.c: Sort headers.
+ * mem-break.c: Sort headers.
+ * mdebugread.h: Sort headers.
+ * mdebugread.c: Sort headers.
+ * maint.h: Sort headers.
+ * maint.c: Sort headers.
+ * main.c: Sort headers.
+ * macrotab.c: Sort headers.
+ * macroscope.c: Sort headers.
+ * macroexp.c: Sort headers.
+ * macrocmd.c: Sort headers.
+ * machoread.c: Sort headers.
+ * m68k-tdep.c: Sort headers.
+ * m68k-linux-tdep.c: Sort headers.
+ * m68k-linux-nat.c: Sort headers.
+ * m68k-bsd-tdep.c: Sort headers.
+ * m68k-bsd-nat.c: Sort headers.
+ * m68hc11-tdep.c: Sort headers.
+ * m32r-tdep.c: Sort headers.
+ * m32r-linux-tdep.c: Sort headers.
+ * m32r-linux-nat.c: Sort headers.
+ * m32c-tdep.c: Sort headers.
+ * m2-valprint.c: Sort headers.
+ * m2-typeprint.c: Sort headers.
+ * m2-lang.c: Sort headers.
+ * location.c: Sort headers.
+ * lm32-tdep.c: Sort headers.
+ * linux-thread-db.c: Sort headers.
+ * linux-tdep.c: Sort headers.
+ * linux-record.c: Sort headers.
+ * linux-nat.h: Sort headers.
+ * linux-nat.c: Sort headers.
+ * linux-nat-trad.c: Sort headers.
+ * linux-fork.c: Sort headers.
+ * linespec.c: Sort headers.
+ * language.h: Sort headers.
+ * language.c: Sort headers.
+ * jit.c: Sort headers.
+ * iq2000-tdep.c: Sort headers.
+ * interps.c: Sort headers.
+ * inline-frame.c: Sort headers.
+ * infrun.h: Sort headers.
+ * infrun.c: Sort headers.
+ * inflow.c: Sort headers.
+ * inferior.c: Sort headers.
+ * infcmd.c: Sort headers.
+ * infcall.h: Sort headers.
+ * infcall.c: Sort headers.
+ * inf-ptrace.c: Sort headers.
+ * inf-loop.h: Sort headers.
+ * inf-loop.c: Sort headers.
+ * inf-child.h: Sort headers.
+ * inf-child.c: Sort headers.
+ * ia64-vms-tdep.c: Sort headers.
+ * ia64-tdep.c: Sort headers.
+ * ia64-linux-tdep.c: Sort headers.
+ * ia64-linux-nat.c: Sort headers.
+ * ia64-libunwind-tdep.c: Sort headers.
+ * i387-tdep.c: Sort headers.
+ * i386-windows-nat.c: Sort headers.
+ * i386-tdep.c: Sort headers.
+ * i386-sol2-tdep.c: Sort headers.
+ * i386-sol2-nat.c: Sort headers.
+ * i386-obsd-tdep.c: Sort headers.
+ * i386-obsd-nat.c: Sort headers.
+ * i386-nto-tdep.c: Sort headers.
+ * i386-nbsd-tdep.c: Sort headers.
+ * i386-nbsd-nat.c: Sort headers.
+ * i386-linux-tdep.c: Sort headers.
+ * i386-linux-nat.c: Sort headers.
+ * i386-go32-tdep.c: Sort headers.
+ * i386-gnu-tdep.c: Sort headers.
+ * i386-gnu-nat.c: Sort headers.
+ * i386-fbsd-tdep.c: Sort headers.
+ * i386-fbsd-nat.c: Sort headers.
+ * i386-dicos-tdep.c: Sort headers.
+ * i386-darwin-tdep.c: Sort headers.
+ * i386-darwin-nat.c: Sort headers.
+ * i386-cygwin-tdep.c: Sort headers.
+ * i386-bsd-tdep.c: Sort headers.
+ * i386-bsd-nat.c: Sort headers.
+ * hppa-tdep.c: Sort headers.
+ * hppa-obsd-tdep.c: Sort headers.
+ * hppa-obsd-nat.c: Sort headers.
+ * hppa-nbsd-tdep.c: Sort headers.
+ * hppa-nbsd-nat.c: Sort headers.
+ * hppa-linux-tdep.c: Sort headers.
+ * hppa-linux-nat.c: Sort headers.
+ * hppa-bsd-tdep.c: Sort headers.
+ * h8300-tdep.c: Sort headers.
+ * guile/scm-value.c: Sort headers.
+ * guile/scm-utils.c: Sort headers.
+ * guile/scm-type.c: Sort headers.
+ * guile/scm-symtab.c: Sort headers.
+ * guile/scm-symbol.c: Sort headers.
+ * guile/scm-string.c: Sort headers.
+ * guile/scm-safe-call.c: Sort headers.
+ * guile/scm-progspace.c: Sort headers.
+ * guile/scm-pretty-print.c: Sort headers.
+ * guile/scm-ports.c: Sort headers.
+ * guile/scm-param.c: Sort headers.
+ * guile/scm-objfile.c: Sort headers.
+ * guile/scm-math.c: Sort headers.
+ * guile/scm-lazy-string.c: Sort headers.
+ * guile/scm-iterator.c: Sort headers.
+ * guile/scm-gsmob.c: Sort headers.
+ * guile/scm-frame.c: Sort headers.
+ * guile/scm-exception.c: Sort headers.
+ * guile/scm-disasm.c: Sort headers.
+ * guile/scm-cmd.c: Sort headers.
+ * guile/scm-breakpoint.c: Sort headers.
+ * guile/scm-block.c: Sort headers.
+ * guile/scm-auto-load.c: Sort headers.
+ * guile/scm-arch.c: Sort headers.
+ * guile/guile.c: Sort headers.
+ * go32-nat.c: Sort headers.
+ * go-valprint.c: Sort headers.
+ * go-typeprint.c: Sort headers.
+ * go-lang.c: Sort headers.
+ * gnu-v3-abi.c: Sort headers.
+ * gnu-v2-abi.c: Sort headers.
+ * gnu-nat.c: Sort headers.
+ * glibc-tdep.c: Sort headers.
+ * gdbtypes.c: Sort headers.
+ * gdbcmd.h: Sort headers.
+ * gdb_usleep.c: Sort headers.
+ * gdb_regex.c: Sort headers.
+ * gdb_bfd.h: Sort headers.
+ * gdb_bfd.c: Sort headers.
+ * gdb.c: Sort headers.
+ * gcore.c: Sort headers.
+ * ft32-tdep.c: Sort headers.
+ * frv-tdep.c: Sort headers.
+ * frv-linux-tdep.c: Sort headers.
+ * frame.c: Sort headers.
+ * frame-unwind.c: Sort headers.
+ * frame-base.c: Sort headers.
+ * fork-child.c: Sort headers.
+ * findvar.c: Sort headers.
+ * findcmd.c: Sort headers.
+ * filesystem.c: Sort headers.
+ * filename-seen-cache.h: Sort headers.
+ * filename-seen-cache.c: Sort headers.
+ * features/aarch64-sve.c: Sort headers.
+ * fbsd-tdep.c: Sort headers.
+ * fbsd-nat.h: Sort headers.
+ * fbsd-nat.c: Sort headers.
+ * f-valprint.c: Sort headers.
+ * f-typeprint.c: Sort headers.
+ * f-lang.c: Sort headers.
+ * extension.h: Sort headers.
+ * extension.c: Sort headers.
+ * extension-priv.h: Sort headers.
+ * expprint.c: Sort headers.
+ * exec.h: Sort headers.
+ * exec.c: Sort headers.
+ * exceptions.c: Sort headers.
+ * event-top.c: Sort headers.
+ * event-loop.c: Sort headers.
+ * eval.c: Sort headers.
+ * elfread.c: Sort headers.
+ * dwarf2read.h: Sort headers.
+ * dwarf2read.c: Sort headers.
+ * dwarf2loc.c: Sort headers.
+ * dwarf2expr.h: Sort headers.
+ * dwarf2expr.c: Sort headers.
+ * dwarf2-frame.c: Sort headers.
+ * dwarf2-frame-tailcall.c: Sort headers.
+ * dwarf-index-write.h: Sort headers.
+ * dwarf-index-write.c: Sort headers.
+ * dwarf-index-cache.h: Sort headers.
+ * dwarf-index-cache.c: Sort headers.
+ * dummy-frame.c: Sort headers.
+ * dtrace-probe.c: Sort headers.
+ * disasm.h: Sort headers.
+ * disasm.c: Sort headers.
+ * disasm-selftests.c: Sort headers.
+ * dictionary.c: Sort headers.
+ * dicos-tdep.c: Sort headers.
+ * demangle.c: Sort headers.
+ * dcache.h: Sort headers.
+ * dcache.c: Sort headers.
+ * darwin-nat.h: Sort headers.
+ * darwin-nat.c: Sort headers.
+ * darwin-nat-info.c: Sort headers.
+ * d-valprint.c: Sort headers.
+ * d-namespace.c: Sort headers.
+ * d-lang.c: Sort headers.
+ * ctf.c: Sort headers.
+ * csky-tdep.c: Sort headers.
+ * csky-linux-tdep.c: Sort headers.
+ * cris-tdep.c: Sort headers.
+ * cris-linux-tdep.c: Sort headers.
+ * cp-valprint.c: Sort headers.
+ * cp-support.c: Sort headers.
+ * cp-namespace.c: Sort headers.
+ * cp-abi.c: Sort headers.
+ * corelow.c: Sort headers.
+ * corefile.c: Sort headers.
+ * continuations.c: Sort headers.
+ * completer.h: Sort headers.
+ * completer.c: Sort headers.
+ * complaints.c: Sort headers.
+ * compile/compile.c: Sort headers.
+ * compile/compile-object-run.c: Sort headers.
+ * compile/compile-object-load.h: Sort headers.
+ * compile/compile-object-load.c: Sort headers.
+ * compile/compile-loc2c.c: Sort headers.
+ * compile/compile-cplus.h: Sort headers.
+ * compile/compile-cplus-types.c: Sort headers.
+ * compile/compile-cplus-symbols.c: Sort headers.
+ * compile/compile-c.h: Sort headers.
+ * compile/compile-c-types.c: Sort headers.
+ * compile/compile-c-symbols.c: Sort headers.
+ * compile/compile-c-support.c: Sort headers.
+ * common/xml-utils.c: Sort headers.
+ * common/vec.c: Sort headers.
+ * common/tdesc.c: Sort headers.
+ * common/signals.c: Sort headers.
+ * common/signals-state-save-restore.c: Sort headers.
+ * common/selftest.c: Sort headers.
+ * common/scoped_mmap.c: Sort headers.
+ * common/scoped_fd.h: Sort headers.
+ * common/scope-exit.h: Sort headers.
+ * common/run-time-clock.c: Sort headers.
+ * common/rsp-low.c: Sort headers.
+ * common/ptid.c: Sort headers.
+ * common/print-utils.c: Sort headers.
+ * common/posix-strerror.c: Sort headers.
+ * common/poison.h: Sort headers.
+ * common/pathstuff.c: Sort headers.
+ * common/netstuff.c: Sort headers.
+ * common/mingw-strerror.c: Sort headers.
+ * common/job-control.c: Sort headers.
+ * common/gdb_vecs.c: Sort headers.
+ * common/gdb_tilde_expand.c: Sort headers.
+ * common/forward-scope-exit.h: Sort headers.
+ * common/format.c: Sort headers.
+ * common/filestuff.c: Sort headers.
+ * common/fileio.h: Sort headers.
+ * common/fileio.c: Sort headers.
+ * common/errors.c: Sort headers.
+ * common/environ.h: Sort headers.
+ * common/environ.c: Sort headers.
+ * common/def-vector.h: Sort headers.
+ * common/common-utils.h: Sort headers.
+ * common/common-utils.c: Sort headers.
+ * common/common-regcache.c: Sort headers.
+ * common/common-exceptions.h: Sort headers.
+ * common/common-exceptions.c: Sort headers.
+ * common/common-debug.c: Sort headers.
+ * common/cleanups.c: Sort headers.
+ * common/buffer.c (buffer_grow): Sort headers.
+ * common/btrace-common.c: Sort headers.
+ * common/array-view.h: Sort headers.
+ * common/agent.c: Sort headers.
+ * coffread.c: Sort headers.
+ * coff-pe-read.c: Sort headers.
+ * cli/cli-utils.c: Sort headers.
+ * cli/cli-style.c: Sort headers.
+ * cli/cli-setshow.c: Sort headers.
+ * cli/cli-script.c: Sort headers.
+ * cli/cli-logging.c: Sort headers.
+ * cli/cli-interp.c: Sort headers.
+ * cli/cli-dump.c: Sort headers.
+ * cli/cli-decode.c: Sort headers.
+ * cli/cli-cmds.c: Sort headers.
+ * cli-out.h: Sort headers.
+ * cli-out.c: Sort headers.
+ * charset.c: Sort headers.
+ * c-varobj.c: Sort headers.
+ * c-valprint.c: Sort headers.
+ * c-typeprint.c: Sort headers.
+ * c-lang.c: Sort headers.
+ * buildsym.c: Sort headers.
+ * build-id.h: Sort headers.
+ * build-id.c: Sort headers.
+ * btrace.c: Sort headers.
+ * bsd-uthread.c: Sort headers.
+ * breakpoint.h: Sort headers.
+ * breakpoint.c: Sort headers.
+ * break-catch-throw.c: Sort headers.
+ * break-catch-syscall.c: Sort headers.
+ * break-catch-sig.c: Sort headers.
+ * blockframe.c: Sort headers.
+ * block.c: Sort headers.
+ * bfin-tdep.c: Sort headers.
+ * bfin-linux-tdep.c: Sort headers.
+ * bfd-target.c: Sort headers.
+ * bcache.c: Sort headers.
+ * ax-general.c: Sort headers.
+ * ax-gdb.h: Sort headers.
+ * ax-gdb.c: Sort headers.
+ * avr-tdep.c: Sort headers.
+ * auxv.c: Sort headers.
+ * auto-load.c: Sort headers.
+ * arm-wince-tdep.c: Sort headers.
+ * arm-tdep.c: Sort headers.
+ * arm-symbian-tdep.c: Sort headers.
+ * arm-pikeos-tdep.c: Sort headers.
+ * arm-obsd-tdep.c: Sort headers.
+ * arm-nbsd-tdep.c: Sort headers.
+ * arm-nbsd-nat.c: Sort headers.
+ * arm-linux-tdep.c: Sort headers.
+ * arm-linux-nat.c: Sort headers.
+ * arm-fbsd-tdep.c: Sort headers.
+ * arm-fbsd-nat.c: Sort headers.
+ * arm-bsd-tdep.c: Sort headers.
+ * arch/tic6x.c: Sort headers.
+ * arch/riscv.c: Sort headers.
+ * arch/ppc-linux-common.c: Sort headers.
+ * arch/i386.h: Sort headers.
+ * arch/i386.c: Sort headers.
+ * arch/arm.c: Sort headers.
+ * arch/arm-linux.c: Sort headers.
+ * arch/arm-get-next-pcs.c: Sort headers.
+ * arch/amd64.h: Sort headers.
+ * arch/amd64.c: Sort headers.
+ * arch/aarch64.c: Sort headers.
+ * arch/aarch64-insn.c: Sort headers.
+ * arch-utils.c: Sort headers.
+ * arc-tdep.c: Sort headers.
+ * arc-newlib-tdep.c: Sort headers.
+ * annotate.h: Sort headers.
+ * annotate.c: Sort headers.
+ * amd64-windows-tdep.c: Sort headers.
+ * amd64-windows-nat.c: Sort headers.
+ * amd64-tdep.c: Sort headers.
+ * amd64-sol2-tdep.c: Sort headers.
+ * amd64-obsd-tdep.c: Sort headers.
+ * amd64-obsd-nat.c: Sort headers.
+ * amd64-nbsd-tdep.c: Sort headers.
+ * amd64-nbsd-nat.c: Sort headers.
+ * amd64-nat.c: Sort headers.
+ * amd64-linux-tdep.c: Sort headers.
+ * amd64-linux-nat.c: Sort headers.
+ * amd64-fbsd-tdep.c: Sort headers.
+ * amd64-fbsd-nat.c: Sort headers.
+ * amd64-dicos-tdep.c: Sort headers.
+ * amd64-darwin-tdep.c: Sort headers.
+ * amd64-bsd-nat.c: Sort headers.
+ * alpha-tdep.c: Sort headers.
+ * alpha-obsd-tdep.c: Sort headers.
+ * alpha-nbsd-tdep.c: Sort headers.
+ * alpha-mdebug-tdep.c: Sort headers.
+ * alpha-linux-tdep.c: Sort headers.
+ * alpha-linux-nat.c: Sort headers.
+ * alpha-bsd-tdep.c: Sort headers.
+ * alpha-bsd-nat.c: Sort headers.
+ * aix-thread.c: Sort headers.
+ * agent.c: Sort headers.
+ * addrmap.c: Sort headers.
+ * ada-varobj.c: Sort headers.
+ * ada-valprint.c: Sort headers.
+ * ada-typeprint.c: Sort headers.
+ * ada-tasks.c: Sort headers.
+ * ada-lang.c: Sort headers.
+ * aarch64-tdep.c: Sort headers.
+ * aarch64-ravenscar-thread.c: Sort headers.
+ * aarch64-newlib-tdep.c: Sort headers.
+ * aarch64-linux-tdep.c: Sort headers.
+ * aarch64-linux-nat.c: Sort headers.
+ * aarch64-fbsd-tdep.c: Sort headers.
+ * aarch64-fbsd-nat.c: Sort headers.
+ * aarch32-linux-nat.c: Sort headers.
+
2019-03-30 Eli Zaretskii <eliz@gnu.org>
* NEWS: Announce $_gdb_major and $_gdb_minor.
diff --git a/gdb/aarch32-linux-nat.c b/gdb/aarch32-linux-nat.c
index e23dbb1bbbe..b50b19e41c9 100644
--- a/gdb/aarch32-linux-nat.c
+++ b/gdb/aarch32-linux-nat.c
@@ -16,13 +16,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "aarch32-linux-nat.h"
-#include "regcache.h"
-#include "arm-tdep.h"
-#include "arm-linux-tdep.h"
+/* Local subdirectory includes. */
#include "arch/arm-linux.h"
-#include "aarch32-linux-nat.h"
+/* Local includes. */
+#include "arm-linux-tdep.h"
+#include "arm-tdep.h"
+#include "regcache.h"
/* Supply GP registers contents, stored in REGS, to REGCACHE. ARM_APCS_32
is true if the 32-bit mode is in use, otherwise, it is false. */
diff --git a/gdb/aarch64-fbsd-nat.c b/gdb/aarch64-fbsd-nat.c
index bb187a600d0..279b4844652 100644
--- a/gdb/aarch64-fbsd-nat.c
+++ b/gdb/aarch64-fbsd-nat.c
@@ -18,16 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
+/* Standard C includes. */
#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
-#include "fbsd-nat.h"
-#include "aarch64-tdep.h"
+/* Local includes. */
#include "aarch64-fbsd-tdep.h"
+#include "aarch64-tdep.h"
+#include "fbsd-nat.h"
#include "inf-ptrace.h"
+#include "target.h"
struct aarch64_fbsd_nat_target final : public fbsd_nat_target
{
diff --git a/gdb/aarch64-fbsd-tdep.c b/gdb/aarch64-fbsd-tdep.c
index c611ff350bd..57b54ddbf11 100644
--- a/gdb/aarch64-fbsd-tdep.c
+++ b/gdb/aarch64-fbsd-tdep.c
@@ -18,16 +18,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "aarch64-fbsd-tdep.h"
-#include "gdbarch.h"
-#include "fbsd-tdep.h"
+/* Local includes. */
#include "aarch64-tdep.h"
-#include "aarch64-fbsd-tdep.h"
+#include "fbsd-tdep.h"
+#include "gdbarch.h"
#include "osabi.h"
#include "solib-svr4.h"
#include "target.h"
-#include "tramp-frame.h"
#include "trad-frame.h"
+#include "tramp-frame.h"
/* Register maps. */
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 6d43eb7070f..c286b5420db 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -20,29 +20,33 @@
#include "defs.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "linux-nat.h"
-#include "target-descriptions.h"
-#include "auxv.h"
-#include "gdbcmd.h"
-#include "aarch64-tdep.h"
-#include "aarch64-linux-tdep.h"
-#include "aarch32-linux-nat.h"
-#include "nat/aarch64-linux.h"
-#include "nat/aarch64-linux-hw-point.h"
-#include "nat/aarch64-sve-linux-ptrace.h"
+/* Standard C includes. */
+#include <asm/ptrace.h>
+#include <sys/utsname.h>
-#include "elf/external.h"
+/* Local non-gdb includes. */
#include "elf/common.h"
+#include "elf/external.h"
+/* Local subdirectory includes. */
+#include "nat/aarch64-linux-hw-point.h"
+#include "nat/aarch64-linux.h"
+#include "nat/aarch64-sve-linux-ptrace.h"
#include "nat/gdb_ptrace.h"
-#include <sys/utsname.h>
-#include <asm/ptrace.h>
+/* Local includes. */
+#include "aarch32-linux-nat.h"
+#include "aarch64-linux-tdep.h"
+#include "aarch64-tdep.h"
+#include "auxv.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
#include "gregset.h"
+#include "inferior.h"
+#include "linux-nat.h"
#include "linux-tdep.h"
+#include "regcache.h"
+#include "target-descriptions.h"
/* Defines ps_err_e, struct ps_prochandle. */
#include "gdb_proc_service.h"
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 7f2193f2fa5..60cf0876be9 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -19,34 +19,38 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "aarch64-linux-tdep.h"
-#include "gdbarch.h"
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
+#include "elf/common.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+
+/* Local includes. */
+#include "aarch64-tdep.h"
#include "arch-utils.h"
+#include "auxv.h"
+#include "gdbarch.h"
#include "glibc-tdep.h"
+#include "inferior.h"
+#include "linux-record.h"
#include "linux-tdep.h"
-#include "aarch64-tdep.h"
-#include "aarch64-linux-tdep.h"
#include "osabi.h"
-#include "solib-svr4.h"
-#include "symtab.h"
-#include "tramp-frame.h"
-#include "trad-frame.h"
-
-#include "inferior.h"
+#include "parser-defs.h"
+#include "record-full.h"
#include "regcache.h"
#include "regset.h"
-
-#include "cli/cli-utils.h"
+#include "solib-svr4.h"
#include "stap-probe.h"
-#include "parser-defs.h"
+#include "symtab.h"
+#include "trad-frame.h"
+#include "tramp-frame.h"
#include "user-regs.h"
#include "xml-syscall.h"
-#include <ctype.h>
-
-#include "record-full.h"
-#include "linux-record.h"
-#include "auxv.h"
-#include "elf/common.h"
/* Signal frame handling.
diff --git a/gdb/aarch64-newlib-tdep.c b/gdb/aarch64-newlib-tdep.c
index 131f0991970..273d6c316ee 100644
--- a/gdb/aarch64-newlib-tdep.c
+++ b/gdb/aarch64-newlib-tdep.c
@@ -20,8 +20,9 @@
#include "defs.h"
-#include "gdbarch.h"
+/* Local includes. */
#include "aarch64-tdep.h"
+#include "gdbarch.h"
#include "osabi.h"
/* Implement the 'init_osabi' method of struct gdb_osabi_handler. */
diff --git a/gdb/aarch64-ravenscar-thread.c b/gdb/aarch64-ravenscar-thread.c
index 3e87a4bf5b9..446f982449f 100644
--- a/gdb/aarch64-ravenscar-thread.c
+++ b/gdb/aarch64-ravenscar-thread.c
@@ -18,12 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
-#include "regcache.h"
+#include "aarch64-ravenscar-thread.h"
+
+/* Local includes. */
#include "aarch64-tdep.h"
+#include "gdbcore.h"
#include "inferior.h"
#include "ravenscar-thread.h"
-#include "aarch64-ravenscar-thread.h"
+#include "regcache.h"
#define NO_OFFSET -1
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 68b6549ba9b..165e3436933 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -19,47 +19,49 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "aarch64-tdep.h"
-#include "frame.h"
-#include "inferior.h"
-#include "gdbcmd.h"
-#include "gdbcore.h"
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "dis-asm.h"
-#include "regcache.h"
-#include "reggroups.h"
-#include "value.h"
-#include "arch-utils.h"
-#include "osabi.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "trad-frame.h"
-#include "objfiles.h"
#include "dwarf2.h"
-#include "dwarf2-frame.h"
-#include "gdbtypes.h"
-#include "prologue-value.h"
-#include "target-descriptions.h"
-#include "user-regs.h"
-#include "language.h"
-#include "infcall.h"
-#include "ax.h"
-#include "ax-gdb.h"
-#include "common/selftest.h"
-
-#include "aarch64-tdep.h"
-#include "aarch64-ravenscar-thread.h"
-
#include "elf-bfd.h"
#include "elf/aarch64.h"
+#include "opcode/aarch64.h"
+/* Local subdirectory includes. */
+#include "arch/aarch64-insn.h"
+#include "common/selftest.h"
#include "common/vec.h"
-#include "record.h"
+/* Local includes. */
+#include "aarch64-ravenscar-thread.h"
+#include "arch-utils.h"
+#include "ax-gdb.h"
+#include "ax.h"
+#include "dwarf2-frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "infcall.h"
+#include "inferior.h"
+#include "language.h"
+#include "objfiles.h"
+#include "osabi.h"
+#include "prologue-value.h"
#include "record-full.h"
-#include "arch/aarch64-insn.h"
-
-#include "opcode/aarch64.h"
-#include <algorithm>
+#include "record.h"
+#include "regcache.h"
+#include "reggroups.h"
+#include "target-descriptions.h"
+#include "trad-frame.h"
+#include "user-regs.h"
+#include "value.h"
#define submask(x) ((1L << ((x) + 1)) - 1)
#define bit(obj,st) (((obj) >> (st)) & 1)
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index cdaf5589bc4..09990b54e51 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -19,50 +19,59 @@
#include "defs.h"
+#include "ada-lang.h"
+
+/* Standard C includes. */
#include <ctype.h>
+#include <sys/stat.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "demangle.h"
-#include "gdb_regex.h"
+#include "hashtab.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+#include "common/byte-vector.h"
+#include "common/function-view.h"
+#include "common/gdb_vecs.h"
+#include "common/vec.h"
+#include "mi/mi-common.h"
+
+/* Local includes. */
+#include "annotate.h"
+#include "arch-utils.h"
+#include "block.h"
+#include "breakpoint.h"
+#include "c-lang.h"
+#include "completer.h"
+#include "dictionary.h"
+#include "expression.h"
#include "frame.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+#include "gdb_obstack.h"
+#include "gdb_regex.h"
#include "gdbcmd.h"
-#include "expression.h"
-#include "parser-defs.h"
-#include "language.h"
-#include "varobj.h"
-#include "c-lang.h"
-#include "inferior.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "breakpoint.h"
#include "gdbcore.h"
-#include "hashtab.h"
-#include "gdb_obstack.h"
-#include "ada-lang.h"
-#include "completer.h"
-#include <sys/stat.h>
-#include "ui-out.h"
-#include "block.h"
+#include "gdbtypes.h"
#include "infcall.h"
-#include "dictionary.h"
-#include "annotate.h"
-#include "valprint.h"
-#include "source.h"
+#include "inferior.h"
+#include "language.h"
+#include "namespace.h"
+#include "objfiles.h"
#include "observable.h"
-#include "common/vec.h"
+#include "parser-defs.h"
+#include "psymtab.h"
+#include "source.h"
#include "stack.h"
-#include "common/gdb_vecs.h"
+#include "symfile.h"
+#include "symtab.h"
#include "typeprint.h"
-#include "namespace.h"
-
-#include "psymtab.h"
+#include "ui-out.h"
+#include "valprint.h"
#include "value.h"
-#include "mi/mi-common.h"
-#include "arch-utils.h"
-#include "cli/cli-utils.h"
-#include "common/function-view.h"
-#include "common/byte-vector.h"
-#include <algorithm>
+#include "varobj.h"
/* Define whether or not the C operator '/' truncates towards zero for
differently signed operands (truncation direction is undefined in C).
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
index ccabc631040..baf2236e5e9 100644
--- a/gdb/ada-tasks.c
+++ b/gdb/ada-tasks.c
@@ -16,15 +16,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "observable.h"
-#include "gdbcmd.h"
-#include "target.h"
+
+/* Local includes. */
#include "ada-lang.h"
+#include "gdbcmd.h"
#include "gdbcore.h"
-#include "inferior.h"
#include "gdbthread.h"
-#include "progspace.h"
+#include "inferior.h"
#include "objfiles.h"
+#include "observable.h"
+#include "progspace.h"
+#include "target.h"
static int ada_build_task_list ();
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index efcd14bedc5..6f43a6f4601 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -17,24 +17,32 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdb_obstack.h"
-#include "bfd.h" /* Binary File Description */
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "value.h"
-#include "gdbcore.h"
-#include "target.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
+#include "bfd.h"
+#include "demangle.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-style.h"
+
+/* Local includes. */
+#include "ada-lang.h"
+#include "c-lang.h"
#include "command.h"
+#include "expression.h"
+#include "gdb_obstack.h"
#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
#include "language.h"
-#include "demangle.h"
-#include "c-lang.h"
-#include "cli/cli-style.h"
-#include "typeprint.h"
+#include "symtab.h"
#include "target-float.h"
-#include "ada-lang.h"
-#include <ctype.h>
+#include "target.h"
+#include "typeprint.h"
+#include "value.h"
static int print_selected_record_field_types (struct type *, struct type *,
int, int,
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index d4661e1f1d4..32854874b00 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -18,20 +18,26 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "value.h"
+
+/* Local non-gdb includes. */
#include "demangle.h"
-#include "valprint.h"
-#include "language.h"
-#include "annotate.h"
+
+/* Local includes. */
#include "ada-lang.h"
+#include "annotate.h"
#include "c-lang.h"
+#include "expression.h"
+#include "gdbtypes.h"
#include "infcall.h"
+#include "language.h"
#include "objfiles.h"
+#include "symtab.h"
#include "target-float.h"
+#include "valprint.h"
+#include "value.h"
static int print_field_values (struct type *, const gdb_byte *,
int,
diff --git a/gdb/ada-varobj.c b/gdb/ada-varobj.c
index a4d553d3786..b6ee5d57411 100644
--- a/gdb/ada-varobj.c
+++ b/gdb/ada-varobj.c
@@ -18,10 +18,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "ada-lang.h"
-#include "varobj.h"
#include "language.h"
#include "valprint.h"
+#include "varobj.h"
/* Implementation principle used in this unit:
diff --git a/gdb/addrmap.c b/gdb/addrmap.c
index 6c3ed6945fb..6a581ff2079 100644
--- a/gdb/addrmap.c
+++ b/gdb/addrmap.c
@@ -18,9 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "addrmap.h"
+
+/* Local non-gdb includes. */
#include "splay-tree.h"
+
+/* Local includes. */
#include "gdb_obstack.h"
-#include "addrmap.h"
/* The "abstract class". */
diff --git a/gdb/agent.c b/gdb/agent.c
index 8b777d0b3b7..63352339c3b 100644
--- a/gdb/agent.c
+++ b/gdb/agent.c
@@ -16,10 +16,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
+#include "common/agent.h"
+
+/* Local includes. */
#include "command.h"
#include "gdbcmd.h"
#include "target.h"
-#include "common/agent.h"
/* Enum strings for "set|show agent". */
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index ffa3352d039..2da526bc272 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -40,21 +40,24 @@
*/
#include "defs.h"
-#include "gdbthread.h"
-#include "target.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "gdbcmd.h"
-#include "ppc-tdep.h"
-#include "observable.h"
-#include "objfiles.h"
+/* Standard C includes. */
#include <procinfo.h>
-#include <sys/types.h>
-#include <sys/ptrace.h>
-#include <sys/reg.h>
#include <sched.h>
#include <sys/pthdebug.h>
+#include <sys/ptrace.h>
+#include <sys/reg.h>
+#include <sys/types.h>
+
+/* Local includes. */
+#include "gdbcmd.h"
+#include "gdbthread.h"
+#include "inferior.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "ppc-tdep.h"
+#include "regcache.h"
+#include "target.h"
#if !HAVE_DECL_GETTHRDS
extern int getthrds (pid_t, struct thrdsinfo64 *, int, tid_t *, int);
diff --git a/gdb/alpha-bsd-nat.c b/gdb/alpha-bsd-nat.c
index b12d19f3434..bb3ed9d092c 100644
--- a/gdb/alpha-bsd-nat.c
+++ b/gdb/alpha-bsd-nat.c
@@ -18,20 +18,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "alpha-tdep.h"
-#include "alpha-bsd-tdep.h"
-#include "inf-ptrace.h"
-
-#include <sys/types.h>
-#include <sys/ptrace.h>
+/* Standard C includes. */
#include <machine/reg.h>
-
#ifdef HAVE_SYS_PROCFS_H
#include <sys/procfs.h>
#endif
+#include <sys/ptrace.h>
+#include <sys/types.h>
+
+/* Local includes. */
+#include "alpha-bsd-tdep.h"
+#include "alpha-tdep.h"
+#include "inf-ptrace.h"
+#include "inferior.h"
+#include "regcache.h"
#ifndef HAVE_GREGSET_T
typedef struct reg gregset_t;
diff --git a/gdb/alpha-bsd-tdep.c b/gdb/alpha-bsd-tdep.c
index 350c197b0e1..1ae564326e4 100644
--- a/gdb/alpha-bsd-tdep.c
+++ b/gdb/alpha-bsd-tdep.c
@@ -18,10 +18,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "regcache.h"
+#include "alpha-bsd-tdep.h"
+/* Local includes. */
#include "alpha-tdep.h"
-#include "alpha-bsd-tdep.h"
+#include "regcache.h"
/* Conviently, GDB uses the same register numbering as the
ptrace register structure used by BSD on Alpha. */
diff --git a/gdb/alpha-linux-nat.c b/gdb/alpha-linux-nat.c
index 18806971a76..e80060c813e 100644
--- a/gdb/alpha-linux-nat.c
+++ b/gdb/alpha-linux-nat.c
@@ -17,17 +17,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
-#include "regcache.h"
-#include "linux-nat-trad.h"
-#include "alpha-tdep.h"
+/* Standard C includes. */
+#include <alpha/ptrace.h>
+#include <sys/procfs.h>
+/* Local subdirectory includes. */
#include "nat/gdb_ptrace.h"
-#include <alpha/ptrace.h>
-#include <sys/procfs.h>
+/* Local includes. */
+#include "alpha-tdep.h"
#include "gregset.h"
+#include "linux-nat-trad.h"
+#include "regcache.h"
+#include "target.h"
/* The address of UNIQUE for ptrace. */
#define ALPHA_UNIQUE_PTRACE_ADDR 65
diff --git a/gdb/alpha-linux-tdep.c b/gdb/alpha-linux-tdep.c
index bfa611e646f..33c91d56fe6 100644
--- a/gdb/alpha-linux-tdep.c
+++ b/gdb/alpha-linux-tdep.c
@@ -17,14 +17,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
+#include "alpha-tdep.h"
#include "frame.h"
+#include "linux-tdep.h"
#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
#include "solib-svr4.h"
#include "symtab.h"
-#include "regset.h"
-#include "regcache.h"
-#include "linux-tdep.h"
-#include "alpha-tdep.h"
/* This enum represents the signals' numbers on the Alpha
architecture. It just contains the signal definitions which are
diff --git a/gdb/alpha-mdebug-tdep.c b/gdb/alpha-mdebug-tdep.c
index caab08b1220..8dc8c34733b 100644
--- a/gdb/alpha-mdebug-tdep.c
+++ b/gdb/alpha-mdebug-tdep.c
@@ -17,16 +17,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "symtab.h"
-#include "gdbcore.h"
-#include "block.h"
-#include "trad-frame.h"
+/* Local includes. */
#include "alpha-tdep.h"
+#include "block.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcore.h"
#include "mdebugread.h"
+#include "symtab.h"
+#include "trad-frame.h"
/* FIXME: Some of this code should perhaps be merged with mips. */
diff --git a/gdb/alpha-nbsd-tdep.c b/gdb/alpha-nbsd-tdep.c
index 534b64687e3..1c312e63926 100644
--- a/gdb/alpha-nbsd-tdep.c
+++ b/gdb/alpha-nbsd-tdep.c
@@ -20,18 +20,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
+#include "alpha-bsd-tdep.h"
+#include "alpha-tdep.h"
#include "frame.h"
#include "gdbcore.h"
+#include "nbsd-tdep.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
-#include "value.h"
-
-#include "alpha-tdep.h"
-#include "alpha-bsd-tdep.h"
-#include "nbsd-tdep.h"
#include "solib-svr4.h"
#include "target.h"
+#include "value.h"
/* Core file support. */
diff --git a/gdb/alpha-obsd-tdep.c b/gdb/alpha-obsd-tdep.c
index d7e292603af..e41b535c45a 100644
--- a/gdb/alpha-obsd-tdep.c
+++ b/gdb/alpha-obsd-tdep.c
@@ -18,13 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
+#include "alpha-bsd-tdep.h"
+#include "alpha-tdep.h"
#include "frame.h"
#include "gdbcore.h"
-#include "osabi.h"
-
#include "obsd-tdep.h"
-#include "alpha-tdep.h"
-#include "alpha-bsd-tdep.h"
+#include "osabi.h"
#include "solib-svr4.h"
/* Signal trampolines. */
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index af9b9b97407..ff2834d2134 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -18,31 +18,35 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
+#include "alpha-tdep.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "elf-bfd.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "block.h"
#include "dwarf2-frame.h"
-#include "inferior.h"
-#include "symtab.h"
-#include "value.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcmd.h"
#include "gdbcore.h"
-#include "dis-asm.h"
-#include "symfile.h"
-#include "objfiles.h"
+#include "infcall.h"
+#include "inferior.h"
#include "linespec.h"
+#include "objfiles.h"
+#include "osabi.h"
#include "regcache.h"
#include "reggroups.h"
-#include "arch-utils.h"
-#include "osabi.h"
-#include "block.h"
-#include "infcall.h"
+#include "symfile.h"
+#include "symtab.h"
#include "trad-frame.h"
-
-#include "elf-bfd.h"
-
-#include "alpha-tdep.h"
-#include <algorithm>
+#include "value.h"
/* Instruction decoding. The notations for registers, immediates and
opcodes are the same as the one used in Compaq's Alpha architecture
diff --git a/gdb/amd64-bsd-nat.c b/gdb/amd64-bsd-nat.c
index 35763a5b955..75e8306b853 100644
--- a/gdb/amd64-bsd-nat.c
+++ b/gdb/amd64-bsd-nat.c
@@ -18,6 +18,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "amd64-bsd-nat.h"
+
+/* Local includes. */
#include "inferior.h"
#include "regcache.h"
#include "target.h"
diff --git a/gdb/amd64-darwin-tdep.c b/gdb/amd64-darwin-tdep.c
index 46867f40a38..aa9fea13866 100644
--- a/gdb/amd64-darwin-tdep.c
+++ b/gdb/amd64-darwin-tdep.c
@@ -19,24 +19,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "target.h"
-#include "symtab.h"
-#include "regcache.h"
-#include "objfiles.h"
+#include "amd64-darwin-tdep.h"
-#include "i387-tdep.h"
+/* Local subdirectory includes. */
#include "common/x86-xstate.h"
+
+/* Local includes. */
#include "amd64-tdep.h"
-#include "osabi.h"
-#include "ui-out.h"
-#include "amd64-darwin-tdep.h"
+#include "dwarf2-frame.h"
+#include "frame.h"
+#include "gdbcore.h"
#include "i386-darwin-tdep.h"
-#include "solib.h"
+#include "i387-tdep.h"
+#include "inferior.h"
+#include "objfiles.h"
+#include "osabi.h"
+#include "regcache.h"
#include "solib-darwin.h"
-#include "dwarf2-frame.h"
+#include "solib.h"
+#include "symtab.h"
+#include "target.h"
+#include "ui-out.h"
/* Offsets into the struct x86_thread_state64 where we'll find the saved regs.
From <mach/i386/thread_status.h> and amd64-tdep.h. */
diff --git a/gdb/amd64-dicos-tdep.c b/gdb/amd64-dicos-tdep.c
index 8ca838e3c83..ab8f31355e0 100644
--- a/gdb/amd64-dicos-tdep.c
+++ b/gdb/amd64-dicos-tdep.c
@@ -18,10 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
-#include "amd64-tdep.h"
+
+/* Local subdirectory includes. */
#include "common/x86-xstate.h"
+
+/* Local includes. */
+#include "amd64-tdep.h"
#include "dicos-tdep.h"
+#include "osabi.h"
static void
amd64_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
diff --git a/gdb/amd64-fbsd-nat.c b/gdb/amd64-fbsd-nat.c
index cc676d3214f..95e5da0bd9c 100644
--- a/gdb/amd64-fbsd-nat.c
+++ b/gdb/amd64-fbsd-nat.c
@@ -18,23 +18,28 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "target.h"
+/* Standard C includes. */
+#include <machine/reg.h>
#include <signal.h>
-#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/sysctl.h>
+#include <sys/types.h>
#include <sys/user.h>
-#include <machine/reg.h>
-#include "fbsd-nat.h"
-#include "amd64-tdep.h"
-#include "amd64-nat.h"
+/* Local subdirectory includes. */
+#include "common/x86-xstate.h"
+
+/* Local includes. */
#include "amd64-bsd-nat.h"
+#include "amd64-nat.h"
+#include "amd64-tdep.h"
+#include "fbsd-nat.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "target.h"
#include "x86-nat.h"
-#include "common/x86-xstate.h"
+
class amd64_fbsd_nat_target final
diff --git a/gdb/amd64-fbsd-tdep.c b/gdb/amd64-fbsd-tdep.c
index 7e2e9edf21d..b949d52f6c0 100644
--- a/gdb/amd64-fbsd-tdep.c
+++ b/gdb/amd64-fbsd-tdep.c
@@ -18,17 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
+#include "common/x86-xstate.h"
+
+/* Local includes. */
+#include "amd64-tdep.h"
#include "arch-utils.h"
+#include "fbsd-tdep.h"
#include "frame.h"
#include "gdbcore.h"
-#include "regcache.h"
+#include "i386-fbsd-tdep.h"
#include "osabi.h"
+#include "regcache.h"
#include "regset.h"
-#include "i386-fbsd-tdep.h"
-#include "common/x86-xstate.h"
-
-#include "amd64-tdep.h"
-#include "fbsd-tdep.h"
#include "solib-svr4.h"
/* Support for signal handlers. */
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index a0bb105f5aa..72d5384d90a 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -19,25 +19,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "elf/common.h"
-#include <sys/uio.h>
-#include "nat/gdb_ptrace.h"
+
+/* Standard C includes. */
#include <asm/prctl.h>
#include <sys/reg.h>
-#include "gregset.h"
-#include "gdb_proc_service.h"
+#include <sys/uio.h>
+
+/* Local non-gdb includes. */
+#include "elf/common.h"
+
+/* Local subdirectory includes. */
+#include "common/x86-xstate.h"
+#include "nat/amd64-linux-siginfo.h"
+#include "nat/gdb_ptrace.h"
+#include "nat/linux-ptrace.h"
+/* Local includes. */
+#include "amd64-linux-tdep.h"
#include "amd64-nat.h"
#include "amd64-tdep.h"
-#include "amd64-linux-tdep.h"
+#include "gdb_proc_service.h"
+#include "gregset.h"
#include "i386-linux-tdep.h"
-#include "common/x86-xstate.h"
-
+#include "inferior.h"
+#include "regcache.h"
#include "x86-linux-nat.h"
-#include "nat/linux-ptrace.h"
-#include "nat/amd64-linux-siginfo.h"
/* This definition comes from prctl.h. Kernels older than 2.5.64
do not have it. */
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 21fc3461ec3..87b8de249df 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -19,28 +19,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "amd64-linux-tdep.h"
+
+/* Local subdirectory includes. */
+#include "arch/amd64.h"
+#include "common/x86-xstate.h"
+
+/* Local includes. */
+#include "amd64-tdep.h"
#include "arch-utils.h"
#include "frame.h"
#include "gdbcore.h"
-#include "regcache.h"
-#include "osabi.h"
-#include "symtab.h"
#include "gdbtypes.h"
-#include "reggroups.h"
-#include "regset.h"
-#include "parser-defs.h"
-#include "user-regs.h"
-#include "amd64-linux-tdep.h"
+#include "glibc-tdep.h"
#include "i386-linux-tdep.h"
#include "linux-tdep.h"
-#include "common/x86-xstate.h"
-
-#include "amd64-tdep.h"
+#include "osabi.h"
+#include "parser-defs.h"
+#include "regcache.h"
+#include "reggroups.h"
+#include "regset.h"
#include "solib-svr4.h"
-#include "xml-syscall.h"
-#include "glibc-tdep.h"
-#include "arch/amd64.h"
+#include "symtab.h"
#include "target-descriptions.h"
+#include "user-regs.h"
+#include "xml-syscall.h"
/* The syscall's XML filename for i386. */
#define XML_SYSCALL_FILENAME_AMD64 "syscalls/amd64-linux.xml"
diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c
index 3dcac73d88a..33860df77f8 100644
--- a/gdb/amd64-nat.c
+++ b/gdb/amd64-nat.c
@@ -18,12 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbarch.h"
-#include "regcache.h"
+#include "amd64-nat.h"
-#include "i386-tdep.h"
+/* Local includes. */
#include "amd64-tdep.h"
-#include "amd64-nat.h"
+#include "gdbarch.h"
+#include "i386-tdep.h"
+#include "regcache.h"
/* The following bits of code help with implementing debugging 32-bit
code natively on AMD64. The idea is to define two mappings between
diff --git a/gdb/amd64-nbsd-nat.c b/gdb/amd64-nbsd-nat.c
index 24e3aae7ecb..17196020ecf 100644
--- a/gdb/amd64-nbsd-nat.c
+++ b/gdb/amd64-nbsd-nat.c
@@ -18,12 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
-#include "nbsd-nat.h"
-#include "amd64-tdep.h"
+/* Local includes. */
#include "amd64-bsd-nat.h"
#include "amd64-nat.h"
+#include "amd64-tdep.h"
+#include "nbsd-nat.h"
+#include "target.h"
/* Mapping between the general-purpose registers in NetBSD/amd64
`struct reg' format and GDB's register cache layout for
diff --git a/gdb/amd64-nbsd-tdep.c b/gdb/amd64-nbsd-tdep.c
index 06905d65dfd..041200a5492 100644
--- a/gdb/amd64-nbsd-tdep.c
+++ b/gdb/amd64-nbsd-tdep.c
@@ -18,16 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
+#include "common/x86-xstate.h"
+
+/* Local includes. */
+#include "amd64-tdep.h"
#include "arch-utils.h"
#include "frame.h"
#include "gdbcore.h"
-#include "osabi.h"
-#include "symtab.h"
-
-#include "amd64-tdep.h"
-#include "common/x86-xstate.h"
#include "nbsd-tdep.h"
+#include "osabi.h"
#include "solib-svr4.h"
+#include "symtab.h"
/* Support for signal handlers. */
diff --git a/gdb/amd64-obsd-nat.c b/gdb/amd64-obsd-nat.c
index 4963c42d06c..811352ff4aa 100644
--- a/gdb/amd64-obsd-nat.c
+++ b/gdb/amd64-obsd-nat.c
@@ -18,14 +18,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "target.h"
-#include "amd64-tdep.h"
+/* Local includes. */
#include "amd64-bsd-nat.h"
#include "amd64-nat.h"
+#include "amd64-tdep.h"
+#include "gdbcore.h"
#include "obsd-nat.h"
+#include "regcache.h"
+#include "target.h"
/* Mapping between the general-purpose registers in OpenBSD/amd64
`struct reg' format and GDB's register cache layout for
diff --git a/gdb/amd64-obsd-tdep.c b/gdb/amd64-obsd-tdep.c
index cd1a1c31b88..f50e673f7f6 100644
--- a/gdb/amd64-obsd-tdep.c
+++ b/gdb/amd64-obsd-tdep.c
@@ -18,24 +18,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
+
+/* Local subdirectory includes. */
+#include "common/x86-xstate.h"
+
+/* Local includes. */
+#include "amd64-tdep.h"
+#include "bsd-uthread.h"
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
-#include "symtab.h"
+#include "i387-tdep.h"
#include "objfiles.h"
+#include "obsd-tdep.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
+#include "solib-svr4.h"
+#include "symtab.h"
#include "target.h"
#include "trad-frame.h"
-#include "obsd-tdep.h"
-#include "amd64-tdep.h"
-#include "i387-tdep.h"
-#include "common/x86-xstate.h"
-#include "solib-svr4.h"
-#include "bsd-uthread.h"
-
/* Support for signal handlers. */
/* Default page size. */
diff --git a/gdb/amd64-sol2-tdep.c b/gdb/amd64-sol2-tdep.c
index 56d2e225822..d04e8866aa6 100644
--- a/gdb/amd64-sol2-tdep.c
+++ b/gdb/amd64-sol2-tdep.c
@@ -20,16 +20,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
+#include "common/x86-xstate.h"
+
+/* Local includes. */
+#include "amd64-tdep.h"
#include "frame.h"
#include "gdbcore.h"
-#include "regcache.h"
#include "osabi.h"
-#include "symtab.h"
-
+#include "regcache.h"
#include "sol2-tdep.h"
-#include "amd64-tdep.h"
-#include "common/x86-xstate.h"
#include "solib-svr4.h"
+#include "symtab.h"
/* Mapping between the general-purpose registers in gregset_t format
and GDB's register cache layout. */
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index d5892954d74..a3d55d755ca 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -20,34 +20,42 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "opcode/i386.h"
+#include "amd64-tdep.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "dis-asm.h"
+#include "opcode/i386.h"
+
+/* Local subdirectory includes. */
+#include "arch/amd64.h"
+#include "common/byte-vector.h"
+#include "common/x86-xstate.h"
+
+/* Local includes. */
#include "arch-utils.h"
+#include "ax-gdb.h"
+#include "ax.h"
#include "block.h"
+#include "disasm.h"
#include "dummy-frame.h"
-#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
-#include "inferior.h"
-#include "infrun.h"
+#include "frame.h"
#include "gdbcmd.h"
#include "gdbcore.h"
+#include "i387-tdep.h"
+#include "inferior.h"
+#include "infrun.h"
#include "objfiles.h"
+#include "osabi.h"
+#include "producer.h"
#include "regcache.h"
#include "regset.h"
#include "symfile.h"
-#include "disasm.h"
-#include "amd64-tdep.h"
-#include "i387-tdep.h"
-#include "common/x86-xstate.h"
-#include <algorithm>
#include "target-descriptions.h"
-#include "arch/amd64.h"
-#include "producer.h"
-#include "ax.h"
-#include "ax-gdb.h"
-#include "common/byte-vector.h"
-#include "osabi.h"
#include "x86-tdep.h"
/* Note that the AMD64 architecture was previously known as x86-64.
diff --git a/gdb/amd64-windows-nat.c b/gdb/amd64-windows-nat.c
index 378262a56e3..12ec6318ea3 100644
--- a/gdb/amd64-windows-nat.c
+++ b/gdb/amd64-windows-nat.c
@@ -16,12 +16,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "windows-nat.h"
-#include "x86-nat.h"
-#include "amd64-tdep.h"
+/* Standard C includes. */
#include <windows.h>
+/* Local includes. */
+#include "amd64-tdep.h"
+#include "windows-nat.h"
+#include "x86-nat.h"
+
#define context_offset(x) (offsetof (CONTEXT, x))
static const int mappings[] =
{
diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c
index 922da9e48bc..3b987381400 100644
--- a/gdb/amd64-windows-tdep.c
+++ b/gdb/amd64-windows-tdep.c
@@ -16,22 +16,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
-#include "amd64-tdep.h"
-#include "common/x86-xstate.h"
-#include "gdbtypes.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "windows-tdep.h"
-#include "frame.h"
-#include "objfiles.h"
-#include "frame-unwind.h"
-#include "coff/internal.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "coff/i386.h"
+#include "coff/internal.h"
#include "coff/pe.h"
#include "libcoff.h"
+
+/* Local subdirectory includes. */
+#include "common/x86-xstate.h"
+
+/* Local includes. */
+#include "amd64-tdep.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "objfiles.h"
+#include "osabi.h"
+#include "regcache.h"
#include "value.h"
-#include <algorithm>
+#include "windows-tdep.h"
/* The registers used to pass integer arguments during a function call. */
static int amd64_windows_dummy_call_integer_regs[] =
diff --git a/gdb/annotate.c b/gdb/annotate.c
index 97cb4c8855d..b1e74c71c39 100644
--- a/gdb/annotate.c
+++ b/gdb/annotate.c
@@ -18,14 +18,17 @@
#include "defs.h"
#include "annotate.h"
-#include "value.h"
-#include "target.h"
-#include "gdbtypes.h"
+
+/* Local includes. */
#include "breakpoint.h"
-#include "observable.h"
+#include "gdbtypes.h"
#include "inferior.h"
#include "infrun.h"
+#include "observable.h"
+#include "target.h"
#include "top.h"
+#include "value.h"
+
/* Prototypes for local functions. */
diff --git a/gdb/annotate.h b/gdb/annotate.h
index 4a9e1b58f28..b55dffeb072 100644
--- a/gdb/annotate.h
+++ b/gdb/annotate.h
@@ -19,8 +19,8 @@
#ifndef ANNOTATE_H
#define ANNOTATE_H
-#include "symtab.h"
#include "gdbtypes.h"
+#include "symtab.h"
extern void annotate_breakpoint (int);
extern void annotate_catchpoint (int);
diff --git a/gdb/arc-newlib-tdep.c b/gdb/arc-newlib-tdep.c
index 5fa4094def8..cf22904a3d8 100644
--- a/gdb/arc-newlib-tdep.c
+++ b/gdb/arc-newlib-tdep.c
@@ -20,8 +20,9 @@
#include "defs.h"
-#include "gdbarch.h"
+/* Local includes. */
#include "arc-tdep.h"
+#include "gdbarch.h"
#include "osabi.h"
/* Implement the 'init_osabi' method of struct gdb_osabi_handler. */
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index 009af1190a5..cd39119a708 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -20,13 +20,16 @@
/* GDB header files. */
#include "defs.h"
+#include "arc-tdep.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "disasm.h"
#include "dwarf2-frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
-#include "gdbcore.h"
#include "gdbcmd.h"
+#include "gdbcore.h"
#include "objfiles.h"
#include "prologue-value.h"
#include "trad-frame.h"
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 52a08daa3b9..b19299d6a8a 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -18,25 +18,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-
#include "arch-utils.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "floatformat.h"
+
+/* Local subdirectory includes. */
+#include "common/version.h"
+
+/* Local includes. */
#include "gdbcmd.h"
-#include "inferior.h" /* enum CALL_DUMMY_LOCATION et al. */
+#include "gdbcore.h"
+#include "inferior.h"
#include "infrun.h"
+#include "language.h"
+#include "objfiles.h"
+#include "osabi.h"
#include "regcache.h"
#include "sim-regno.h"
-#include "gdbcore.h"
-#include "osabi.h"
-#include "target-descriptions.h"
-#include "objfiles.h"
-#include "language.h"
#include "symtab.h"
-
-#include "common/version.h"
-
-#include "floatformat.h"
-
-#include "dis-asm.h"
+#include "target-descriptions.h"
int
default_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
diff --git a/gdb/arch/aarch64-insn.c b/gdb/arch/aarch64-insn.c
index cf6e669f99c..15b7d614510 100644
--- a/gdb/arch/aarch64-insn.c
+++ b/gdb/arch/aarch64-insn.c
@@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "aarch64-insn.h"
+#include "arch/aarch64-insn.h"
/* Toggle this file's internal debugging dump. */
int aarch64_debug = 0;
diff --git a/gdb/arch/aarch64.c b/gdb/arch/aarch64.c
index 11a15dd94cb..9d17a39e6d7 100644
--- a/gdb/arch/aarch64.c
+++ b/gdb/arch/aarch64.c
@@ -16,13 +16,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "aarch64.h"
+#include "arch/aarch64.h"
+
+/* Standard C includes. */
#include <stdlib.h>
+/* Local non-gdb includes. */
#include "../features/aarch64-core.c"
#include "../features/aarch64-fpu.c"
-#include "../features/aarch64-sve.c"
#include "../features/aarch64-pauth.c"
+#include "../features/aarch64-sve.c"
/* See arch/aarch64.h. */
diff --git a/gdb/arch/amd64.c b/gdb/arch/amd64.c
index b7e6332d773..4ec32da1a54 100644
--- a/gdb/arch/amd64.c
+++ b/gdb/arch/amd64.c
@@ -16,10 +16,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "amd64.h"
-#include "common/x86-xstate.h"
+#include "arch/amd64.h"
+
+/* Standard C includes. */
#include <stdlib.h>
+/* Local non-gdb includes. */
#include "../features/i386/64bit-avx.c"
#include "../features/i386/64bit-avx512.c"
#include "../features/i386/64bit-core.c"
@@ -28,9 +30,11 @@
#include "../features/i386/64bit-pkeys.c"
#include "../features/i386/64bit-segments.c"
#include "../features/i386/64bit-sse.c"
-
#include "../features/i386/x32-core.c"
+/* Local subdirectory includes. */
+#include "common/x86-xstate.h"
+
/* Create amd64 target descriptions according to XCR0. If IS_X32 is
true, create the x32 ones. If IS_LINUX is true, create target
descriptions for Linux. If SEGMENTS is true, then include
diff --git a/gdb/arch/amd64.h b/gdb/arch/amd64.h
index 1e02c5235f1..3d7530a966e 100644
--- a/gdb/arch/amd64.h
+++ b/gdb/arch/amd64.h
@@ -18,9 +18,11 @@
#ifndef ARCH_AMD64_H
#define ARCH_AMD64_H
-#include "common/tdesc.h"
#include <stdint.h>
+/* Local subdirectory includes. */
+#include "common/tdesc.h"
+
target_desc *amd64_create_target_description (uint64_t xcr0, bool is_x32,
bool is_linux, bool segments);
diff --git a/gdb/arch/arm-get-next-pcs.c b/gdb/arch/arm-get-next-pcs.c
index 06b3f2c9926..641c4409dd2 100644
--- a/gdb/arch/arm-get-next-pcs.c
+++ b/gdb/arch/arm-get-next-pcs.c
@@ -18,10 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "common/gdb_vecs.h"
-#include "common/common-regcache.h"
+#include "arch/arm-get-next-pcs.h"
+
+/* Local non-gdb includes. */
#include "arm.h"
-#include "arm-get-next-pcs.h"
+
+/* Local subdirectory includes. */
+#include "common/common-regcache.h"
+#include "common/gdb_vecs.h"
/* See arm-get-next-pcs.h. */
diff --git a/gdb/arch/arm-linux.c b/gdb/arch/arm-linux.c
index a399f3e71c1..9e9690cf87d 100644
--- a/gdb/arch/arm-linux.c
+++ b/gdb/arch/arm-linux.c
@@ -18,10 +18,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "common/common-regcache.h"
-#include "arch/arm.h"
-#include "arm-linux.h"
+#include "arch/arm-linux.h"
+
+/* Local subdirectory includes. */
#include "arch/arm-get-next-pcs.h"
+#include "arch/arm.h"
+#include "common/common-regcache.h"
/* Calculate the offset from stack pointer of the pc register on the stack
in the case of a sigreturn or sigreturn_rt syscall. */
diff --git a/gdb/arch/arm.c b/gdb/arch/arm.c
index 93738f0a0f8..d696562a725 100644
--- a/gdb/arch/arm.c
+++ b/gdb/arch/arm.c
@@ -18,8 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
+#include "arch/arm.h"
+
+/* Local subdirectory includes. */
#include "common/common-regcache.h"
-#include "arm.h"
/* See arm.h. */
diff --git a/gdb/arch/i386.c b/gdb/arch/i386.c
index ab24cf71cb5..bb1c4496425 100644
--- a/gdb/arch/i386.c
+++ b/gdb/arch/i386.c
@@ -16,19 +16,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "i386.h"
-#include "common/tdesc.h"
-#include "common/x86-xstate.h"
+#include "arch/i386.h"
+
+/* Standard C includes. */
#include <stdlib.h>
-#include "../features/i386/32bit-core.c"
-#include "../features/i386/32bit-linux.c"
-#include "../features/i386/32bit-sse.c"
+/* Local non-gdb includes. */
#include "../features/i386/32bit-avx.c"
#include "../features/i386/32bit-avx512.c"
+#include "../features/i386/32bit-core.c"
+#include "../features/i386/32bit-linux.c"
#include "../features/i386/32bit-mpx.c"
#include "../features/i386/32bit-pkeys.c"
#include "../features/i386/32bit-segments.c"
+#include "../features/i386/32bit-sse.c"
+
+/* Local subdirectory includes. */
+#include "common/tdesc.h"
+#include "common/x86-xstate.h"
/* Create i386 target descriptions according to XCR0. */
diff --git a/gdb/arch/i386.h b/gdb/arch/i386.h
index 9a831cea300..339fad75fc3 100644
--- a/gdb/arch/i386.h
+++ b/gdb/arch/i386.h
@@ -18,9 +18,11 @@
#ifndef ARCH_I386_H
#define ARCH_I386_H
-#include "common/tdesc.h"
#include <stdint.h>
+/* Local subdirectory includes. */
+#include "common/tdesc.h"
+
target_desc *i386_create_target_description (uint64_t xcr0, bool is_linux,
bool segments);
diff --git a/gdb/arch/ppc-linux-common.c b/gdb/arch/ppc-linux-common.c
index 6badd2f7d26..121938167ab 100644
--- a/gdb/arch/ppc-linux-common.c
+++ b/gdb/arch/ppc-linux-common.c
@@ -19,6 +19,8 @@
#include "common/common-defs.h"
#include "arch/ppc-linux-common.h"
+
+/* Local subdirectory includes. */
#include "arch/ppc-linux-tdesc.h"
/* Decimal Floating Point bit in AT_HWCAP.
diff --git a/gdb/arch/riscv.c b/gdb/arch/riscv.c
index 5ed1d47ac51..ef383e0b9eb 100644
--- a/gdb/arch/riscv.c
+++ b/gdb/arch/riscv.c
@@ -16,13 +16,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "riscv.h"
+#include "arch/riscv.h"
+
+/* Standard C includes. */
#include <stdlib.h>
+
+/* Standard C++ includes. */
#include <unordered_map>
+/* Local non-gdb includes. */
#include "../features/riscv/32bit-cpu.c"
-#include "../features/riscv/64bit-cpu.c"
#include "../features/riscv/32bit-fpu.c"
+#include "../features/riscv/64bit-cpu.c"
#include "../features/riscv/64bit-fpu.c"
/* Wrapper used by std::unordered_map to generate hash for feature set. */
diff --git a/gdb/arch/tic6x.c b/gdb/arch/tic6x.c
index dd2257c97a4..535a7566220 100644
--- a/gdb/arch/tic6x.c
+++ b/gdb/arch/tic6x.c
@@ -15,13 +15,16 @@
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 "common/tdesc.h"
-#include "tic6x.h"
#include "common/common-defs.h"
+#include "arch/tic6x.h"
+/* Local non-gdb includes. */
+#include "../features/tic6x-c6xp.c"
#include "../features/tic6x-core.c"
#include "../features/tic6x-gp.c"
-#include "../features/tic6x-c6xp.c"
+
+/* Local subdirectory includes. */
+#include "common/tdesc.h"
/* Create tic6x target descriptions according to FEATURE. */
diff --git a/gdb/arm-bsd-tdep.c b/gdb/arm-bsd-tdep.c
index 13894c4b14b..a6468a3eaa1 100644
--- a/gdb/arm-bsd-tdep.c
+++ b/gdb/arm-bsd-tdep.c
@@ -18,12 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
+#include "arm-tdep.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
-#include "arm-tdep.h"
-
/* Core file support. */
/* Sizeof `struct reg' in <machine/reg.h>. */
diff --git a/gdb/arm-fbsd-nat.c b/gdb/arm-fbsd-nat.c
index f85ecc17c05..bf03faa1b71 100644
--- a/gdb/arm-fbsd-nat.c
+++ b/gdb/arm-fbsd-nat.c
@@ -18,16 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
+/* Standard C includes. */
#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
-#include "fbsd-nat.h"
-#include "arm-tdep.h"
+/* Local includes. */
#include "arm-fbsd-tdep.h"
+#include "arm-tdep.h"
+#include "fbsd-nat.h"
#include "inf-ptrace.h"
+#include "target.h"
struct arm_fbsd_nat_target : public fbsd_nat_target
{
diff --git a/gdb/arm-fbsd-tdep.c b/gdb/arm-fbsd-tdep.c
index dea3abbdd36..b14df962ac1 100644
--- a/gdb/arm-fbsd-tdep.c
+++ b/gdb/arm-fbsd-tdep.c
@@ -18,10 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "arm-fbsd-tdep.h"
+/* Local non-gdb includes. */
#include "elf/common.h"
+
+/* Local includes. */
#include "arm-tdep.h"
-#include "arm-fbsd-tdep.h"
#include "auxv.h"
#include "fbsd-tdep.h"
#include "gdbcore.h"
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index 52668da9fcf..3502f598b28 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -17,28 +17,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "target.h"
-#include "linux-nat.h"
-#include "target-descriptions.h"
-#include "auxv.h"
-#include "observable.h"
-#include "gdbthread.h"
-
-#include "arm-tdep.h"
-#include "arm-linux-tdep.h"
-#include "aarch32-linux-nat.h"
+/* Standard C includes. */
#include <elf/common.h>
+#include <sys/procfs.h>
#include <sys/user.h>
-#include "nat/gdb_ptrace.h"
#include <sys/utsname.h>
-#include <sys/procfs.h>
+/* Local subdirectory includes. */
+#include "nat/gdb_ptrace.h"
#include "nat/linux-ptrace.h"
+
+/* Local includes. */
+#include "aarch32-linux-nat.h"
+#include "arm-linux-tdep.h"
+#include "arm-tdep.h"
+#include "auxv.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "inferior.h"
+#include "linux-nat.h"
#include "linux-tdep.h"
+#include "observable.h"
+#include "regcache.h"
+#include "target-descriptions.h"
+#include "target.h"
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index a5ad06434c2..9546bfb0504 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -18,43 +18,49 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
-#include "value.h"
-#include "gdbtypes.h"
-#include "gdbcore.h"
-#include "frame.h"
-#include "regcache.h"
-#include "solib-svr4.h"
-#include "osabi.h"
-#include "regset.h"
-#include "trad-frame.h"
-#include "tramp-frame.h"
-#include "breakpoint.h"
-#include "auxv.h"
-#include "xml-syscall.h"
+#include "arm-linux-tdep.h"
-#include "arch/arm.h"
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
+#include "elf/common.h"
+
+/* Local subdirectory includes. */
#include "arch/arm-get-next-pcs.h"
#include "arch/arm-linux.h"
+#include "arch/arm.h"
+#include "cli/cli-utils.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "arm-tdep.h"
-#include "arm-linux-tdep.h"
-#include "linux-tdep.h"
+#include "auxv.h"
+#include "breakpoint.h"
+#include "frame.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "gdbtypes.h"
#include "glibc-tdep.h"
-#include "arch-utils.h"
#include "inferior.h"
#include "infrun.h"
-#include "gdbthread.h"
-#include "symfile.h"
-
-#include "record-full.h"
#include "linux-record.h"
-
-#include "cli/cli-utils.h"
-#include "stap-probe.h"
+#include "linux-tdep.h"
+#include "osabi.h"
#include "parser-defs.h"
+#include "record-full.h"
+#include "regcache.h"
+#include "regset.h"
+#include "solib-svr4.h"
+#include "stap-probe.h"
+#include "symfile.h"
+#include "target.h"
+#include "trad-frame.h"
+#include "tramp-frame.h"
#include "user-regs.h"
-#include <ctype.h>
-#include "elf/common.h"
+#include "value.h"
+#include "xml-syscall.h"
+
extern int arm_apcs_32;
/* Under ARM GNU/Linux the traditional way of performing a breakpoint
diff --git a/gdb/arm-nbsd-nat.c b/gdb/arm-nbsd-nat.c
index 2a83553a3fe..2a9fef4cd9d 100644
--- a/gdb/arm-nbsd-nat.c
+++ b/gdb/arm-nbsd-nat.c
@@ -18,17 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "target.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
-#include <machine/reg.h>
+
+/* Standard C includes. */
#include <machine/frame.h>
+#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
+/* Local includes. */
#include "arm-tdep.h"
+#include "gdbcore.h"
#include "inf-ptrace.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "target.h"
class arm_netbsd_nat_target final : public inf_ptrace_target
{
diff --git a/gdb/arm-nbsd-tdep.c b/gdb/arm-nbsd-tdep.c
index 6b782300920..154039c549f 100644
--- a/gdb/arm-nbsd-tdep.c
+++ b/gdb/arm-nbsd-tdep.c
@@ -18,10 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
+/* Local subdirectory includes. */
#include "arch/arm.h"
+
+/* Local includes. */
#include "arm-tdep.h"
+#include "osabi.h"
#include "solib-svr4.h"
/* Description of the longjmp buffer. */
diff --git a/gdb/arm-obsd-tdep.c b/gdb/arm-obsd-tdep.c
index a6055ab171d..f5c57d403c1 100644
--- a/gdb/arm-obsd-tdep.c
+++ b/gdb/arm-obsd-tdep.c
@@ -18,13 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
-#include "trad-frame.h"
-#include "tramp-frame.h"
-#include "obsd-tdep.h"
+/* Local includes. */
#include "arm-tdep.h"
+#include "obsd-tdep.h"
+#include "osabi.h"
#include "solib-svr4.h"
+#include "trad-frame.h"
+#include "tramp-frame.h"
/* Signal trampolines. */
diff --git a/gdb/arm-pikeos-tdep.c b/gdb/arm-pikeos-tdep.c
index 21add740a40..da36fa7c151 100644
--- a/gdb/arm-pikeos-tdep.c
+++ b/gdb/arm-pikeos-tdep.c
@@ -16,8 +16,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "objfiles.h"
+
+/* Local includes. */
#include "arm-tdep.h"
+#include "objfiles.h"
#include "osabi.h"
/* The gdbarch_register_osabi handler for ARM PikeOS; it performs
diff --git a/gdb/arm-symbian-tdep.c b/gdb/arm-symbian-tdep.c
index 71521de7a91..d890934127d 100644
--- a/gdb/arm-symbian-tdep.c
+++ b/gdb/arm-symbian-tdep.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 "elf-bfd.h"
+
+/* Local includes. */
#include "frame.h"
#include "objfiles.h"
#include "osabi.h"
-#include "solib.h"
#include "solib-target.h"
+#include "solib.h"
#include "target.h"
-#include "elf-bfd.h"
/* If PC is in a DLL import stub, return the address of the `real'
function belonging to the stub. */
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 599f785b349..5b12a40bb69 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -18,56 +18,59 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "arm-tdep.h"
-#include <ctype.h> /* XXX for isupper (). */
-
-#include "frame.h"
-#include "inferior.h"
-#include "infrun.h"
-#include "gdbcmd.h"
-#include "gdbcore.h"
-#include "dis-asm.h" /* For register styles. */
-#include "disasm.h"
-#include "regcache.h"
-#include "reggroups.h"
-#include "target-float.h"
-#include "value.h"
-#include "arch-utils.h"
-#include "osabi.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "trad-frame.h"
-#include "objfiles.h"
-#include "dwarf2-frame.h"
-#include "gdbtypes.h"
-#include "prologue-value.h"
-#include "remote.h"
-#include "target-descriptions.h"
-#include "user-regs.h"
-#include "observable.h"
+/* Standard C includes. */
+#include <ctype.h>
-#include "arch/arm.h"
-#include "arch/arm-get-next-pcs.h"
-#include "arm-tdep.h"
-#include "gdb/sim-arm.h"
+/* Standard C++ includes. */
+#include <algorithm>
-#include "elf-bfd.h"
+/* Local non-gdb includes. */
#include "coff/internal.h"
+#include "dis-asm.h"
+#include "elf-bfd.h"
#include "elf/arm.h"
+#include "gdb/sim-arm.h"
+/* Local subdirectory includes. */
+#include "arch/arm-get-next-pcs.h"
+#include "arch/arm.h"
#include "common/vec.h"
-
-#include "record.h"
-#include "record-full.h"
-#include <algorithm>
-
-#include "features/arm/arm-with-m.c"
+#include "features/arm/arm-with-iwmmxt.c"
#include "features/arm/arm-with-m-fpa-layout.c"
#include "features/arm/arm-with-m-vfp-d16.c"
-#include "features/arm/arm-with-iwmmxt.c"
+#include "features/arm/arm-with-m.c"
+#include "features/arm/arm-with-neon.c"
#include "features/arm/arm-with-vfpv2.c"
#include "features/arm/arm-with-vfpv3.c"
-#include "features/arm/arm-with-neon.c"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "disasm.h"
+#include "dwarf2-frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "inferior.h"
+#include "infrun.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "osabi.h"
+#include "prologue-value.h"
+#include "record-full.h"
+#include "record.h"
+#include "regcache.h"
+#include "reggroups.h"
+#include "remote.h"
+#include "target-descriptions.h"
+#include "target-float.h"
+#include "trad-frame.h"
+#include "user-regs.h"
+#include "value.h"
#if GDB_SELF_TEST
#include "common/selftest.h"
diff --git a/gdb/arm-wince-tdep.c b/gdb/arm-wince-tdep.c
index 6eae60e8a7f..13db7a462fd 100644
--- a/gdb/arm-wince-tdep.c
+++ b/gdb/arm-wince-tdep.c
@@ -19,13 +19,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
-#include "gdbcore.h"
-#include "target.h"
-#include "frame.h"
+/* Local subdirectory includes. */
#include "arch/arm.h"
+
+/* Local includes. */
#include "arm-tdep.h"
+#include "frame.h"
+#include "gdbcore.h"
+#include "osabi.h"
+#include "target.h"
#include "windows-tdep.h"
static const gdb_byte arm_wince_le_breakpoint[] = { 0x10, 0x00, 0x00, 0xe6 };
diff --git a/gdb/auto-load.c b/gdb/auto-load.c
index ae7a189dc04..aaf03773c7c 100644
--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -18,30 +18,40 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include <ctype.h>
#include "auto-load.h"
-#include "progspace.h"
-#include "gdb_regex.h"
-#include "ui-out.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "filenames.h"
-#include "command.h"
-#include "observable.h"
-#include "objfiles.h"
-#include "cli/cli-script.h"
-#include "gdbcmd.h"
+#include "fnmatch.h"
+#include "gdb/section-scripts.h"
+#include "readline/tilde.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-cmds.h"
#include "cli/cli-decode.h"
+#include "cli/cli-script.h"
#include "cli/cli-setshow.h"
-#include "readline/tilde.h"
-#include "completer.h"
-#include "fnmatch.h"
-#include "top.h"
#include "common/filestuff.h"
-#include "extension.h"
-#include "gdb/section-scripts.h"
-#include <algorithm>
#include "common/pathstuff.h"
+/* Local includes. */
+#include "command.h"
+#include "completer.h"
+#include "extension.h"
+#include "gdb_regex.h"
+#include "gdbcmd.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "progspace.h"
+#include "top.h"
+#include "ui-out.h"
+
/* The section to look in for auto-loaded scripts (in file formats that
support sections).
Each entry in this section is a record that begins with a leading byte
diff --git a/gdb/auxv.c b/gdb/auxv.c
index 13caa936651..c8668a94330 100644
--- a/gdb/auxv.c
+++ b/gdb/auxv.c
@@ -18,21 +18,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
-#include "gdbtypes.h"
-#include "command.h"
-#include "inferior.h"
-#include "valprint.h"
-#include "gdbcore.h"
-#include "observable.h"
-#include "common/filestuff.h"
-#include "objfiles.h"
-
#include "auxv.h"
-#include "elf/common.h"
-#include <unistd.h>
+/* Standard C includes. */
#include <fcntl.h>
+#include <unistd.h>
+
+/* Local non-gdb includes. */
+#include "elf/common.h"
+
+/* Local subdirectory includes. */
+#include "common/filestuff.h"
+
+/* Local includes. */
+#include "command.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "inferior.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "target.h"
+#include "valprint.h"
/* Implement the to_xfer_partial target_ops method. This function
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 6d11ee1618c..f6a5f40623a 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -23,20 +23,26 @@
by Denis Chertykov, denisc@overta.ru */
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "frame-base.h"
-#include "trad-frame.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcmd.h"
#include "gdbcore.h"
#include "gdbtypes.h"
#include "inferior.h"
-#include "symfile.h"
-#include "arch-utils.h"
-#include "regcache.h"
-#include "dis-asm.h"
#include "objfiles.h"
-#include <algorithm>
+#include "regcache.h"
+#include "symfile.h"
+#include "trad-frame.h"
/* AVR Background:
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 778e89515b6..f92c612c7cc 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -18,35 +18,38 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "gdbtypes.h"
-#include "language.h"
-#include "value.h"
-#include "expression.h"
-#include "command.h"
-#include "gdbcmd.h"
-#include "frame.h"
-#include "target.h"
-#include "ax.h"
#include "ax-gdb.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+#include "common/format.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "ax.h"
#include "block.h"
-#include "regcache.h"
-#include "user-regs.h"
-#include "dictionary.h"
#include "breakpoint.h"
-#include "tracepoint.h"
+#include "c-lang.h"
+#include "command.h"
#include "cp-support.h"
-#include "arch-utils.h"
-#include "cli/cli-utils.h"
+#include "dictionary.h"
+#include "expression.h"
+#include "frame.h"
+#include "gdbcmd.h"
+#include "gdbtypes.h"
+#include "language.h"
#include "linespec.h"
#include "location.h"
#include "objfiles.h"
+#include "regcache.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
+#include "tracepoint.h"
#include "typeprint.h"
+#include "user-regs.h"
#include "valprint.h"
-#include "c-lang.h"
-
-#include "common/format.h"
+#include "value.h"
/* To make sense of this file, you should read doc/agentexpr.texi.
Then look at the types and enums in ax-gdb.h. For the code itself,
diff --git a/gdb/ax-gdb.h b/gdb/ax-gdb.h
index 4420b654d88..49ea26ec466 100644
--- a/gdb/ax-gdb.h
+++ b/gdb/ax-gdb.h
@@ -19,7 +19,7 @@
#ifndef AX_GDB_H
#define AX_GDB_H
-#include "ax.h" /* For agent_expr_up. */
+#include "ax.h"
struct expression;
union exp_element;
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
index f956dfc2f53..db02982d0a6 100644
--- a/gdb/ax-general.c
+++ b/gdb/ax-general.c
@@ -22,10 +22,11 @@
outside of GDB (test suites, the stub, etc.) */
#include "defs.h"
-#include "ax.h"
-#include "value.h"
+/* Local includes. */
+#include "ax.h"
#include "user-regs.h"
+#include "value.h"
static void grow_expr (struct agent_expr *x, int n);
diff --git a/gdb/bcache.c b/gdb/bcache.c
index 14a78474962..e17d5fab330 100644
--- a/gdb/bcache.c
+++ b/gdb/bcache.c
@@ -20,9 +20,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdb_obstack.h"
#include "bcache.h"
+/* Local includes. */
+#include "gdb_obstack.h"
+
/* The type used to hold a single bcache string. The user data is
stored in d.data. Since it can be any type, it needs to have the
same alignment as the most strict alignment of any type on the host
diff --git a/gdb/bfd-target.c b/gdb/bfd-target.c
index ffe85ae3e0e..6bcf9b528e8 100644
--- a/gdb/bfd-target.c
+++ b/gdb/bfd-target.c
@@ -18,10 +18,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
#include "bfd-target.h"
+
+/* Local includes. */
#include "exec.h"
#include "gdb_bfd.h"
+#include "target.h"
/* A target that wraps a BFD. */
diff --git a/gdb/bfin-linux-tdep.c b/gdb/bfin-linux-tdep.c
index 3fc6b6a6586..29f142a6274 100644
--- a/gdb/bfin-linux-tdep.c
+++ b/gdb/bfin-linux-tdep.c
@@ -20,14 +20,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "arch-utils.h"
+#include "bfin-tdep.h"
+#include "linux-tdep.h"
+#include "osabi.h"
#include "regcache.h"
-#include "tramp-frame.h"
#include "trad-frame.h"
-#include "osabi.h"
+#include "tramp-frame.h"
#include "xml-syscall.h"
-#include "linux-tdep.h"
-#include "bfin-tdep.h"
/* From <asm/sigcontext.h>. */
diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c
index 9d3e8ebce16..c5efe1f3c64 100644
--- a/gdb/bfin-tdep.c
+++ b/gdb/bfin-tdep.c
@@ -20,25 +20,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "arch-utils.h"
-#include "regcache.h"
-#include "frame.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "trad-frame.h"
+#include "bfin-tdep.h"
+
+/* Local non-gdb includes. */
#include "dis-asm.h"
-#include "sim-regno.h"
-#include "gdb/sim-bfin.h"
-#include "dwarf2-frame.h"
-#include "symtab.h"
#include "elf-bfd.h"
#include "elf/bfin.h"
-#include "osabi.h"
+#include "gdb/sim-bfin.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "dwarf2-frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcore.h"
#include "infcall.h"
+#include "inferior.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "sim-regno.h"
+#include "symtab.h"
+#include "trad-frame.h"
#include "xml-syscall.h"
-#include "bfin-tdep.h"
/* Macros used by prologue functions. */
#define P_LINKAGE 0xE800
diff --git a/gdb/block.c b/gdb/block.c
index 63c7d9f3955..931b02074f6 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -19,13 +19,15 @@
#include "defs.h"
#include "block.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "gdb_obstack.h"
-#include "cp-support.h"
+
+/* Local includes. */
#include "addrmap.h"
+#include "cp-support.h"
+#include "gdb_obstack.h"
#include "gdbtypes.h"
#include "objfiles.h"
+#include "symfile.h"
+#include "symtab.h"
/* This is used by struct block to store namespace-related info for
C++ files, namely using declarations and the current namespace in
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index fe7807b87a6..0dd7968bee6 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -19,21 +19,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
+
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "objfiles.h"
-#include "frame.h"
-#include "gdbcore.h"
-#include "value.h"
-#include "target.h"
-#include "inferior.h"
+
+/* Local includes. */
#include "annotate.h"
-#include "regcache.h"
-#include "dummy-frame.h"
+#include "block.h"
#include "command.h"
+#include "dummy-frame.h"
+#include "frame.h"
#include "gdbcmd.h"
-#include "block.h"
+#include "gdbcore.h"
+#include "inferior.h"
#include "inline-frame.h"
+#include "objfiles.h"
+#include "regcache.h"
+#include "symtab.h"
+#include "target.h"
+#include "value.h"
/* Return the innermost lexical block in execution in a specified
stack frame. The frame address is assumed valid.
diff --git a/gdb/break-catch-sig.c b/gdb/break-catch-sig.c
index 53540ee8320..ba886a6d5d4 100644
--- a/gdb/break-catch-sig.c
+++ b/gdb/break-catch-sig.c
@@ -18,18 +18,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
+
+/* Standard C includes. */
#include <ctype.h>
+
+/* Standard C++ includes. */
+#include <string>
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+
+/* Local includes. */
+#include "annotate.h"
+#include "arch-utils.h"
#include "breakpoint.h"
+#include "completer.h"
#include "gdbcmd.h"
#include "inferior.h"
#include "infrun.h"
-#include "annotate.h"
#include "valprint.h"
-#include "cli/cli-utils.h"
-#include "completer.h"
-
-#include <string>
#define INTERNAL_SIGNAL(x) ((x) == GDB_SIGNAL_TRAP || (x) == GDB_SIGNAL_INT)
diff --git a/gdb/break-catch-syscall.c b/gdb/break-catch-syscall.c
index 6a911fbc2a3..2e560a17f18 100644
--- a/gdb/break-catch-syscall.c
+++ b/gdb/break-catch-syscall.c
@@ -18,16 +18,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "breakpoint.h"
-#include "gdbcmd.h"
-#include "inferior.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-utils.h"
-#include "annotate.h"
#include "mi/mi-common.h"
-#include "valprint.h"
+
+/* Local includes. */
+#include "annotate.h"
#include "arch-utils.h"
+#include "breakpoint.h"
+#include "gdbcmd.h"
+#include "inferior.h"
#include "observable.h"
+#include "valprint.h"
#include "xml-syscall.h"
/* An instance of this type is used to represent a syscall catchpoint.
diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c
index c8d66e0737c..502288776f7 100644
--- a/gdb/break-catch-throw.c
+++ b/gdb/break-catch-throw.c
@@ -18,24 +18,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "breakpoint.h"
-#include "gdbcmd.h"
-#include "inferior.h"
-#include "annotate.h"
-#include "valprint.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-utils.h"
-#include "completer.h"
-#include "gdb_obstack.h"
#include "mi/mi-common.h"
-#include "linespec.h"
-#include "probe.h"
-#include "objfiles.h"
+
+/* Local includes. */
+#include "annotate.h"
+#include "arch-utils.h"
+#include "breakpoint.h"
+#include "completer.h"
#include "cp-abi.h"
-#include "gdb_regex.h"
#include "cp-support.h"
+#include "gdb_obstack.h"
+#include "gdb_regex.h"
+#include "gdbcmd.h"
+#include "inferior.h"
+#include "linespec.h"
#include "location.h"
+#include "objfiles.h"
+#include "probe.h"
+#include "valprint.h"
/* Enums for exception-handling support. */
enum exception_event_kind
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 855bd3811e2..3921c83a93b 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -18,58 +18,66 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
+#include "breakpoint.h"
+
+/* Standard C includes. */
#include <ctype.h>
+
+/* Local non-gdb includes. */
+#include "filenames.h"
#include "hashtab.h"
-#include "symtab.h"
-#include "frame.h"
-#include "breakpoint.h"
-#include "tracepoint.h"
-#include "gdbtypes.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-script.h"
+#include "cli/cli-style.h"
+#include "cli/cli-utils.h"
+#include "common/format.h"
+#include "mi/mi-main.h"
+
+/* Local includes. */
+#include "ada-lang.h"
+#include "annotate.h"
+#include "arch-utils.h"
+#include "ax-gdb.h"
+#include "block.h"
+#include "command.h"
+#include "completer.h"
+#include "continuations.h"
+#include "dummy-frame.h"
#include "expression.h"
-#include "gdbcore.h"
+#include "frame.h"
+#include "gdb-demangle.h"
+#include "gdb_regex.h"
#include "gdbcmd.h"
-#include "value.h"
-#include "command.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "gdbtypes.h"
#include "inferior.h"
#include "infrun.h"
-#include "gdbthread.h"
-#include "target.h"
+#include "interps.h"
+#include "jit.h"
#include "language.h"
-#include "gdb-demangle.h"
-#include "filenames.h"
-#include "annotate.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "source.h"
#include "linespec.h"
-#include "completer.h"
-#include "ui-out.h"
-#include "cli/cli-script.h"
-#include "block.h"
-#include "solib.h"
-#include "solist.h"
-#include "observable.h"
#include "memattr.h"
-#include "ada-lang.h"
-#include "top.h"
-#include "valprint.h"
-#include "jit.h"
+#include "objfiles.h"
+#include "observable.h"
#include "parser-defs.h"
-#include "gdb_regex.h"
#include "probe.h"
-#include "cli/cli-utils.h"
-#include "continuations.h"
-#include "stack.h"
#include "skip.h"
-#include "ax-gdb.h"
-#include "dummy-frame.h"
-#include "interps.h"
-#include "common/format.h"
+#include "solib.h"
+#include "solist.h"
+#include "source.h"
+#include "stack.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
#include "thread-fsm.h"
#include "tid-parse.h"
-#include "cli/cli-style.h"
-#include "mi/mi-main.h"
+#include "top.h"
+#include "tracepoint.h"
+#include "ui-out.h"
+#include "valprint.h"
+#include "value.h"
/* readline include files */
#include "readline/readline.h"
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index a91e3e334cf..d8ff8f891cf 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -19,17 +19,21 @@
#if !defined (BREAKPOINT_H)
#define BREAKPOINT_H 1
-#include "frame.h"
-#include "value.h"
+#include <vector>
+
+/* Local subdirectory includes. */
+#include "cli/cli-script.h"
+#include "common/array-view.h"
+#include "common/break-common.h"
#include "common/vec.h"
+
+/* Local includes. */
#include "ax.h"
#include "command.h"
-#include "common/break-common.h"
-#include "probe.h"
+#include "frame.h"
#include "location.h"
-#include <vector>
-#include "common/array-view.h"
-#include "cli/cli-script.h"
+#include "probe.h"
+#include "value.h"
struct block;
struct gdbpy_breakpoint_object;
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index af048f7a18f..1d1bf54f975 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -18,6 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "bsd-uthread.h"
+
+/* Local includes. */
+#include "gdb_obstack.h"
#include "gdbcore.h"
#include "gdbthread.h"
#include "inferior.h"
@@ -29,10 +33,6 @@
#include "symfile.h"
#include "target.h"
-#include "gdb_obstack.h"
-
-#include "bsd-uthread.h"
-
static const target_info bsd_uthread_target_info = {
"bsd-uthreads",
N_("BSD user-level threads"),
diff --git a/gdb/btrace.c b/gdb/btrace.c
index 12af46814a9..dd91edef3bd 100644
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -21,19 +21,25 @@
#include "defs.h"
#include "btrace.h"
+
+/* Local non-gdb includes. */
+#include "filenames.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+#include "common/rsp-low.h"
+
+/* Local includes. */
+#include "disasm.h"
+#include "gdbcmd.h"
#include "gdbthread.h"
#include "inferior.h"
-#include "target.h"
#include "record.h"
-#include "symtab.h"
-#include "disasm.h"
+#include "regcache.h"
#include "source.h"
-#include "filenames.h"
+#include "symtab.h"
+#include "target.h"
#include "xml-support.h"
-#include "regcache.h"
-#include "common/rsp-low.h"
-#include "gdbcmd.h"
-#include "cli/cli-utils.h"
/* For maintenance commands. */
#include "record-btrace.h"
diff --git a/gdb/build-id.c b/gdb/build-id.c
index 27f29cd0442..0bc489642f5 100644
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
@@ -18,14 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "bfd.h"
-#include "gdb_bfd.h"
#include "build-id.h"
-#include "common/gdb_vecs.h"
-#include "symfile.h"
-#include "objfiles.h"
+
+/* Local non-gdb includes. */
+#include "bfd.h"
#include "filenames.h"
+
+/* Local subdirectory includes. */
+#include "common/gdb_vecs.h"
+
+/* Local includes. */
+#include "gdb_bfd.h"
#include "gdbcore.h"
+#include "objfiles.h"
+#include "symfile.h"
/* See build-id.h. */
diff --git a/gdb/build-id.h b/gdb/build-id.h
index b8b033e62aa..855c4c37ec0 100644
--- a/gdb/build-id.h
+++ b/gdb/build-id.h
@@ -20,9 +20,11 @@
#ifndef BUILD_ID_H
#define BUILD_ID_H
-#include "gdb_bfd.h"
#include "common/rsp-low.h"
+/* Local includes. */
+#include "gdb_bfd.h"
+
/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
extern const struct bfd_build_id *build_id_bfd_get (bfd *abfd);
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 9a23c8f5254..4c798eb66c0 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -17,23 +17,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "buildsym-legacy.h"
+#include "buildsym.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "gdb_obstack.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "gdbtypes.h"
-#include "complaints.h"
-#include "expression.h" /* For "enum exp_opcode" used by... */
-#include "filenames.h" /* For DOSish file names. */
-#include "macrotab.h"
-#include "demangle.h" /* Needed by SYMBOL_INIT_DEMANGLED_NAME. */
+#include "demangle.h"
+#include "filenames.h"
+
+/* Local includes. */
+#include "addrmap.h"
#include "block.h"
+#include "buildsym-legacy.h"
+#include "complaints.h"
#include "cp-support.h"
#include "dictionary.h"
-#include "addrmap.h"
-#include <algorithm>
+#include "expression.h"
+#include "gdb_obstack.h"
+#include "gdbtypes.h"
+#include "macrotab.h"
+#include "objfiles.h"
+#include "symfile.h"
+#include "symtab.h"
/* For cleanup_undefined_stabs_types and finish_global_stabs (somewhat
questionable--see comment where we call them). */
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 36c750204da..7e4caddd43c 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -18,23 +18,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "parser-defs.h"
-#include "language.h"
-#include "varobj.h"
#include "c-lang.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
+#include "demangle.h"
+
+/* Local includes. */
#include "c-support.h"
-#include "valprint.h"
-#include "macroscope.h"
#include "charset.h"
-#include "demangle.h"
#include "cp-abi.h"
#include "cp-support.h"
+#include "expression.h"
#include "gdb_obstack.h"
-#include <ctype.h>
#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "language.h"
+#include "macroscope.h"
+#include "parser-defs.h"
+#include "symtab.h"
+#include "valprint.h"
+#include "varobj.h"
/* Given a C string type, STR_TYPE, return the corresponding target
character set name. */
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 6690ca53bcd..ca221dcefd6 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -17,21 +17,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdb_obstack.h"
-#include "bfd.h" /* Binary File Description. */
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "value.h"
-#include "gdbcore.h"
-#include "target.h"
-#include "language.h"
+
+/* Local non-gdb includes. */
+#include "bfd.h"
#include "demangle.h"
-#include "c-lang.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-style.h"
-#include "typeprint.h"
+
+/* Local includes. */
+#include "c-lang.h"
#include "cp-abi.h"
#include "cp-support.h"
+#include "expression.h"
+#include "gdb_obstack.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "language.h"
+#include "symtab.h"
+#include "target.h"
+#include "typeprint.h"
+#include "value.h"
/* A list of access specifiers used for printing. */
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index c4306f1488f..e062d62325c 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -18,16 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "value.h"
-#include "valprint.h"
-#include "language.h"
+
+/* Local includes. */
#include "c-lang.h"
#include "cp-abi.h"
-#include "target.h"
+#include "expression.h"
+#include "gdbtypes.h"
+#include "language.h"
#include "objfiles.h"
+#include "symtab.h"
+#include "target.h"
+#include "valprint.h"
+#include "value.h"
+
/* A helper for c_textual_element_type. This checks the name of the
diff --git a/gdb/c-varobj.c b/gdb/c-varobj.c
index 2d247745c04..709443275c5 100644
--- a/gdb/c-varobj.c
+++ b/gdb/c-varobj.c
@@ -16,10 +16,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "value.h"
-#include "varobj.h"
+
+/* Local includes. */
#include "gdbthread.h"
#include "valprint.h"
+#include "value.h"
+#include "varobj.h"
static void cplus_class_num_children (struct type *type, int children[3]);
diff --git a/gdb/charset.c b/gdb/charset.c
index 5d8a9966031..b1a18bcef3c 100644
--- a/gdb/charset.c
+++ b/gdb/charset.c
@@ -19,15 +19,21 @@
#include "defs.h"
#include "charset.h"
-#include "gdbcmd.h"
-#include "gdb_obstack.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local subdirectory includes. */
+#include "common/environ.h"
+#include "common/gdb_vecs.h"
#include "common/gdb_wait.h"
-#include "charset-list.h"
#include "common/vec.h"
-#include "common/environ.h"
+
+/* Local includes. */
#include "arch-utils.h"
-#include "common/gdb_vecs.h"
-#include <ctype.h>
+#include "charset-list.h"
+#include "gdb_obstack.h"
+#include "gdbcmd.h"
#ifdef USE_WIN32API
#include <windows.h>
diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index 55c8d2b3b1b..bfe799203fb 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -21,12 +21,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "ui-out.h"
#include "cli-out.h"
-#include "completer.h"
+
+/* Local non-gdb includes. */
#include "readline/readline.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-style.h"
+/* Local includes. */
+#include "completer.h"
+#include "ui-out.h"
+
/* These are the CLI output functions */
/* Mark beginning of a table */
diff --git a/gdb/cli-out.h b/gdb/cli-out.h
index eeb555fbbec..e69f0718e23 100644
--- a/gdb/cli-out.h
+++ b/gdb/cli-out.h
@@ -20,9 +20,11 @@
#ifndef CLI_OUT_H
#define CLI_OUT_H
-#include "ui-out.h"
#include <vector>
+/* Local includes. */
+#include "ui-out.h"
+
class cli_ui_out : public ui_out
{
public:
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 5dc94a5361a..951a06ee580 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -18,39 +18,42 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
+#include "cli/cli-cmds.h"
+
+/* Local non-gdb includes. */
+#include "filenames.h"
#include "readline/readline.h"
#include "readline/tilde.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-decode.h"
+#include "cli/cli-script.h"
+#include "cli/cli-setshow.h"
+#include "cli/cli-utils.h"
+#include "common/filestuff.h"
+#include "common/gdb_wait.h"
+#include "common/pathstuff.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "block.h"
#include "completer.h"
-#include "target.h" /* For baud_rate, remote_debug and remote_timeout. */
-#include "common/gdb_wait.h" /* For shell escape implementation. */
-#include "gdb_regex.h" /* Used by apropos_command. */
-#include "gdb_vfork.h"
-#include "linespec.h"
+#include "disasm.h"
#include "expression.h"
+#include "extension.h"
#include "frame.h"
-#include "value.h"
+#include "gdb_regex.h"
+#include "gdb_vfork.h"
#include "language.h"
-#include "filenames.h" /* For DOSish file names. */
+#include "linespec.h"
+#include "location.h"
#include "objfiles.h"
#include "source.h"
-#include "disasm.h"
+#include "target.h"
+#include "top.h"
#include "tracepoint.h"
-#include "common/filestuff.h"
-#include "location.h"
-#include "block.h"
-
#include "ui-out.h"
-
-#include "top.h"
-#include "cli/cli-decode.h"
-#include "cli/cli-script.h"
-#include "cli/cli-setshow.h"
-#include "cli/cli-cmds.h"
-#include "cli/cli-utils.h"
-
-#include "extension.h"
-#include "common/pathstuff.h"
+#include "value.h"
#ifdef TUI
#include "tui/tui.h" /* For tui_active et.al. */
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 50430953c72..a9cee0de353 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -16,15 +16,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
+#include "cli/cli-decode.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "gdb_regex.h"
-#include "completer.h"
-#include "ui-out.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-cmds.h"
-#include "cli/cli-decode.h"
#include "common/gdb_optional.h"
+/* Local includes. */
+#include "completer.h"
+#include "gdb_regex.h"
+#include "symtab.h"
+#include "ui-out.h"
+
/* Prototypes for local functions. */
static void undef_cmd_error (const char *, const char *);
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index 8f0d8bfa8cb..589acab68ea 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -20,18 +20,26 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "cli/cli-decode.h"
-#include "cli/cli-cmds.h"
-#include "value.h"
-#include "completer.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "target.h"
+
+/* Local non-gdb includes. */
#include "readline/readline.h"
-#include "gdbcore.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-cmds.h"
+#include "cli/cli-decode.h"
#include "cli/cli-utils.h"
-#include "gdb_bfd.h"
-#include "common/filestuff.h"
#include "common/byte-vector.h"
+#include "common/filestuff.h"
+
+/* Local includes. */
+#include "completer.h"
+#include "gdb_bfd.h"
+#include "gdbcore.h"
+#include "target.h"
+#include "value.h"
static gdb::unique_xmalloc_ptr<char>
scan_expression (const char **cmd, const char *def)
diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c
index 088f4f1f89c..d05c22d8a16 100644
--- a/gdb/cli/cli-interp.c
+++ b/gdb/cli/cli-interp.c
@@ -18,17 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "cli-interp.h"
-#include "interps.h"
-#include "event-top.h"
-#include "ui-out.h"
+#include "cli/cli-interp.h"
+
+/* Local includes. */
#include "cli-out.h"
-#include "top.h" /* for "execute_command" */
+#include "event-top.h"
+#include "gdbthread.h"
+#include "inferior.h"
#include "infrun.h"
+#include "interps.h"
#include "observable.h"
-#include "gdbthread.h"
#include "thread-fsm.h"
-#include "inferior.h"
+#include "top.h"
+#include "ui-out.h"
cli_interp_base::cli_interp_base (const char *name)
: interp (name)
diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c
index 3a5e14de3c7..b8c650e95a6 100644
--- a/gdb/cli/cli-logging.c
+++ b/gdb/cli/cli-logging.c
@@ -18,9 +18,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "gdbcmd.h"
-#include "ui-out.h"
#include "interps.h"
+#include "ui-out.h"
static char *saved_filename;
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index e2fa8807130..e36fa70d541 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -18,26 +18,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "value.h"
-#include "language.h" /* For value_true */
+#include "cli/cli-script.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "ui-out.h"
-#include "top.h"
-#include "breakpoint.h"
-#include "tracepoint.h"
+/* Standard C++ includes. */
+#include <vector>
+
+/* Local subdirectory includes. */
#include "cli/cli-cmds.h"
#include "cli/cli-decode.h"
-#include "cli/cli-script.h"
-
-#include "extension.h"
-#include "interps.h"
-#include "compile/compile.h"
#include "common/gdb_string_view.h"
-#include "python/python.h"
+#include "compile/compile.h"
#include "guile/guile.h"
+#include "python/python.h"
-#include <vector>
+/* Local includes. */
+#include "breakpoint.h"
+#include "extension.h"
+#include "interps.h"
+#include "language.h"
+#include "top.h"
+#include "tracepoint.h"
+#include "ui-out.h"
+#include "value.h"
/* Prototypes for local functions. */
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 5b87f905d0d..999e4618052 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -16,19 +16,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "readline/tilde.h"
-#include "value.h"
+#include "cli/cli-setshow.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "arch-utils.h"
-#include "observable.h"
-#include "ui-out.h"
+/* Local non-gdb includes. */
+#include "readline/tilde.h"
-#include "cli/cli-decode.h"
+/* Local subdirectory includes. */
#include "cli/cli-cmds.h"
-#include "cli/cli-setshow.h"
+#include "cli/cli-decode.h"
#include "cli/cli-utils.h"
+/* Local includes. */
+#include "arch-utils.h"
+#include "observable.h"
+#include "ui-out.h"
+#include "value.h"
+
/* Return true if the change of command parameter should be notified. */
static int
diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c
index f6f6c7be5d9..a795cb1d598 100644
--- a/gdb/cli/cli-style.c
+++ b/gdb/cli/cli-style.c
@@ -18,10 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "cli/cli-cmds.h"
#include "cli/cli-style.h"
-#include "source-cache.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-cmds.h"
+
+/* Local includes. */
#include "observable.h"
+#include "source-cache.h"
/* True if styling is enabled. */
diff --git a/gdb/cli/cli-utils.c b/gdb/cli/cli-utils.c
index c8b07f0b6bc..88dcab78fa2 100644
--- a/gdb/cli/cli-utils.c
+++ b/gdb/cli/cli-utils.c
@@ -19,10 +19,13 @@
#include "defs.h"
#include "cli/cli-utils.h"
-#include "value.h"
+/* Standard C includes. */
#include <ctype.h>
+/* Local includes. */
+#include "value.h"
+
static std::string extract_arg_maybe_quoted (const char **arg);
/* See documentation in cli-utils.h. */
diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c
index f5721382f4c..ff7e376fa69 100644
--- a/gdb/coff-pe-read.c
+++ b/gdb/coff-pe-read.c
@@ -22,21 +22,25 @@
Contributed by Raoul M. Gough (RaoulGough@yahoo.co.uk). */
#include "defs.h"
-
#include "coff-pe-read.h"
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "gdbtypes.h"
+#include "coff/internal.h"
+
+/* Local subdirectory includes. */
+#include "common/common-utils.h"
+/* Local includes. */
#include "command.h"
#include "gdbcmd.h"
-#include "symtab.h"
-#include "symfile.h"
+#include "gdbtypes.h"
#include "objfiles.h"
-#include "common/common-utils.h"
-#include "coff/internal.h"
-
-#include <ctype.h>
+#include "symfile.h"
+#include "symtab.h"
/* Internal section information */
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 4354741ab64..a89f2c5980b 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -18,30 +18,32 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "demangle.h"
-#include "breakpoint.h"
-#include "bfd.h"
-#include "gdb_obstack.h"
+/* Standard C includes. */
#include <ctype.h>
-#include "coff/internal.h" /* Internal format of COFF symbols in BFD */
-#include "libcoff.h" /* FIXME secret internal data from BFD */
-#include "objfiles.h"
+/* Local non-gdb includes. */
+#include "bfd.h"
+#include "coff/internal.h"
+#include "demangle.h"
+#include "libcoff.h"
+
+/* Local includes. */
+#include "block.h"
+#include "breakpoint.h"
+#include "build-id.h"
#include "buildsym-legacy.h"
-#include "gdb-stabs.h"
-#include "stabsread.h"
+#include "coff-pe-read.h"
#include "complaints.h"
-#include "target.h"
-#include "block.h"
#include "dictionary.h"
-
-#include "coff-pe-read.h"
-
+#include "gdb-stabs.h"
+#include "gdb_obstack.h"
+#include "gdbtypes.h"
+#include "objfiles.h"
#include "psymtab.h"
-#include "build-id.h"
+#include "stabsread.h"
+#include "symtab.h"
+#include "target.h"
/* Key for COFF-associated data. */
diff --git a/gdb/common/agent.c b/gdb/common/agent.c
index ae495a86b81..4040a21e9d6 100644
--- a/gdb/common/agent.c
+++ b/gdb/common/agent.c
@@ -17,12 +17,19 @@
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 "common-defs.h"
-#include "target/target.h"
-#include "common/symbol.h"
+#include "common/common-defs.h"
+#include "common/agent.h"
+
+/* Standard C includes. */
#include <unistd.h>
+
+/* Local non-gdb includes. */
#include "filestuff.h"
+/* Local subdirectory includes. */
+#include "common/symbol.h"
+#include "target/target.h"
+
#define IPA_SYM_STRUCT_NAME ipa_sym_addresses_common
#include "agent.h"
diff --git a/gdb/common/array-view.h b/gdb/common/array-view.h
index ad7933bc1fb..2edd3cf979f 100644
--- a/gdb/common/array-view.h
+++ b/gdb/common/array-view.h
@@ -18,9 +18,11 @@
#ifndef COMMON_ARRAY_VIEW_H
#define COMMON_ARRAY_VIEW_H
-#include "traits.h"
#include <type_traits>
+/* Local non-gdb includes. */
+#include "traits.h"
+
/* An array_view is an abstraction that provides a non-owning view
over a sequence of contiguous objects.
diff --git a/gdb/common/btrace-common.c b/gdb/common/btrace-common.c
index 13f1f1a0fdd..b2c7c4dea05 100644
--- a/gdb/common/btrace-common.c
+++ b/gdb/common/btrace-common.c
@@ -17,8 +17,8 @@
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 "common-defs.h"
-#include "btrace-common.h"
+#include "common/common-defs.h"
+#include "common/btrace-common.h"
/* See btrace-common.h. */
diff --git a/gdb/common/buffer.c b/gdb/common/buffer.c
index 3c919e70979..2408648597d 100644
--- a/gdb/common/buffer.c
+++ b/gdb/common/buffer.c
@@ -17,10 +17,13 @@
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 "common-defs.h"
-#include "xml-utils.h"
-#include "buffer.h"
+#include "common/common-defs.h"
+#include "common/buffer.h"
+
+/* Local non-gdb includes. */
#include "inttypes.h"
+#include "xml-utils.h"
+
void
buffer_grow (struct buffer *buffer, const char *data, size_t size)
{
diff --git a/gdb/common/cleanups.c b/gdb/common/cleanups.c
index 121720d3c0f..242fb173975 100644
--- a/gdb/common/cleanups.c
+++ b/gdb/common/cleanups.c
@@ -17,8 +17,8 @@
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 "common-defs.h"
-#include "cleanups.h"
+#include "common/common-defs.h"
+#include "common/cleanups.h"
/* The cleanup list records things that have to be undone
if an error happens (descriptors to be closed, memory to be freed, etc.)
diff --git a/gdb/common/common-debug.c b/gdb/common/common-debug.c
index 11aee3ad5e3..0417818be3d 100644
--- a/gdb/common/common-debug.c
+++ b/gdb/common/common-debug.c
@@ -17,8 +17,8 @@
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 "common-defs.h"
-#include "common-debug.h"
+#include "common/common-defs.h"
+#include "common/common-debug.h"
/* See common/common-debug.h. */
diff --git a/gdb/common/common-exceptions.c b/gdb/common/common-exceptions.c
index 4e67e898bda..a2dd837c9d4 100644
--- a/gdb/common/common-exceptions.c
+++ b/gdb/common/common-exceptions.c
@@ -17,8 +17,8 @@
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 "common-defs.h"
-#include "common-exceptions.h"
+#include "common/common-defs.h"
+#include "common/common-exceptions.h"
const struct gdb_exception exception_none = { (enum return_reason) 0, GDB_NO_ERROR, NULL };
diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h
index 471e7c5cf81..a5d57b7e1a3 100644
--- a/gdb/common/common-exceptions.h
+++ b/gdb/common/common-exceptions.h
@@ -21,6 +21,8 @@
#define COMMON_COMMON_EXCEPTIONS_H
#include <setjmp.h>
+
+/* Standard C++ includes. */
#include <new>
/* Reasons for calling throw_exceptions(). NOTE: all reason values
diff --git a/gdb/common/common-regcache.c b/gdb/common/common-regcache.c
index 4bdadffb824..acc23e82136 100644
--- a/gdb/common/common-regcache.c
+++ b/gdb/common/common-regcache.c
@@ -17,8 +17,8 @@
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 "common-defs.h"
-#include "common-regcache.h"
+#include "common/common-defs.h"
+#include "common/common-regcache.h"
/* Return the register's value or throw if it's not available. */
diff --git a/gdb/common/common-utils.c b/gdb/common/common-utils.c
index 74ca93810c7..b70e7403389 100644
--- a/gdb/common/common-utils.c
+++ b/gdb/common/common-utils.c
@@ -17,11 +17,15 @@
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 "common-defs.h"
-#include "common-utils.h"
-#include "host-defs.h"
+#include "common/common-defs.h"
+#include "common/common-utils.h"
+
+/* Standard C includes. */
#include <ctype.h>
+/* Local non-gdb includes. */
+#include "host-defs.h"
+
/* The xmalloc() (libiberty.h) family of memory management routines.
These are like the ISO-C malloc() family except that they implement
diff --git a/gdb/common/common-utils.h b/gdb/common/common-utils.h
index 52bf3437b1c..0562b4dd7b9 100644
--- a/gdb/common/common-utils.h
+++ b/gdb/common/common-utils.h
@@ -23,6 +23,7 @@
#include <string>
#include <vector>
+/* Local non-gdb includes. */
#include "poison.h"
/* If possible, define FUNCTION_NAME, a macro containing the name of
diff --git a/gdb/common/def-vector.h b/gdb/common/def-vector.h
index 90c9ff577a7..115195fbf33 100644
--- a/gdb/common/def-vector.h
+++ b/gdb/common/def-vector.h
@@ -19,6 +19,8 @@
#define COMMON_DEF_VECTOR_H
#include <vector>
+
+/* Local subdirectory includes. */
#include "common/default-init-alloc.h"
namespace gdb {
diff --git a/gdb/common/environ.c b/gdb/common/environ.c
index 0c4106cbf6e..a05e5d7f3c8 100644
--- a/gdb/common/environ.c
+++ b/gdb/common/environ.c
@@ -15,8 +15,10 @@
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 "common-defs.h"
-#include "environ.h"
+#include "common/common-defs.h"
+#include "common/environ.h"
+
+/* Standard C++ includes. */
#include <algorithm>
#include <utility>
diff --git a/gdb/common/environ.h b/gdb/common/environ.h
index 8a6b907c9b4..005d441e9f0 100644
--- a/gdb/common/environ.h
+++ b/gdb/common/environ.h
@@ -17,8 +17,8 @@
#ifndef COMMON_ENVIRON_H
#define COMMON_ENVIRON_H
-#include <vector>
#include <set>
+#include <vector>
/* Class that represents the environment variables as seen by the
inferior. */
diff --git a/gdb/common/errors.c b/gdb/common/errors.c
index 22080124d4b..02f16ec5ecf 100644
--- a/gdb/common/errors.c
+++ b/gdb/common/errors.c
@@ -17,8 +17,8 @@
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 "common-defs.h"
-#include "errors.h"
+#include "common/common-defs.h"
+#include "common/errors.h"
/* See common/errors.h. */
diff --git a/gdb/common/fileio.c b/gdb/common/fileio.c
index 28d97fc2f26..eddf4b1f944 100644
--- a/gdb/common/fileio.c
+++ b/gdb/common/fileio.c
@@ -17,10 +17,12 @@
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 "common-defs.h"
-#include "fileio.h"
-#include <sys/stat.h>
+#include "common/common-defs.h"
+#include "common/fileio.h"
+
+/* Standard C includes. */
#include <fcntl.h>
+#include <sys/stat.h>
/* See fileio.h. */
diff --git a/gdb/common/fileio.h b/gdb/common/fileio.h
index 7a2e7c2817e..d31f47feb81 100644
--- a/gdb/common/fileio.h
+++ b/gdb/common/fileio.h
@@ -20,9 +20,11 @@
#ifndef COMMON_FILEIO_H
#define COMMON_FILEIO_H
-#include "gdb/fileio.h"
#include <sys/stat.h>
+/* Local non-gdb includes. */
+#include "gdb/fileio.h"
+
/* Convert a host-format errno value to a File-I/O error number. */
extern int host_to_fileio_error (int error);
diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c
index 1ca62482a7e..4c79367f6dc 100644
--- a/gdb/common/filestuff.c
+++ b/gdb/common/filestuff.c
@@ -16,15 +16,21 @@
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 "common-defs.h"
-#include "filestuff.h"
-#include "gdb_vecs.h"
+#include "common/common-defs.h"
+#include "common/filestuff.h"
+
+/* Standard C includes. */
#include <fcntl.h>
-#include <unistd.h>
-#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+/* Standard C++ includes. */
#include <algorithm>
+/* Local non-gdb includes. */
+#include "gdb_vecs.h"
+
#ifdef USE_WIN32API
#include <winsock2.h>
#include <windows.h>
diff --git a/gdb/common/format.c b/gdb/common/format.c
index fb3421e62bf..cf42ce0c1ba 100644
--- a/gdb/common/format.c
+++ b/gdb/common/format.c
@@ -17,8 +17,8 @@
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 "common-defs.h"
-#include "format.h"
+#include "common/common-defs.h"
+#include "common/format.h"
format_pieces::format_pieces (const char **arg)
{
diff --git a/gdb/common/forward-scope-exit.h b/gdb/common/forward-scope-exit.h
index bffc6e683ba..13fc8249a52 100644
--- a/gdb/common/forward-scope-exit.h
+++ b/gdb/common/forward-scope-exit.h
@@ -18,9 +18,11 @@
#ifndef COMMON_FORWARD_SCOPE_EXIT_H
#define COMMON_FORWARD_SCOPE_EXIT_H
-#include "common/scope-exit.h"
#include <functional>
+/* Local subdirectory includes. */
+#include "common/scope-exit.h"
+
/* A forward_scope_exit is like scope_exit, but instead of giving it a
callable, you instead specialize it for a given cleanup function,
and the generated class automatically has a constructor with the
diff --git a/gdb/common/gdb_tilde_expand.c b/gdb/common/gdb_tilde_expand.c
index fc338ff6ecb..153442ec07b 100644
--- a/gdb/common/gdb_tilde_expand.c
+++ b/gdb/common/gdb_tilde_expand.c
@@ -17,8 +17,10 @@
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 "common-defs.h"
-#include "gdb_tilde_expand.h"
+#include "common/common-defs.h"
+#include "common/gdb_tilde_expand.h"
+
+/* Standard C includes. */
#include <glob.h>
/* RAII-style class wrapping "glob". */
diff --git a/gdb/common/gdb_vecs.c b/gdb/common/gdb_vecs.c
index 38f42f54c9a..ab8f7a97c92 100644
--- a/gdb/common/gdb_vecs.c
+++ b/gdb/common/gdb_vecs.c
@@ -17,8 +17,10 @@
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 "common-defs.h"
-#include "gdb_vecs.h"
+#include "common/common-defs.h"
+#include "common/gdb_vecs.h"
+
+/* Local non-gdb includes. */
#include "host-defs.h"
/* Worker function to split character delimiter separated string of fields
diff --git a/gdb/common/job-control.c b/gdb/common/job-control.c
index fc3de684904..d186e834e26 100644
--- a/gdb/common/job-control.c
+++ b/gdb/common/job-control.c
@@ -18,8 +18,10 @@
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 "common-defs.h"
-#include "job-control.h"
+#include "common/common-defs.h"
+#include "common/job-control.h"
+
+/* Standard C includes. */
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
diff --git a/gdb/common/mingw-strerror.c b/gdb/common/mingw-strerror.c
index 6386330062c..75c1635a21a 100644
--- a/gdb/common/mingw-strerror.c
+++ b/gdb/common/mingw-strerror.c
@@ -17,8 +17,9 @@
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 "common-defs.h"
+#include "common/common-defs.h"
+/* Standard C includes. */
#include <windows.h>
/* Implementation of safe_strerror as defined in common-utils.h.
diff --git a/gdb/common/netstuff.c b/gdb/common/netstuff.c
index 27fdc739ffd..b72d3499b3e 100644
--- a/gdb/common/netstuff.c
+++ b/gdb/common/netstuff.c
@@ -16,8 +16,10 @@
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 "common-defs.h"
-#include "netstuff.h"
+#include "common/common-defs.h"
+#include "common/netstuff.h"
+
+/* Standard C++ includes. */
#include <algorithm>
#ifdef USE_WIN32API
diff --git a/gdb/common/pathstuff.c b/gdb/common/pathstuff.c
index 2b1669a5b99..3c33b970020 100644
--- a/gdb/common/pathstuff.c
+++ b/gdb/common/pathstuff.c
@@ -17,11 +17,13 @@
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 "common-defs.h"
-#include "pathstuff.h"
-#include "host-defs.h"
+#include "common/common-defs.h"
+#include "common/pathstuff.h"
+
+/* Local non-gdb includes. */
#include "filenames.h"
#include "gdb_tilde_expand.h"
+#include "host-defs.h"
#ifdef USE_WIN32API
#include <windows.h>
diff --git a/gdb/common/poison.h b/gdb/common/poison.h
index 699de513bab..79b7955a03f 100644
--- a/gdb/common/poison.h
+++ b/gdb/common/poison.h
@@ -20,8 +20,8 @@
#ifndef COMMON_POISON_H
#define COMMON_POISON_H
-#include "traits.h"
#include "obstack.h"
+#include "traits.h"
/* Poison memset of non-POD types. The idea is catching invalid
initialization of non-POD structs that is easy to be introduced as
diff --git a/gdb/common/posix-strerror.c b/gdb/common/posix-strerror.c
index a8651b706d7..1e7c78c2a3d 100644
--- a/gdb/common/posix-strerror.c
+++ b/gdb/common/posix-strerror.c
@@ -17,7 +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 "common-defs.h"
+#include "common/common-defs.h"
/* Implementation of safe_strerror as defined in common-utils.h. */
diff --git a/gdb/common/print-utils.c b/gdb/common/print-utils.c
index 051c4541b28..9d8ce288bad 100644
--- a/gdb/common/print-utils.c
+++ b/gdb/common/print-utils.c
@@ -17,8 +17,9 @@
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 "common-defs.h"
-#include "print-utils.h"
+#include "common/common-defs.h"
+#include "common/print-utils.h"
+
/* Temporary storage using circular buffer. */
/* Number of cells in the circular buffer. */
diff --git a/gdb/common/ptid.c b/gdb/common/ptid.c
index c025511a37b..202370aa2db 100644
--- a/gdb/common/ptid.c
+++ b/gdb/common/ptid.c
@@ -17,8 +17,8 @@
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 "common-defs.h"
-#include "ptid.h"
+#include "common/common-defs.h"
+#include "common/ptid.h"
/* See ptid.h for these. */
diff --git a/gdb/common/rsp-low.c b/gdb/common/rsp-low.c
index 4bb49418499..fa20fba7b63 100644
--- a/gdb/common/rsp-low.c
+++ b/gdb/common/rsp-low.c
@@ -17,8 +17,8 @@
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 "common-defs.h"
-#include "rsp-low.h"
+#include "common/common-defs.h"
+#include "common/rsp-low.h"
/* See rsp-low.h. */
diff --git a/gdb/common/run-time-clock.c b/gdb/common/run-time-clock.c
index 26378a05d91..96565241040 100644
--- a/gdb/common/run-time-clock.c
+++ b/gdb/common/run-time-clock.c
@@ -16,8 +16,10 @@
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 "common-defs.h"
-#include "run-time-clock.h"
+#include "common/common-defs.h"
+#include "common/run-time-clock.h"
+
+/* Standard C includes. */
#if defined HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
diff --git a/gdb/common/scope-exit.h b/gdb/common/scope-exit.h
index 8cdbec305ac..003ba9fd6aa 100644
--- a/gdb/common/scope-exit.h
+++ b/gdb/common/scope-exit.h
@@ -20,6 +20,8 @@
#include <functional>
#include <type_traits>
+
+/* Local subdirectory includes. */
#include "common/preprocessor.h"
/* scope_exit is a general-purpose scope guard that calls its exit
diff --git a/gdb/common/scoped_fd.h b/gdb/common/scoped_fd.h
index c4a494b7018..1b6f4c9b2ac 100644
--- a/gdb/common/scoped_fd.h
+++ b/gdb/common/scoped_fd.h
@@ -21,6 +21,8 @@
#define COMMON_SCOPED_FD_H
#include <unistd.h>
+
+/* Local non-gdb includes. */
#include "filestuff.h"
/* A smart-pointer-like class to automatically close a file descriptor. */
diff --git a/gdb/common/scoped_mmap.c b/gdb/common/scoped_mmap.c
index 1bd980c09a5..1141b3a8b72 100644
--- a/gdb/common/scoped_mmap.c
+++ b/gdb/common/scoped_mmap.c
@@ -17,11 +17,18 @@
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 "scoped_mmap.h"
+#include "common/common-defs.h"
+#include "common/scoped_mmap.h"
+
+/* Local non-gdb includes. */
#include "scoped_fd.h"
+
+/* Local subdirectory includes. */
#include "common/filestuff.h"
+/* Local includes. */
+#include "defs.h"
+
#ifdef HAVE_SYS_MMAN_H
scoped_mmap
diff --git a/gdb/common/selftest.c b/gdb/common/selftest.c
index fe060ff64f1..113b8b33c3d 100644
--- a/gdb/common/selftest.c
+++ b/gdb/common/selftest.c
@@ -16,12 +16,16 @@
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 "common-defs.h"
-#include "common-exceptions.h"
-#include "common-debug.h"
-#include "selftest.h"
+#include "common/common-defs.h"
+#include "common/selftest.h"
+
+/* Standard C++ includes. */
#include <map>
+/* Local non-gdb includes. */
+#include "common-debug.h"
+#include "common-exceptions.h"
+
namespace selftests
{
/* All the tests that have been registered. Using an std::map allows keeping
diff --git a/gdb/common/signals-state-save-restore.c b/gdb/common/signals-state-save-restore.c
index c66d2ddc62f..737ebe3f778 100644
--- a/gdb/common/signals-state-save-restore.c
+++ b/gdb/common/signals-state-save-restore.c
@@ -15,9 +15,10 @@
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 "common-defs.h"
-#include "signals-state-save-restore.h"
+#include "common/common-defs.h"
+#include "common/signals-state-save-restore.h"
+/* Standard C includes. */
#include <signal.h>
/* The original signal actions and mask. */
diff --git a/gdb/common/signals.c b/gdb/common/signals.c
index 707bbe9fa3b..beba0531ced 100644
--- a/gdb/common/signals.c
+++ b/gdb/common/signals.c
@@ -17,12 +17,14 @@
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 "common-defs.h"
+#include "common/common-defs.h"
+/* Standard C includes. */
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
+/* Local non-gdb includes. */
#include "gdb_signals.h"
struct gdbarch;
diff --git a/gdb/common/tdesc.c b/gdb/common/tdesc.c
index fe63a36c339..8c7b618dc5b 100644
--- a/gdb/common/tdesc.c
+++ b/gdb/common/tdesc.c
@@ -17,7 +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 "common-defs.h"
+#include "common/common-defs.h"
#include "common/tdesc.h"
tdesc_reg::tdesc_reg (struct tdesc_feature *feature, const std::string &name_,
diff --git a/gdb/common/vec.c b/gdb/common/vec.c
index a8895449495..c57812153d1 100644
--- a/gdb/common/vec.c
+++ b/gdb/common/vec.c
@@ -17,8 +17,8 @@
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 "common-defs.h"
-#include "vec.h"
+#include "common/common-defs.h"
+#include "common/vec.h"
struct vec_prefix
{
diff --git a/gdb/common/xml-utils.c b/gdb/common/xml-utils.c
index 79f040e2b0f..c6b09ab2ab6 100644
--- a/gdb/common/xml-utils.c
+++ b/gdb/common/xml-utils.c
@@ -17,8 +17,8 @@
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 "common-defs.h"
-#include "xml-utils.h"
+#include "common/common-defs.h"
+#include "common/xml-utils.h"
/* See xml-utils.h. */
diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c
index d1947da6570..25efae4f6bd 100644
--- a/gdb/compile/compile-c-support.c
+++ b/gdb/compile/compile-c-support.c
@@ -18,17 +18,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "compile-internal.h"
+
+/* Local non-gdb includes. */
#include "compile-c.h"
#include "compile-cplus.h"
+#include "compile-internal.h"
#include "compile.h"
-#include "gdb-dlfcn.h"
+
+/* Local subdirectory includes. */
+#include "common/function-view.h"
+#include "common/preprocessor.h"
+
+/* Local includes. */
#include "c-lang.h"
-#include "macrotab.h"
+#include "gdb-dlfcn.h"
#include "macroscope.h"
+#include "macrotab.h"
#include "regcache.h"
-#include "common/function-view.h"
-#include "common/preprocessor.h"
/* See compile-internal.h. */
diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c
index a0f833e6f01..c15d8abc59a 100644
--- a/gdb/compile/compile-c-symbols.c
+++ b/gdb/compile/compile-c-symbols.c
@@ -19,17 +19,21 @@
#include "defs.h"
-#include "compile-internal.h"
+
+/* Local non-gdb includes. */
#include "compile-c.h"
-#include "symtab.h"
-#include "parser-defs.h"
-#include "block.h"
-#include "objfiles.h"
+#include "compile-internal.h"
#include "compile.h"
-#include "value.h"
+
+/* Local includes. */
+#include "block.h"
+#include "dwarf2loc.h"
#include "exceptions.h"
#include "gdbtypes.h"
-#include "dwarf2loc.h"
+#include "objfiles.h"
+#include "parser-defs.h"
+#include "symtab.h"
+#include "value.h"
diff --git a/gdb/compile/compile-c-types.c b/gdb/compile/compile-c-types.c
index 9d635cf16d5..0a1b2b5da43 100644
--- a/gdb/compile/compile-c-types.c
+++ b/gdb/compile/compile-c-types.c
@@ -19,9 +19,13 @@
#include "defs.h"
-#include "gdbtypes.h"
-#include "compile-internal.h"
+
+/* Local non-gdb includes. */
#include "compile-c.h"
+#include "compile-internal.h"
+
+/* Local includes. */
+#include "gdbtypes.h"
#include "objfiles.h"
/* Convert a pointer type to its gcc representation. */
diff --git a/gdb/compile/compile-c.h b/gdb/compile/compile-c.h
index b5a2194dbbb..574ef5761c3 100644
--- a/gdb/compile/compile-c.h
+++ b/gdb/compile/compile-c.h
@@ -17,9 +17,11 @@
#ifndef COMPILE_COMPILE_C_H
#define COMPILE_COMPILE_C_H
-#include "common/enum-flags.h"
#include "gcc-c-plugin.h"
+/* Local subdirectory includes. */
+#include "common/enum-flags.h"
+
/* enum-flags wrapper. */
DEF_ENUM_FLAGS_TYPE (enum gcc_qualifiers, gcc_qualifiers_flags);
diff --git a/gdb/compile/compile-cplus-symbols.c b/gdb/compile/compile-cplus-symbols.c
index 0979784466e..f3505a341a4 100644
--- a/gdb/compile/compile-cplus-symbols.c
+++ b/gdb/compile/compile-cplus-symbols.c
@@ -19,21 +19,27 @@
#include "defs.h"
-#include "compile-internal.h"
+
+/* Local non-gdb includes. */
+#include "compile-c.h"
#include "compile-cplus.h"
+#include "compile-internal.h"
+#include "compile.h"
+
+/* Local subdirectory includes. */
#include "common/gdb_assert.h"
-#include "symtab.h"
-#include "parser-defs.h"
+
+/* Local includes. */
#include "block.h"
-#include "objfiles.h"
-#include "compile.h"
-#include "value.h"
-#include "exceptions.h"
-#include "gdbtypes.h"
-#include "dwarf2loc.h"
#include "cp-support.h"
+#include "dwarf2loc.h"
+#include "exceptions.h"
#include "gdbcmd.h"
-#include "compile-c.h"
+#include "gdbtypes.h"
+#include "objfiles.h"
+#include "parser-defs.h"
+#include "symtab.h"
+#include "value.h"
/* Convert a given symbol, SYM, to the compiler's representation.
INSTANCE is the compiler instance. IS_GLOBAL is true if the
diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-types.c
index ee3bb438a3b..82482895296 100644
--- a/gdb/compile/compile-cplus-types.c
+++ b/gdb/compile/compile-cplus-types.c
@@ -19,21 +19,29 @@
#include "defs.h"
-#include "common/preprocessor.h"
-#include "gdbtypes.h"
-#include "compile-internal.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "compile-c.h"
#include "compile-cplus.h"
+#include "compile-internal.h"
+
+/* Local subdirectory includes. */
#include "common/gdb_assert.h"
-#include "symtab.h"
-#include "source.h"
-#include "cp-support.h"
-#include "cp-abi.h"
-#include "objfiles.h"
+#include "common/preprocessor.h"
+
+/* Local includes. */
#include "block.h"
-#include "gdbcmd.h"
#include "c-lang.h"
-#include "compile-c.h"
-#include <algorithm>
+#include "cp-abi.h"
+#include "cp-support.h"
+#include "gdbcmd.h"
+#include "gdbtypes.h"
+#include "objfiles.h"
+#include "source.h"
+#include "symtab.h"
/* Default compile flags for C++. */
diff --git a/gdb/compile/compile-cplus.h b/gdb/compile/compile-cplus.h
index e5ea7d7c81a..7647be04452 100644
--- a/gdb/compile/compile-cplus.h
+++ b/gdb/compile/compile-cplus.h
@@ -17,9 +17,11 @@
#ifndef COMPILE_COMPILE_CPLUS_H
#define COMPILE_COMPILE_CPLUS_H
-#include "common/enum-flags.h"
#include "gcc-cp-plugin.h"
+/* Local subdirectory includes. */
+#include "common/enum-flags.h"
+
struct type;
struct block;
diff --git a/gdb/compile/compile-loc2c.c b/gdb/compile/compile-loc2c.c
index b5682d80a55..b4c11f08e46 100644
--- a/gdb/compile/compile-loc2c.c
+++ b/gdb/compile/compile-loc2c.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 "compile-c.h"
+#include "compile-internal.h"
+#include "compile.h"
#include "dwarf2.h"
+
+/* Local subdirectory includes. */
+#include "common/gdb_vecs.h"
+
+/* Local includes. */
+#include "block.h"
+#include "dwarf2-frame.h"
#include "dwarf2expr.h"
#include "dwarf2loc.h"
#include "ui-file.h"
#include "utils.h"
-#include "compile-internal.h"
-#include "compile-c.h"
-#include "compile.h"
-#include "block.h"
-#include "dwarf2-frame.h"
-#include "common/gdb_vecs.h"
#include "value.h"
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index db8238dc1e1..6f08b7d6b35 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -18,21 +18,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "compile-object-load.h"
+#include "compile/compile-object-load.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "bfdlink.h"
#include "compile-internal.h"
-#include "command.h"
-#include "objfiles.h"
-#include "gdbcore.h"
+#include "compile.h"
#include "readline/tilde.h"
-#include "bfdlink.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "block.h"
+#include "command.h"
#include "gdbcmd.h"
-#include "regcache.h"
-#include "inferior.h"
+#include "gdbcore.h"
#include "gdbthread.h"
-#include "compile.h"
-#include "block.h"
-#include "arch-utils.h"
-#include <algorithm>
+#include "inferior.h"
+#include "objfiles.h"
+#include "regcache.h"
/* Add inferior mmap memory range ADDR..ADDR+SIZE (exclusive) to the
list. */
diff --git a/gdb/compile/compile-object-load.h b/gdb/compile/compile-object-load.h
index 730164faa43..9bf1523f924 100644
--- a/gdb/compile/compile-object-load.h
+++ b/gdb/compile/compile-object-load.h
@@ -17,9 +17,11 @@
#ifndef COMPILE_COMPILE_OBJECT_LOAD_H
#define COMPILE_COMPILE_OBJECT_LOAD_H
-#include "compile-internal.h"
#include <list>
+/* Local non-gdb includes. */
+#include "compile-internal.h"
+
struct munmap_list
{
public:
diff --git a/gdb/compile/compile-object-run.c b/gdb/compile/compile-object-run.c
index 82b839336ba..3693608d00c 100644
--- a/gdb/compile/compile-object-run.c
+++ b/gdb/compile/compile-object-run.c
@@ -18,15 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "compile-object-run.h"
-#include "value.h"
-#include "infcall.h"
-#include "objfiles.h"
+#include "compile/compile-object-run.h"
+
+/* Local non-gdb includes. */
#include "compile-internal.h"
-#include "dummy-frame.h"
+#include "compile.h"
+
+/* Local includes. */
#include "block.h"
+#include "dummy-frame.h"
+#include "infcall.h"
+#include "objfiles.h"
#include "valprint.h"
-#include "compile.h"
+#include "value.h"
/* Helper for do_module_cleanup. */
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index 72920642d16..3e2b5bea408 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -18,30 +18,36 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "top.h"
-#include "ui-out.h"
-#include "command.h"
+#include "compile/compile.h"
+
+/* Local non-gdb includes. */
+#include "compile-internal.h"
+#include "compile-object-load.h"
+#include "compile-object-run.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-script.h"
#include "cli/cli-utils.h"
+#include "common/filestuff.h"
+#include "common/gdb_optional.h"
+#include "common/gdb_unlinker.h"
+#include "common/gdb_wait.h"
+#include "common/pathstuff.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "block.h"
+#include "command.h"
#include "completer.h"
+#include "frame.h"
#include "gdbcmd.h"
-#include "compile.h"
-#include "compile-internal.h"
-#include "compile-object-load.h"
-#include "compile-object-run.h"
#include "language.h"
-#include "frame.h"
+#include "osabi.h"
#include "source.h"
-#include "block.h"
-#include "arch-utils.h"
-#include "common/filestuff.h"
#include "target.h"
-#include "osabi.h"
-#include "common/gdb_wait.h"
+#include "top.h"
+#include "ui-out.h"
#include "valprint.h"
-#include "common/gdb_optional.h"
-#include "common/gdb_unlinker.h"
-#include "common/pathstuff.h"
diff --git a/gdb/complaints.c b/gdb/complaints.c
index c5b5471ee18..84db8a998de 100644
--- a/gdb/complaints.c
+++ b/gdb/complaints.c
@@ -19,9 +19,13 @@
#include "defs.h"
#include "complaints.h"
+
+/* Standard C++ includes. */
+#include <unordered_map>
+
+/* Local includes. */
#include "command.h"
#include "gdbcmd.h"
-#include <unordered_map>
/* Map format strings to counters. */
diff --git a/gdb/completer.c b/gdb/completer.c
index d7cf4fd1203..da20911d4ea 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -17,20 +17,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+#include "completer.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "filenames.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-decode.h"
+#include "common/gdb_signals.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "expression.h"
-#include "filenames.h" /* For DOSish file names. */
+#include "gdbtypes.h"
#include "language.h"
-#include "common/gdb_signals.h"
-#include "target.h"
+#include "linespec.h"
+#include "location.h"
#include "reggroups.h"
+#include "symtab.h"
+#include "target.h"
#include "user-regs.h"
-#include "arch-utils.h"
-#include "location.h"
-#include <algorithm>
-#include "linespec.h"
-#include "cli/cli-decode.h"
/* FIXME: This is needed because of lookup_cmd_1 (). We should be
calling a hook instead so we eliminate the CLI dependency. */
diff --git a/gdb/completer.h b/gdb/completer.h
index 52f8d7dff4f..d115d6418f5 100644
--- a/gdb/completer.h
+++ b/gdb/completer.h
@@ -18,6 +18,8 @@
#define COMPLETER_H 1
#include "common/gdb_vecs.h"
+
+/* Local includes. */
#include "command.h"
/* Types of functions in struct match_list_displayer. */
diff --git a/gdb/continuations.c b/gdb/continuations.c
index 1feee32ebaa..79854e925a3 100644
--- a/gdb/continuations.c
+++ b/gdb/continuations.c
@@ -18,9 +18,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "continuations.h"
+
+/* Local includes. */
#include "gdbthread.h"
#include "inferior.h"
-#include "continuations.h"
struct continuation
{
diff --git a/gdb/corefile.c b/gdb/corefile.c
index bf859fbbb8d..417f594880c 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -18,20 +18,28 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include <signal.h>
+
+/* Standard C includes. */
#include <fcntl.h>
-#include "inferior.h"
-#include "symtab.h"
-#include "command.h"
-#include "gdbcmd.h"
+#include <signal.h>
+#include <sys/stat.h>
+
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "target.h"
-#include "gdbcore.h"
#include "dis-asm.h"
-#include <sys/stat.h>
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+
+/* Local includes. */
+#include "command.h"
#include "completer.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "inferior.h"
#include "observable.h"
-#include "cli/cli-utils.h"
+#include "symtab.h"
+#include "target.h"
/* You can have any number of hooks for `exec_file_command' command to
call. If there's only one hook, it is set in exec_file_display
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 7fb42970de4..fd0a6f9c326 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -18,31 +18,39 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include <signal.h>
+
+/* Standard C includes. */
#include <fcntl.h>
-#include "frame.h" /* required by inferior.h */
-#include "inferior.h"
-#include "infrun.h"
-#include "symtab.h"
-#include "command.h"
+#include <signal.h>
+
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "target.h"
-#include "process-stratum-target.h"
+#include "filenames.h"
+#include "readline/readline.h"
+
+/* Local subdirectory includes. */
+#include "common/filestuff.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "command.h"
+#include "completer.h"
+#include "exec.h"
+#include "frame.h"
+#include "gdb_bfd.h"
#include "gdbcore.h"
#include "gdbthread.h"
+#include "inferior.h"
+#include "infrun.h"
+#include "objfiles.h"
+#include "process-stratum-target.h"
+#include "progspace.h"
#include "regcache.h"
#include "regset.h"
-#include "symfile.h"
-#include "exec.h"
-#include "readline/readline.h"
#include "solib.h"
-#include "filenames.h"
-#include "progspace.h"
-#include "objfiles.h"
-#include "gdb_bfd.h"
-#include "completer.h"
-#include "common/filestuff.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c
index b858b190668..925952db15c 100644
--- a/gdb/cp-abi.c
+++ b/gdb/cp-abi.c
@@ -18,11 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "value.h"
#include "cp-abi.h"
+
+/* Local includes. */
#include "command.h"
#include "gdbcmd.h"
#include "ui-out.h"
+#include "value.h"
+
static struct cp_abi_ops *find_cp_abi (const char *short_name);
static struct cp_abi_ops current_cp_abi = { "", NULL };
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 5b352d1d77b..db69b488e3a 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -19,20 +19,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "cp-support.h"
-#include "gdb_obstack.h"
-#include "symtab.h"
-#include "symfile.h"
+
+/* Standard C++ includes. */
+#include <string>
+
+/* Local includes. */
#include "block.h"
-#include "objfiles.h"
-#include "gdbtypes.h"
-#include "dictionary.h"
+#include "buildsym.h"
#include "command.h"
+#include "cp-support.h"
+#include "dictionary.h"
#include "frame.h"
-#include "buildsym.h"
+#include "gdb_obstack.h"
+#include "gdbtypes.h"
#include "language.h"
#include "namespace.h"
-#include <string>
+#include "objfiles.h"
+#include "symfile.h"
+#include "symtab.h"
static struct block_symbol
cp_lookup_nested_symbol_1 (struct type *container_type,
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index b79dd5c086f..4ef4e34e3af 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -20,23 +20,31 @@
#include "defs.h"
#include "cp-support.h"
+
+/* Standard C includes. */
+#include <signal.h>
+
+/* Local non-gdb includes. */
#include "demangle.h"
-#include "gdbcmd.h"
-#include "dictionary.h"
-#include "objfiles.h"
-#include "frame.h"
-#include "symtab.h"
+#include "safe-ctype.h"
+
+/* Local subdirectory includes. */
+#include "common/gdb_setjmp.h"
+#include "common/selftest.h"
+
+/* Local includes. */
#include "block.h"
#include "complaints.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "value.h"
#include "cp-abi.h"
+#include "dictionary.h"
+#include "expression.h"
+#include "frame.h"
+#include "gdbcmd.h"
+#include "gdbtypes.h"
#include "namespace.h"
-#include <signal.h>
-#include "common/gdb_setjmp.h"
-#include "safe-ctype.h"
-#include "common/selftest.h"
+#include "objfiles.h"
+#include "symtab.h"
+#include "value.h"
#define d_left(dc) (dc)->u.s_binary.left
#define d_right(dc) (dc)->u.s_binary.right
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 443c3b06dac..0064281352b 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -18,24 +18,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdb_obstack.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "value.h"
-#include "command.h"
-#include "gdbcmd.h"
+
+/* Local non-gdb includes. */
#include "demangle.h"
+
+/* Local subdirectory includes. */
+#include "common/byte-vector.h"
+
+/* Local includes. */
#include "annotate.h"
#include "c-lang.h"
-#include "target.h"
+#include "command.h"
#include "cp-abi.h"
-#include "valprint.h"
#include "cp-support.h"
-#include "language.h"
+#include "expression.h"
#include "extension.h"
+#include "gdb_obstack.h"
+#include "gdbcmd.h"
+#include "gdbtypes.h"
+#include "language.h"
+#include "symtab.h"
+#include "target.h"
#include "typeprint.h"
-#include "common/byte-vector.h"
+#include "valprint.h"
+#include "value.h"
/* Controls printing of vtbl's. */
static void
diff --git a/gdb/cris-linux-tdep.c b/gdb/cris-linux-tdep.c
index 27681cb8b27..e8a83926d1c 100644
--- a/gdb/cris-linux-tdep.c
+++ b/gdb/cris-linux-tdep.c
@@ -22,13 +22,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
+
+/* Local includes. */
+#include "cris-tdep.h"
#include "linux-tdep.h"
+#include "osabi.h"
#include "solib-svr4.h"
#include "symtab.h"
-#include "cris-tdep.h"
-
static void
cris_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 8eda05806f8..187e5f7d079 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -21,30 +21,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "trad-frame.h"
+#include "cris-tdep.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "opcode/cris.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "dwarf2-frame.h"
-#include "symtab.h"
-#include "inferior.h"
-#include "gdbtypes.h"
-#include "gdbcore.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcmd.h"
-#include "target.h"
-#include "value.h"
-#include "opcode/cris.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "inferior.h"
+#include "objfiles.h"
#include "osabi.h"
-#include "arch-utils.h"
#include "regcache.h"
-
-#include "objfiles.h"
-
-#include "solib.h" /* Support for shared libraries. */
#include "solib-svr4.h"
-#include "dis-asm.h"
-
-#include "cris-tdep.h"
+#include "solib.h"
+#include "symtab.h"
+#include "target.h"
+#include "trad-frame.h"
+#include "value.h"
enum cris_num_regs
{
diff --git a/gdb/csky-linux-tdep.c b/gdb/csky-linux-tdep.c
index ab4af9f6f15..7306a72a228 100644
--- a/gdb/csky-linux-tdep.c
+++ b/gdb/csky-linux-tdep.c
@@ -20,15 +20,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
+
+/* Local includes. */
+#include "csky-tdep.h"
+#include "gdbarch.h"
#include "glibc-tdep.h"
#include "linux-tdep.h"
-#include "gdbarch.h"
-#include "solib-svr4.h"
+#include "osabi.h"
#include "regset.h"
+#include "solib-svr4.h"
#include "trad-frame.h"
#include "tramp-frame.h"
-#include "csky-tdep.h"
/* Functions, definitions, and data structures for C-Sky core file debug. */
diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c
index cd7d8c5a0b1..b7da65d5ecc 100644
--- a/gdb/csky-tdep.c
+++ b/gdb/csky-tdep.c
@@ -20,43 +20,51 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "csky-tdep.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+#include <vector>
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "elf-bfd.h"
+#include "elf/csky.h"
+#include "floatformat.h"
+#include "opcode/csky.h"
+#include "symcat.h"
+
+/* Local subdirectory includes. */
#include "common/gdb_assert.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "block.h"
+#include "dwarf2-frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-#include "value.h"
#include "gdbcmd.h"
-#include "language.h"
#include "gdbcore.h"
-#include "symfile.h"
-#include "objfiles.h"
#include "gdbtypes.h"
-#include "target.h"
-#include "arch-utils.h"
-#include "regcache.h"
+#include "infcall.h"
+#include "inferior.h"
+#include "language.h"
+#include "objfiles.h"
#include "osabi.h"
-#include "block.h"
+#include "regcache.h"
#include "reggroups.h"
-#include "elf/csky.h"
-#include "elf-bfd.h"
-#include "symcat.h"
-#include "sim-regno.h"
-#include "dis-asm.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "trad-frame.h"
-#include "infcall.h"
-#include "floatformat.h"
+#include "regset.h"
#include "remote.h"
+#include "sim-regno.h"
+#include "symfile.h"
+#include "symtab.h"
#include "target-descriptions.h"
-#include "dwarf2-frame.h"
+#include "target.h"
+#include "trad-frame.h"
#include "user-regs.h"
#include "valprint.h"
-#include "csky-tdep.h"
-#include "regset.h"
-#include "opcode/csky.h"
-#include <algorithm>
-#include <vector>
+#include "value.h"
/* Control debugging information emitted in this file. */
static int csky_debug = 0;
diff --git a/gdb/ctf.c b/gdb/ctf.c
index 7a95df78152..e5d92c6339e 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -21,17 +21,25 @@
#include "defs.h"
#include "ctf.h"
-#include "tracepoint.h"
-#include "regcache.h"
+
+/* Standard C includes. */
+#include <ctype.h>
#include <sys/stat.h>
-#include "exec.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local subdirectory includes. */
+#include "common/filestuff.h"
+
+/* Local includes. */
#include "completer.h"
-#include "inferior.h"
+#include "exec.h"
#include "gdbthread.h"
+#include "inferior.h"
+#include "regcache.h"
#include "tracefile.h"
-#include <ctype.h>
-#include <algorithm>
-#include "common/filestuff.h"
+#include "tracepoint.h"
/* The CTF target. */
diff --git a/gdb/d-lang.c b/gdb/d-lang.c
index 637e012b32e..dcbaab04120 100644
--- a/gdb/d-lang.c
+++ b/gdb/d-lang.c
@@ -18,13 +18,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "language.h"
-#include "varobj.h"
#include "d-lang.h"
-#include "c-lang.h"
+
+/* Local non-gdb includes. */
#include "demangle.h"
+
+/* Local includes. */
+#include "c-lang.h"
#include "cp-support.h"
+#include "language.h"
+#include "symtab.h"
+#include "varobj.h"
/* The name of the symbol to use to get the name of the main subprogram. */
static const char D_MAIN[] = "D main";
diff --git a/gdb/d-namespace.c b/gdb/d-namespace.c
index 4edef188e9e..590f630d911 100644
--- a/gdb/d-namespace.c
+++ b/gdb/d-namespace.c
@@ -18,12 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
+
+/* Local includes. */
#include "block.h"
-#include "language.h"
-#include "namespace.h"
#include "d-lang.h"
#include "gdb_obstack.h"
+#include "language.h"
+#include "namespace.h"
+#include "symtab.h"
/* This returns the length of first component of NAME, which should be
the demangled name of a D variable/function/method/etc.
diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c
index 54652364a8f..a0c50365c17 100644
--- a/gdb/d-valprint.c
+++ b/gdb/d-valprint.c
@@ -18,10 +18,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbtypes.h"
-#include "gdbcore.h"
-#include "d-lang.h"
+
+/* Local includes. */
#include "c-lang.h"
+#include "d-lang.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
/* Assuming that TYPE is a TYPE_CODE_STRUCT, verify that TYPE is a
dynamic array, and then print its value to STREAM. Return zero if
diff --git a/gdb/darwin-nat-info.c b/gdb/darwin-nat-info.c
index ca3b2e87252..30999efa970 100644
--- a/gdb/darwin-nat-info.c
+++ b/gdb/darwin-nat-info.c
@@ -28,24 +28,25 @@
Tiger is no longer important. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "gdbcore.h"
-#include "value.h"
-#include "gdbcmd.h"
-#include "inferior.h"
+/* Standard C includes. */
+#include <mach/mach_init.h>
+#include <mach/mach_port.h>
+#include <mach/mach_vm.h>
+#include <mach/task.h>
+#include <mach/thread_act.h>
+#include <mach/thread_info.h>
+#include <mach/vm_map.h>
#include <sys/sysctl.h>
+/* Local includes. */
#include "darwin-nat.h"
-
-#include <mach/thread_info.h>
-#include <mach/thread_act.h>
-#include <mach/task.h>
-#include <mach/vm_map.h>
-#include <mach/mach_port.h>
-#include <mach/mach_init.h>
-#include <mach/mach_vm.h>
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "inferior.h"
+#include "symtab.h"
+#include "value.h"
#define CHECK_ARGS(what, args) do { \
if ((NULL == args) || ((args[0] != '0') && (args[1] != 'x'))) \
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 6247b0656c9..65e93fec040 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -19,56 +19,61 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "top.h"
-#include "inferior.h"
-#include "target.h"
-#include "symfile.h"
-#include "symtab.h"
-#include "objfiles.h"
-#include "gdbcmd.h"
-#include "gdbcore.h"
-#include "gdbthread.h"
-#include "regcache.h"
-#include "event-top.h"
-#include "inf-loop.h"
-#include <sys/stat.h>
-#include "inf-child.h"
-#include "value.h"
-#include "arch-utils.h"
-#include "bfd.h"
-#include "bfd/mach-o.h"
+#include "darwin-nat.h"
+/* Standard C includes. */
#include <copyfile.h>
-#include <sys/ptrace.h>
-#include <sys/signal.h>
-#include <setjmp.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <signal.h>
#include <ctype.h>
-#include <sys/sysctl.h>
-#include <sys/proc.h>
#include <libproc.h>
-#include <sys/syscall.h>
-#include <spawn.h>
-
#include <mach/mach_error.h>
-#include <mach/mach_vm.h>
#include <mach/mach_init.h>
-#include <mach/vm_map.h>
-#include <mach/task.h>
#include <mach/mach_port.h>
-#include <mach/thread_act.h>
+#include <mach/mach_vm.h>
#include <mach/port.h>
+#include <mach/task.h>
+#include <mach/thread_act.h>
+#include <mach/vm_map.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <spawn.h>
+#include <sys/proc.h>
+#include <sys/ptrace.h>
+#include <sys/signal.h>
+#include <sys/stat.h>
+#include <sys/syscall.h>
+#include <sys/sysctl.h>
+#include <sys/types.h>
+#include <unistd.h>
-#include "darwin-nat.h"
+/* Local non-gdb includes. */
+#include "bfd.h"
+#include "bfd/mach-o.h"
#include "filenames.h"
+
+/* Local subdirectory includes. */
#include "common/filestuff.h"
#include "common/gdb_unlinker.h"
#include "common/pathstuff.h"
#include "common/scoped_fd.h"
#include "nat/fork-inferior.h"
+/* Local includes. */
+#include "arch-utils.h"
+#include "event-top.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "inf-child.h"
+#include "inf-loop.h"
+#include "inferior.h"
+#include "objfiles.h"
+#include "regcache.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
+#include "top.h"
+#include "value.h"
+
/* Quick overview.
Darwin kernel is Mach + BSD derived kernel. Note that they share the
same memory space and are linked together (ie there is no micro-kernel).
diff --git a/gdb/darwin-nat.h b/gdb/darwin-nat.h
index 9091efd88f1..f42517f716b 100644
--- a/gdb/darwin-nat.h
+++ b/gdb/darwin-nat.h
@@ -17,9 +17,11 @@
#ifndef DARWIN_NAT_H
#define DARWIN_NAT_H
-#include "inf-child.h"
#include <mach/mach.h>
+
+/* Local includes. */
#include "gdbthread.h"
+#include "inf-child.h"
/* This needs to be overridden by the platform specific nat code. */
diff --git a/gdb/dcache.c b/gdb/dcache.c
index 5a2e8f8000b..b8ad24db2f0 100644
--- a/gdb/dcache.c
+++ b/gdb/dcache.c
@@ -19,11 +19,15 @@
#include "defs.h"
#include "dcache.h"
+
+/* Local non-gdb includes. */
+#include "splay-tree.h"
+
+/* Local includes. */
#include "gdbcmd.h"
#include "gdbcore.h"
-#include "target-dcache.h"
#include "inferior.h"
-#include "splay-tree.h"
+#include "target-dcache.h"
/* Commands with a prefix of `{set,show} dcache'. */
static struct cmd_list_element *dcache_set_list = NULL;
diff --git a/gdb/dcache.h b/gdb/dcache.h
index 9c29074c919..97ed5362303 100644
--- a/gdb/dcache.h
+++ b/gdb/dcache.h
@@ -21,7 +21,7 @@
#ifndef DCACHE_H
#define DCACHE_H
-#include "target.h" /* for enum target_xfer_status */
+#include "target.h"
typedef struct dcache_struct DCACHE;
diff --git a/gdb/demangle.c b/gdb/demangle.c
index 29f46968a29..aae578120f9 100644
--- a/gdb/demangle.c
+++ b/gdb/demangle.c
@@ -24,11 +24,17 @@
to a styles of demangling, and GDB specific. */
#include "defs.h"
-#include "cli/cli-utils.h" /* for skip_to_space */
-#include "command.h"
-#include "gdbcmd.h"
+
+/* Local non-gdb includes. */
#include "demangle.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+
+/* Local includes. */
+#include "command.h"
#include "gdb-demangle.h"
+#include "gdbcmd.h"
#include "language.h"
/* Select the default C++ demangling style to use. The default is "auto",
diff --git a/gdb/dicos-tdep.c b/gdb/dicos-tdep.c
index bacba963685..cac92ae3496 100644
--- a/gdb/dicos-tdep.c
+++ b/gdb/dicos-tdep.c
@@ -18,11 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "dicos-tdep.h"
+
+/* Local includes. */
+#include "inferior.h"
#include "osabi.h"
-#include "solib.h"
#include "solib-target.h"
-#include "inferior.h"
-#include "dicos-tdep.h"
+#include "solib.h"
void
dicos_init_abi (struct gdbarch *gdbarch)
diff --git a/gdb/dictionary.c b/gdb/dictionary.c
index 88eff2fa439..56b2766a38f 100644
--- a/gdb/dictionary.c
+++ b/gdb/dictionary.c
@@ -21,13 +21,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "dictionary.h"
+
+/* Standard C includes. */
#include <ctype.h>
+
+/* Standard C++ includes. */
+#include <unordered_map>
+
+/* Local non-gdb includes. */
+#include "safe-ctype.h"
+
+/* Local includes. */
+#include "buildsym.h"
#include "gdb_obstack.h"
#include "symtab.h"
-#include "buildsym.h"
-#include "dictionary.h"
-#include "safe-ctype.h"
-#include <unordered_map>
/* This file implements dictionaries, which are tables that associate
symbols to names. They are represented by an opaque type 'struct
diff --git a/gdb/disasm-selftests.c b/gdb/disasm-selftests.c
index 48b466baf13..a1d14eb5907 100644
--- a/gdb/disasm-selftests.c
+++ b/gdb/disasm-selftests.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "disasm.h"
#if GDB_SELF_TEST
diff --git a/gdb/disasm.c b/gdb/disasm.c
index 7c7a148935e..68640e5279d 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -18,19 +18,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "target.h"
-#include "value.h"
-#include "ui-out.h"
#include "disasm.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "dis-asm.h"
-#include "source.h"
#include "safe-ctype.h"
-#include <algorithm>
+
+/* Local subdirectory includes. */
#include "common/gdb_optional.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "source.h"
+#include "target.h"
+#include "ui-out.h"
#include "valprint.h"
+#include "value.h"
/* Disassemble functions.
FIXME: We should get rid of all the duplicate code in gdb that does
diff --git a/gdb/disasm.h b/gdb/disasm.h
index d3cc6312093..97b843eee11 100644
--- a/gdb/disasm.h
+++ b/gdb/disasm.h
@@ -20,6 +20,8 @@
#define DISASM_H
#include "dis-asm.h"
+
+/* Local subdirectory includes. */
#include "common/enum-flags.h"
enum gdb_disassembly_flag
diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c
index 527e0f0cd57..a7215da7a2d 100644
--- a/gdb/dtrace-probe.c
+++ b/gdb/dtrace-probe.c
@@ -20,19 +20,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "probe.h"
-#include "common/vec.h"
+
+/* Local non-gdb includes. */
#include "elf-bfd.h"
-#include "gdbtypes.h"
#include "obstack.h"
-#include "objfiles.h"
-#include "complaints.h"
-#include "value.h"
-#include "ax.h"
+
+/* Local subdirectory includes. */
+#include "common/vec.h"
+
+/* Local includes. */
#include "ax-gdb.h"
+#include "ax.h"
+#include "complaints.h"
+#include "gdbtypes.h"
+#include "inferior.h"
#include "language.h"
+#include "objfiles.h"
#include "parser-defs.h"
-#include "inferior.h"
+#include "probe.h"
+#include "value.h"
/* The type of the ELF sections where we will find the DOF programs
with information about probes. */
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index aebdd233d74..07f1fe51bb9 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -20,15 +20,17 @@
#include "defs.h"
#include "dummy-frame.h"
-#include "regcache.h"
-#include "frame.h"
-#include "inferior.h"
-#include "frame-unwind.h"
+
+/* Local includes. */
#include "command.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcmd.h"
-#include "observable.h"
#include "gdbthread.h"
#include "infcall.h"
+#include "inferior.h"
+#include "observable.h"
+#include "regcache.h"
struct dummy_frame_id
{
diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c
index 445f8b199e6..0553c7e58ce 100644
--- a/gdb/dwarf-index-cache.c
+++ b/gdb/dwarf-index-cache.c
@@ -20,17 +20,24 @@
#include "defs.h"
#include "dwarf-index-cache.h"
-#include "build-id.h"
+/* Standard C includes. */
+#include <stdlib.h>
+
+/* Standard C++ includes. */
+#include <string>
+
+/* Local subdirectory includes. */
#include "cli/cli-cmds.h"
-#include "command.h"
-#include "common/scoped_mmap.h"
#include "common/pathstuff.h"
+#include "common/scoped_mmap.h"
+#include "common/selftest.h"
+
+/* Local includes. */
+#include "build-id.h"
+#include "command.h"
#include "dwarf-index-write.h"
#include "dwarf2read.h"
#include "objfiles.h"
-#include "common/selftest.h"
-#include <string>
-#include <stdlib.h>
/* When set to 1, show debug messages about the index cache. */
static int debug_index_cache = 0;
diff --git a/gdb/dwarf-index-cache.h b/gdb/dwarf-index-cache.h
index 2f267632141..7916c445e7d 100644
--- a/gdb/dwarf-index-cache.h
+++ b/gdb/dwarf-index-cache.h
@@ -20,8 +20,10 @@
#ifndef DWARF_INDEX_CACHE_H
#define DWARF_INDEX_CACHE_H
-#include "dwarf-index-common.h"
#include "common/array-view.h"
+
+/* Local includes. */
+#include "dwarf-index-common.h"
#include "symfile.h"
/* Base of the classes used to hold the resources of the indices loaded from
diff --git a/gdb/dwarf-index-write.c b/gdb/dwarf-index-write.c
index 01c1256bcb6..9260094c663 100644
--- a/gdb/dwarf-index-write.c
+++ b/gdb/dwarf-index-write.c
@@ -18,29 +18,36 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "dwarf-index-write.h"
-#include "addrmap.h"
+/* Standard C++ includes. */
+#include <algorithm>
+#include <cmath>
+#include <set>
+#include <unordered_map>
+#include <unordered_set>
+
+/* Local non-gdb includes. */
+#include "dwarf2.h"
+#include "gdb/gdb-index.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-decode.h"
#include "common/byte-vector.h"
#include "common/filestuff.h"
#include "common/gdb_unlinker.h"
#include "common/pathstuff.h"
#include "common/scoped_fd.h"
+
+/* Local includes. */
+#include "addrmap.h"
#include "complaints.h"
#include "dwarf-index-common.h"
-#include "dwarf2.h"
#include "dwarf2read.h"
-#include "gdb/gdb-index.h"
#include "gdbcmd.h"
#include "objfiles.h"
#include "psympriv.h"
-#include <algorithm>
-#include <cmath>
-#include <set>
-#include <unordered_map>
-#include <unordered_set>
-
/* Ensure only legit values are used. */
#define DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE(cu_index, value) \
do { \
diff --git a/gdb/dwarf-index-write.h b/gdb/dwarf-index-write.h
index b1d1180c8e3..2d6248035a6 100644
--- a/gdb/dwarf-index-write.h
+++ b/gdb/dwarf-index-write.h
@@ -20,8 +20,8 @@
#ifndef DWARF_INDEX_WRITE_H
#define DWARF_INDEX_WRITE_H
-#include "symfile.h"
#include "dwarf2read.h"
+#include "symfile.h"
/* Create an index file for OBJFILE in the directory DIR. BASENAME is the
desired filename, minus the extension, which gets added by this function
diff --git a/gdb/dwarf2-frame-tailcall.c b/gdb/dwarf2-frame-tailcall.c
index 4cf7f5ff63a..8041b467b89 100644
--- a/gdb/dwarf2-frame-tailcall.c
+++ b/gdb/dwarf2-frame-tailcall.c
@@ -18,16 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
#include "dwarf2-frame-tailcall.h"
+
+/* Local non-gdb includes. */
+#include "hashtab.h"
+
+/* Local includes. */
+#include "block.h"
+#include "dwarf2-frame.h"
#include "dwarf2loc.h"
#include "frame-unwind.h"
-#include "block.h"
-#include "hashtab.h"
+#include "frame.h"
#include "gdbtypes.h"
#include "regcache.h"
#include "value.h"
-#include "dwarf2-frame.h"
/* Contains struct tailcall_cache indexed by next_bottom_frame. */
static htab_t cache_htab;
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 178ac44ecbe..0c59a612d64 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -20,25 +20,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "dwarf2expr.h"
+#include "dwarf2-frame.h"
+
+/* Local non-gdb includes. */
#include "dwarf2.h"
-#include "frame.h"
+
+/* Local includes. */
+#include "ax.h"
+#include "complaints.h"
+#include "dwarf2-frame-tailcall.h"
+#include "dwarf2expr.h"
+#include "dwarf2loc.h"
+#include "dwarf2read.h"
#include "frame-base.h"
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
#include "gdbtypes.h"
-#include "symtab.h"
#include "objfiles.h"
+#include "record.h"
#include "regcache.h"
+#include "symtab.h"
#include "value.h"
-#include "record.h"
-#include "complaints.h"
-#include "dwarf2-frame.h"
-#include "dwarf2read.h"
-#include "ax.h"
-#include "dwarf2loc.h"
-#include "dwarf2-frame-tailcall.h"
#if GDB_SELF_TEST
#include "common/selftest.h"
#include "selftest-arch.h"
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index e412e182c01..430b2afbc47 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -20,15 +20,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "value.h"
-#include "gdbcore.h"
-#include "dwarf2.h"
#include "dwarf2expr.h"
-#include "dwarf2loc.h"
+
+/* Local non-gdb includes. */
+#include "dwarf2.h"
+
+/* Local subdirectory includes. */
#include "common/underlying.h"
+/* Local includes. */
+#include "dwarf2loc.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "symtab.h"
+#include "value.h"
+
/* Cookie for gdbarch data. */
static struct gdbarch_data *dwarf_arch_cookie;
diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h
index c7cbf32d5e7..01791b4a1fd 100644
--- a/gdb/dwarf2expr.h
+++ b/gdb/dwarf2expr.h
@@ -23,6 +23,8 @@
#define DWARF2EXPR_H
#include "leb128.h"
+
+/* Local includes. */
#include "gdbtypes.h"
/* The location of a value. */
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 29d289b4d0c..a9cde382fb4 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -20,30 +20,38 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "ui-out.h"
-#include "value.h"
-#include "frame.h"
-#include "gdbcore.h"
-#include "target.h"
-#include "inferior.h"
-#include "ax.h"
-#include "ax-gdb.h"
-#include "regcache.h"
-#include "objfiles.h"
-#include "block.h"
-#include "gdbcmd.h"
-#include "complaints.h"
-#include "dwarf2.h"
-#include "dwarf2expr.h"
#include "dwarf2loc.h"
-#include "dwarf2-frame.h"
-#include "compile/compile.h"
-#include "common/selftest.h"
+
+/* Standard C++ includes. */
#include <algorithm>
-#include <vector>
#include <unordered_set>
-#include "common/underlying.h"
+#include <vector>
+
+/* Local non-gdb includes. */
+#include "dwarf2.h"
+
+/* Local subdirectory includes. */
#include "common/byte-vector.h"
+#include "common/selftest.h"
+#include "common/underlying.h"
+#include "compile/compile.h"
+
+/* Local includes. */
+#include "ax-gdb.h"
+#include "ax.h"
+#include "block.h"
+#include "complaints.h"
+#include "dwarf2-frame.h"
+#include "dwarf2expr.h"
+#include "frame.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "inferior.h"
+#include "objfiles.h"
+#include "regcache.h"
+#include "target.h"
+#include "ui-out.h"
+#include "value.h"
extern int dwarf_always_disassemble;
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 658c86264bf..5e4d988b8c4 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -30,66 +30,76 @@
#include "defs.h"
#include "dwarf2read.h"
-#include "dwarf-index-cache.h"
-#include "dwarf-index-common.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+#include <cmath>
+#include <forward_list>
+#include <set>
+#include <unordered_map>
+#include <unordered_set>
+
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "elf-bfd.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "objfiles.h"
+#include "demangle.h"
#include "dwarf2.h"
+#include "elf-bfd.h"
+#include "filenames.h"
+#include "gdb/gdb-index.h"
+#include "hashtab.h"
+
+/* Local subdirectory includes. */
+#include "common/byte-vector.h"
+#include "common/filestuff.h"
+#include "common/function-view.h"
+#include "common/gdb_optional.h"
+#include "common/gdb_unlinker.h"
+#include "common/hash_enum.h"
+#include "common/pathstuff.h"
+#include "common/selftest.h"
+#include "common/underlying.h"
+#include "common/vec.h"
+
+/* Local includes. */
+#include "addrmap.h"
+#include "block.h"
+#include "build-id.h"
#include "buildsym.h"
-#include "demangle.h"
-#include "gdb-demangle.h"
-#include "expression.h"
-#include "filenames.h" /* for DOSish file names */
-#include "macrotab.h"
-#include "language.h"
+#include "c-lang.h"
+#include "command.h"
#include "complaints.h"
+#include "completer.h"
+#include "cp-support.h"
+#include "dwarf-index-cache.h"
+#include "dwarf-index-common.h"
#include "dwarf2expr.h"
#include "dwarf2loc.h"
-#include "cp-support.h"
-#include "hashtab.h"
-#include "command.h"
+#include "expression.h"
+#include "f-lang.h"
+#include "filename-seen-cache.h"
+#include "gdb-demangle.h"
+#include "gdb_bfd.h"
#include "gdbcmd.h"
-#include "block.h"
-#include "addrmap.h"
-#include "typeprint.h"
-#include "psympriv.h"
-#include <sys/stat.h>
-#include "completer.h"
-#include "common/vec.h"
-#include "c-lang.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
#include "go-lang.h"
-#include "valprint.h"
-#include "gdbcore.h" /* for gnutarget */
-#include "gdb/gdb-index.h"
-#include <ctype.h>
-#include "gdb_bfd.h"
-#include "f-lang.h"
-#include "source.h"
-#include "common/filestuff.h"
-#include "build-id.h"
+#include "language.h"
+#include "macrotab.h"
#include "namespace.h"
-#include "common/gdb_unlinker.h"
-#include "common/function-view.h"
-#include "common/gdb_optional.h"
-#include "common/underlying.h"
-#include "common/byte-vector.h"
-#include "common/hash_enum.h"
-#include "filename-seen-cache.h"
+#include "objfiles.h"
#include "producer.h"
-#include <fcntl.h>
-#include <sys/types.h>
-#include <algorithm>
-#include <unordered_set>
-#include <unordered_map>
-#include "common/selftest.h"
-#include <cmath>
-#include <set>
-#include <forward_list>
+#include "psympriv.h"
#include "rust-lang.h"
-#include "common/pathstuff.h"
+#include "source.h"
+#include "symtab.h"
+#include "typeprint.h"
+#include "valprint.h"
/* When == 1, print basic high level tracing messages.
When > 1, be more verbose.
diff --git a/gdb/dwarf2read.h b/gdb/dwarf2read.h
index 34c66167b5b..c42ee882967 100644
--- a/gdb/dwarf2read.h
+++ b/gdb/dwarf2read.h
@@ -21,6 +21,8 @@
#define DWARF2READ_H
#include <unordered_map>
+
+/* Local includes. */
#include "dwarf-index-cache.h"
#include "filename-seen-cache.h"
#include "gdb_obstack.h"
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 55a16bb2f8e..20c47c24836 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -20,34 +20,38 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "bfd.h"
+#include "demangle.h"
#include "elf-bfd.h"
#include "elf/common.h"
#include "elf/internal.h"
#include "elf/mips.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "stabsread.h"
-#include "gdb-stabs.h"
-#include "complaints.h"
-#include "demangle.h"
-#include "psympriv.h"
#include "filenames.h"
-#include "probe.h"
+
+/* Local includes. */
#include "arch-utils.h"
+#include "auxv.h"
+#include "bcache.h"
+#include "build-id.h"
+#include "complaints.h"
+#include "gdb-stabs.h"
+#include "gdb_bfd.h"
+#include "gdbthread.h"
#include "gdbtypes.h"
-#include "value.h"
#include "infcall.h"
-#include "gdbthread.h"
#include "inferior.h"
-#include "regcache.h"
-#include "bcache.h"
-#include "gdb_bfd.h"
-#include "build-id.h"
#include "location.h"
-#include "auxv.h"
#include "mdebugread.h"
+#include "objfiles.h"
+#include "probe.h"
+#include "psympriv.h"
+#include "regcache.h"
+#include "stabsread.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "value.h"
/* Forward declarations. */
extern const struct sym_fns elf_sym_fns_gdb_index;
diff --git a/gdb/eval.c b/gdb/eval.c
index 9d8eb3476ba..f3104971c51 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -18,29 +18,33 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "value.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local includes. */
+#include "block.h"
+#include "cp-abi.h"
+#include "cp-support.h"
#include "expression.h"
-#include "target.h"
+#include "f-lang.h"
#include "frame.h"
+#include "gdb_obstack.h"
#include "gdbthread.h"
-#include "language.h" /* For CAST_IS_CONVERSION. */
-#include "f-lang.h" /* For array bound stuff. */
-#include "cp-abi.h"
+#include "gdbtypes.h"
#include "infcall.h"
+#include "language.h"
#include "objc-lang.h"
-#include "block.h"
+#include "objfiles.h"
#include "parser-defs.h"
-#include "cp-support.h"
-#include "ui-out.h"
#include "regcache.h"
+#include "symtab.h"
+#include "target.h"
+#include "typeprint.h"
+#include "ui-out.h"
#include "user-regs.h"
#include "valprint.h"
-#include "gdb_obstack.h"
-#include "objfiles.h"
-#include "typeprint.h"
-#include <ctype.h>
+#include "value.h"
/* This is defined in valops.c */
extern int overload_resolution;
diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index 28e81646fbd..af76db4fd29 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -19,8 +19,12 @@
#include "defs.h"
#include "event-loop.h"
-#include "event-top.h"
+
+/* Local subdirectory includes. */
#include "common/queue.h"
+
+/* Local includes. */
+#include "event-top.h"
#include "ser-event.h"
#ifdef HAVE_POLL
diff --git a/gdb/event-top.c b/gdb/event-top.c
index fb5d51c6e10..33bd2492129 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -20,26 +20,32 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "top.h"
+#include "event-top.h"
+
+/* Standard C includes. */
+#include <signal.h>
+
+/* Local subdirectory includes. */
+#include "cli/cli-script.h"
+#include "common/buffer.h"
+
+/* Local includes. */
+#include "annotate.h"
+#include "continuations.h"
+#include "event-loop.h"
+#include "gdb_select.h"
+#include "gdbcmd.h"
+#include "gdbthread.h"
#include "inferior.h"
#include "infrun.h"
-#include "target.h"
-#include "terminal.h" /* for job_control */
-#include "event-loop.h"
-#include "event-top.h"
#include "interps.h"
-#include <signal.h>
-#include "cli/cli-script.h" /* for reset_command_nest_depth */
#include "main.h"
-#include "gdbthread.h"
-#include "observable.h"
-#include "continuations.h"
-#include "gdbcmd.h" /* for dont_repeat() */
-#include "annotate.h"
#include "maint.h"
-#include "common/buffer.h"
+#include "observable.h"
#include "ser-event.h"
-#include "gdb_select.h"
+#include "target.h"
+#include "terminal.h"
+#include "top.h"
/* readline include files. */
#include "readline/readline.h"
diff --git a/gdb/exceptions.c b/gdb/exceptions.c
index a29ef0cde50..8594bf66443 100644
--- a/gdb/exceptions.c
+++ b/gdb/exceptions.c
@@ -19,15 +19,19 @@
#include "defs.h"
#include "exceptions.h"
+
+/* Local subdirectory includes. */
+#include "common/gdb_optional.h"
+
+/* Local includes. */
+#include "annotate.h"
#include "breakpoint.h"
-#include "target.h"
+#include "gdbthread.h"
#include "inferior.h"
-#include "annotate.h"
-#include "ui-out.h"
#include "serial.h"
-#include "gdbthread.h"
+#include "target.h"
#include "top.h"
-#include "common/gdb_optional.h"
+#include "ui-out.h"
static void
print_flush (void)
diff --git a/gdb/exec.c b/gdb/exec.c
index 77bd140a8e8..55569519ed6 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -18,34 +18,42 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "exec.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "filenames.h"
+#include "readline/readline.h"
+
+/* Local subdirectory includes. */
+#include "common/pathstuff.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "completer.h"
#include "frame.h"
-#include "inferior.h"
-#include "target.h"
+#include "gcore.h"
+#include "gdb_bfd.h"
#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "inferior.h"
#include "language.h"
-#include "filenames.h"
-#include "symfile.h"
#include "objfiles.h"
-#include "completer.h"
-#include "value.h"
-#include "exec.h"
#include "observable.h"
-#include "arch-utils.h"
-#include "gdbthread.h"
#include "progspace.h"
-#include "gdb_bfd.h"
-#include "gcore.h"
-#include "source.h"
-
-#include <fcntl.h>
-#include "readline/readline.h"
-#include "gdbcore.h"
-
-#include <ctype.h>
-#include <sys/stat.h>
#include "solist.h"
-#include <algorithm>
-#include "common/pathstuff.h"
+#include "source.h"
+#include "symfile.h"
+#include "target.h"
+#include "value.h"
void (*deprecated_file_changed_hook) (const char *);
diff --git a/gdb/exec.h b/gdb/exec.h
index e9af4802872..3778a7e32f1 100644
--- a/gdb/exec.h
+++ b/gdb/exec.h
@@ -20,10 +20,10 @@
#ifndef EXEC_H
#define EXEC_H
-#include "target.h"
-#include "progspace.h"
#include "memrange.h"
+#include "progspace.h"
#include "symfile-add-flags.h"
+#include "target.h"
struct target_section;
struct target_ops;
diff --git a/gdb/expprint.c b/gdb/expprint.c
index a22499f4833..1100062b61b 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -18,19 +18,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local includes. */
+#include "block.h"
#include "expression.h"
-#include "value.h"
+#include "gdbtypes.h"
#include "language.h"
+#include "objfiles.h"
#include "parser-defs.h"
-#include "user-regs.h" /* For user_reg_map_regnum_to_name. */
+#include "symtab.h"
#include "target.h"
-#include "block.h"
-#include "objfiles.h"
+#include "user-regs.h"
#include "valprint.h"
-
-#include <ctype.h>
+#include "value.h"
void
print_expression (struct expression *exp, struct ui_file *stream)
diff --git a/gdb/extension-priv.h b/gdb/extension-priv.h
index 97594f853a2..6f42ec18d93 100644
--- a/gdb/extension-priv.h
+++ b/gdb/extension-priv.h
@@ -21,10 +21,14 @@
#ifndef EXTENSION_PRIV_H
#define EXTENSION_PRIV_H
-#include "extension.h"
#include <signal.h>
+
+/* Local subdirectory includes. */
#include "cli/cli-script.h"
+/* Local includes. */
+#include "extension.h"
+
/* High level description of an extension/scripting language.
An entry for each is compiled into GDB regardless of whether the support
is present. This is done so that we can issue meaningful errors if the
diff --git a/gdb/extension.c b/gdb/extension.c
index 8637bc53f2e..16268551ab1 100644
--- a/gdb/extension.c
+++ b/gdb/extension.c
@@ -21,17 +21,23 @@
have "ext_lang" in the name, and no other symbol in gdb does. */
#include "defs.h"
+#include "extension.h"
+
+/* Standard C includes. */
#include <signal.h>
-#include "target.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-script.h"
+#include "guile/guile.h"
+#include "python/python.h"
+
+/* Local includes. */
#include "auto-load.h"
#include "breakpoint.h"
#include "event-top.h"
-#include "extension.h"
#include "extension-priv.h"
#include "observable.h"
-#include "cli/cli-script.h"
-#include "python/python.h"
-#include "guile/guile.h"
+#include "target.h"
/* Iterate over all external extension languages, regardless of whether the
support has been compiled in or not.
diff --git a/gdb/extension.h b/gdb/extension.h
index 2f1b71851c6..a77f1575ede 100644
--- a/gdb/extension.h
+++ b/gdb/extension.h
@@ -20,9 +20,9 @@
#ifndef EXTENSION_H
#define EXTENSION_H
-#include "mi/mi-cmds.h" /* For PRINT_NO_VALUES, etc. */
-#include "common/vec.h"
#include "common/array-view.h"
+#include "common/vec.h"
+#include "mi/mi-cmds.h"
struct breakpoint;
struct command_line;
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 7bd119690b4..4b6013642b9 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -21,22 +21,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+#include "f-lang.h"
+
+/* Standard C includes. */
+#include <math.h>
+
+/* Local includes. */
+#include "c-lang.h"
+#include "charset.h"
+#include "cp-support.h"
#include "expression.h"
-#include "parser-defs.h"
-#include "language.h"
-#include "varobj.h"
#include "gdbcore.h"
-#include "f-lang.h"
+#include "gdbtypes.h"
+#include "language.h"
+#include "parser-defs.h"
+#include "symtab.h"
+#include "target-float.h"
#include "valprint.h"
#include "value.h"
-#include "cp-support.h"
-#include "charset.h"
-#include "c-lang.h"
-#include "target-float.h"
-
-#include <math.h>
+#include "varobj.h"
/* Local functions */
diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index a0e34b3058d..76d670c7556 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -21,16 +21,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdb_obstack.h"
+
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+
+/* Local includes. */
#include "expression.h"
-#include "value.h"
+#include "f-lang.h"
+#include "gdb_obstack.h"
#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "symtab.h"
#include "target.h"
-#include "f-lang.h"
#include "typeprint.h"
+#include "value.h"
#if 0 /* Currently unused. */
static void f_type_print_args (struct type *, struct ui_file *);
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index 5f9dd4dedb8..e4217acd250 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -21,18 +21,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+
+/* Local includes. */
+#include "block.h"
+#include "command.h"
+#include "dictionary.h"
#include "expression.h"
-#include "value.h"
-#include "valprint.h"
-#include "language.h"
#include "f-lang.h"
#include "frame.h"
#include "gdbcore.h"
-#include "command.h"
-#include "block.h"
-#include "dictionary.h"
+#include "gdbtypes.h"
+#include "language.h"
+#include "symtab.h"
+#include "valprint.h"
+#include "value.h"
static void f77_get_dynamic_length_of_aggregate (struct type *);
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index d4f4c8cf359..cd08d921f44 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -18,33 +18,41 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/byte-vector.h"
-#include "gdbcore.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "regset.h"
-#include "gdbcmd.h"
-#include "gdbthread.h"
-#include "common/gdb_wait.h"
-#include "inf-ptrace.h"
-#include <sys/types.h>
+#include "fbsd-nat.h"
+
+/* Standard C includes. */
+#if defined(HAVE_KINFO_GETFILE) || defined(HAVE_KINFO_GETVMMAP)
+#include <libutil.h>
+#endif
#include <sys/procfs.h>
#include <sys/ptrace.h>
#include <sys/signal.h>
#include <sys/sysctl.h>
+#include <sys/types.h>
#include <sys/user.h>
-#if defined(HAVE_KINFO_GETFILE) || defined(HAVE_KINFO_GETVMMAP)
-#include <libutil.h>
-#endif
+
+/* Standard C++ includes. */
+#include <list>
+
+/* Local non-gdb includes. */
+#include "elf-bfd.h"
+
+/* Local subdirectory includes. */
+#include "common/byte-vector.h"
#if !defined(HAVE_KINFO_GETVMMAP)
#include "common/filestuff.h"
#endif
+#include "common/gdb_wait.h"
-#include "elf-bfd.h"
-#include "fbsd-nat.h"
+/* Local includes. */
#include "fbsd-tdep.h"
-
-#include <list>
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "inf-ptrace.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "regset.h"
/* Return the name of a file that can be opened to get the symbols for
the child process identified by PID. */
diff --git a/gdb/fbsd-nat.h b/gdb/fbsd-nat.h
index b0c9eb16c77..99a5c9b5ee7 100644
--- a/gdb/fbsd-nat.h
+++ b/gdb/fbsd-nat.h
@@ -20,9 +20,11 @@
#ifndef FBSD_NAT_H
#define FBSD_NAT_H
-#include "inf-ptrace.h"
#include <sys/proc.h>
+/* Local includes. */
+#include "inf-ptrace.h"
+
#ifdef TRAP_BRKPT
/* MIPS does not set si_code for SIGTRAP. sparc64 reports
non-standard values in si_code for SIGTRAP. */
diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c
index cd207d88bc3..6597c5f838e 100644
--- a/gdb/fbsd-tdep.c
+++ b/gdb/fbsd-tdep.c
@@ -18,19 +18,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "fbsd-tdep.h"
+
+/* Standard C includes. */
+#include <arpa/inet.h>
+#include <sys/socket.h>
+
+/* Local non-gdb includes. */
+#include "elf-bfd.h"
+
+/* Local includes. */
#include "auxv.h"
#include "gdbcore.h"
+#include "gdbthread.h"
#include "inferior.h"
+#include "objfiles.h"
#include "regcache.h"
#include "regset.h"
-#include "gdbthread.h"
-#include "objfiles.h"
#include "xml-syscall.h"
-#include <sys/socket.h>
-#include <arpa/inet.h>
-
-#include "elf-bfd.h"
-#include "fbsd-tdep.h"
/* This enum is derived from FreeBSD's <sys/signal.h>. */
diff --git a/gdb/features/aarch64-sve.c b/gdb/features/aarch64-sve.c
index 2166b4bb071..58eeea94c38 100644
--- a/gdb/features/aarch64-sve.c
+++ b/gdb/features/aarch64-sve.c
@@ -15,6 +15,9 @@
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"
+
+/* Local subdirectory includes. */
#include "common/tdesc.h"
/* This function is NOT auto generated from xml. Create the aarch64 with SVE
diff --git a/gdb/filename-seen-cache.c b/gdb/filename-seen-cache.c
index a8ea0858ac8..2d4826db88d 100644
--- a/gdb/filename-seen-cache.c
+++ b/gdb/filename-seen-cache.c
@@ -19,6 +19,8 @@
#include "defs.h"
#include "filename-seen-cache.h"
+
+/* Local non-gdb includes. */
#include "filenames.h"
/* Initial size of the table. It automagically grows from here. */
diff --git a/gdb/filename-seen-cache.h b/gdb/filename-seen-cache.h
index 824245e77e6..72534362d47 100644
--- a/gdb/filename-seen-cache.h
+++ b/gdb/filename-seen-cache.h
@@ -20,9 +20,11 @@
#ifndef FILENAME_SEEN_CACHE_H
#define FILENAME_SEEN_CACHE_H
-#include "defs.h"
#include "common/function-view.h"
+/* Local includes. */
+#include "defs.h"
+
/* Cache to watch for file names already seen. */
class filename_seen_cache
diff --git a/gdb/filesystem.c b/gdb/filesystem.c
index fdc4713007a..d6c4603badd 100644
--- a/gdb/filesystem.c
+++ b/gdb/filesystem.c
@@ -19,6 +19,8 @@
#include "defs.h"
#include "filesystem.h"
+
+/* Local includes. */
#include "gdbarch.h"
#include "gdbcmd.h"
diff --git a/gdb/findcmd.c b/gdb/findcmd.c
index 52f8f80aaae..1d01aa66dcd 100644
--- a/gdb/findcmd.c
+++ b/gdb/findcmd.c
@@ -18,15 +18,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "gdbcmd.h"
-#include "value.h"
-#include "target.h"
-#include "cli/cli-utils.h"
+
+/* Standard C++ includes. */
#include <algorithm>
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
#include "common/byte-vector.h"
+/* Local includes. */
+#include "arch-utils.h"
+#include "gdbcmd.h"
+#include "target.h"
+#include "value.h"
+
/* Copied from bfd_put_bits. */
static void
diff --git a/gdb/findvar.c b/gdb/findvar.c
index e89ee37ffc7..505c9d42f56 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -18,21 +18,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+
+/* Local subdirectory includes. */
+#include "common/selftest.h"
+
+/* Local includes. */
+#include "block.h"
+#include "dwarf2loc.h"
#include "frame.h"
-#include "value.h"
#include "gdbcore.h"
+#include "gdbtypes.h"
#include "inferior.h"
-#include "target.h"
-#include "symfile.h" /* for overlay functions */
+#include "language.h"
+#include "objfiles.h"
#include "regcache.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
#include "user-regs.h"
-#include "block.h"
-#include "objfiles.h"
-#include "language.h"
-#include "dwarf2loc.h"
-#include "common/selftest.h"
+#include "value.h"
/* Basic byte-swapping routines. All 'extract' functions return a
host-format integer from a target-format integer at ADDR which is
diff --git a/gdb/fork-child.c b/gdb/fork-child.c
index 4c49848830a..c8ce941eff0 100644
--- a/gdb/fork-child.c
+++ b/gdb/fork-child.c
@@ -20,15 +20,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
+
+/* Local subdirectory includes. */
+#include "common/common-inferior.h"
+#include "common/filestuff.h"
+#include "common/job-control.h"
+#include "nat/fork-inferior.h"
+
+/* Local includes. */
#include "gdbcmd.h"
-#include "terminal.h"
#include "gdbthread.h"
+#include "inferior.h"
+#include "terminal.h"
#include "top.h"
-#include "common/job-control.h"
-#include "common/filestuff.h"
-#include "nat/fork-inferior.h"
-#include "common/common-inferior.h"
/* The exec-wrapper, if any, that will be used when starting the
inferior. */
diff --git a/gdb/frame-base.c b/gdb/frame-base.c
index 47897fc653d..ea6a87f49bb 100644
--- a/gdb/frame-base.c
+++ b/gdb/frame-base.c
@@ -19,6 +19,8 @@
#include "defs.h"
#include "frame-base.h"
+
+/* Local includes. */
#include "frame.h"
#include "gdb_obstack.h"
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index e5ddeba9077..a9af1301815 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -18,14 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
#include "frame-unwind.h"
+
+/* Local includes. */
#include "dummy-frame.h"
+#include "frame.h"
+#include "gdb_obstack.h"
#include "inline-frame.h"
-#include "value.h"
#include "regcache.h"
-#include "gdb_obstack.h"
#include "target.h"
+#include "value.h"
static struct gdbarch_data *frame_unwind_data;
diff --git a/gdb/frame.c b/gdb/frame.c
index d8b5f819f1d..72596127abd 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -19,29 +19,33 @@
#include "defs.h"
#include "frame.h"
-#include "target.h"
-#include "value.h"
-#include "inferior.h" /* for inferior_ptid */
-#include "regcache.h"
-#include "user-regs.h"
-#include "gdb_obstack.h"
-#include "dummy-frame.h"
-#include "sentinel-frame.h"
-#include "gdbcore.h"
+
+/* Local non-gdb includes. */
+#include "hashtab.h"
+
+/* Local includes. */
#include "annotate.h"
-#include "language.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
+#include "block.h"
#include "command.h"
+#include "dummy-frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "gdb_obstack.h"
#include "gdbcmd.h"
-#include "observable.h"
-#include "objfiles.h"
+#include "gdbcore.h"
#include "gdbthread.h"
-#include "block.h"
+#include "inferior.h"
#include "inline-frame.h"
+#include "language.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "regcache.h"
+#include "sentinel-frame.h"
+#include "target.h"
#include "tracepoint.h"
-#include "hashtab.h"
+#include "user-regs.h"
#include "valprint.h"
+#include "value.h"
/* The sentinel frame terminates the innermost end of the frame chain.
If unwound, it returns the information needed to construct an
diff --git a/gdb/frv-linux-tdep.c b/gdb/frv-linux-tdep.c
index e5261455fd9..ea87084651b 100644
--- a/gdb/frv-linux-tdep.c
+++ b/gdb/frv-linux-tdep.c
@@ -19,18 +19,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
-#include "target.h"
-#include "frame.h"
-#include "osabi.h"
-#include "regcache.h"
+
+/* Local non-gdb includes. */
#include "elf-bfd.h"
#include "elf/frv.h"
-#include "frv-tdep.h"
-#include "trad-frame.h"
+
+/* Local includes. */
#include "frame-unwind.h"
-#include "regset.h"
+#include "frame.h"
+#include "frv-tdep.h"
+#include "gdbcore.h"
#include "linux-tdep.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
+#include "target.h"
+#include "trad-frame.h"
/* Define the size (in bytes) of an FR-V instruction. */
static const int frv_instr_size = 4;
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index 804206bcb37..d5aa35dfcdb 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -18,26 +18,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "arch-utils.h"
-#include "regcache.h"
-#include "frame.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "trad-frame.h"
+#include "frv-tdep.h"
+
+/* Local non-gdb includes. */
+#include "../opcodes/frv-desc.h"
#include "dis-asm.h"
-#include "sim-regno.h"
-#include "gdb/sim-frv.h"
-#include "../opcodes/frv-desc.h" /* for the H_SPR_... enums */
-#include "symtab.h"
#include "elf-bfd.h"
#include "elf/frv.h"
-#include "osabi.h"
+#include "gdb/sim-frv.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcore.h"
#include "infcall.h"
-#include "solib.h"
-#include "frv-tdep.h"
+#include "inferior.h"
#include "objfiles.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "sim-regno.h"
+#include "solib.h"
+#include "symtab.h"
+#include "trad-frame.h"
struct frv_unwind_cache /* was struct frame_extra_info */
{
diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c
index bded02fae4b..7b99928f378 100644
--- a/gdb/ft32-tdep.c
+++ b/gdb/ft32-tdep.c
@@ -18,30 +18,34 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
+#include "ft32-tdep.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "gdb/sim-ft32.h"
+#include "opcode/ft32.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "frame-base.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcmd.h"
#include "gdbcore.h"
-#include "value.h"
+#include "gdbtypes.h"
#include "inferior.h"
-#include "symfile.h"
+#include "language.h"
#include "objfiles.h"
#include "osabi.h"
-#include "language.h"
-#include "arch-utils.h"
+#include "record.h"
#include "regcache.h"
+#include "symfile.h"
+#include "symtab.h"
#include "trad-frame.h"
-#include "dis-asm.h"
-#include "record.h"
-
-#include "opcode/ft32.h"
-
-#include "ft32-tdep.h"
-#include "gdb/sim-ft32.h"
-#include <algorithm>
+#include "value.h"
#define RAM_BIAS 0x800000 /* Bias added to RAM addresses. */
diff --git a/gdb/gcore.c b/gdb/gcore.c
index 21d9ee88671..4a7cd471070 100644
--- a/gdb/gcore.c
+++ b/gdb/gcore.c
@@ -18,26 +18,36 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "gcore.h"
+
+/* Standard C includes. */
+#include <fcntl.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "elf-bfd.h"
+#include "readline/tilde.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-decode.h"
+#include "common/byte-vector.h"
+#include "common/gdb_unlinker.h"
+#include "common/scope-exit.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "completer.h"
+#include "gdb_bfd.h"
+#include "gdbcore.h"
#include "infcall.h"
#include "inferior.h"
-#include "gdbcore.h"
#include "objfiles.h"
-#include "solib.h"
-#include "symfile.h"
-#include "arch-utils.h"
-#include "completer.h"
-#include "gcore.h"
-#include "cli/cli-decode.h"
-#include <fcntl.h>
#include "regcache.h"
#include "regset.h"
-#include "gdb_bfd.h"
-#include "readline/tilde.h"
-#include <algorithm>
-#include "common/gdb_unlinker.h"
-#include "common/byte-vector.h"
-#include "common/scope-exit.h"
+#include "solib.h"
+#include "symfile.h"
/* The largest amount of memory to read from the target at once. We
must throttle it to limit the amount of memory used by GDB during
diff --git a/gdb/gdb.c b/gdb/gdb.c
index 09c05779025..9201fb7bb54 100644
--- a/gdb/gdb.c
+++ b/gdb/gdb.c
@@ -17,8 +17,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "main.h"
+
+/* Local includes. */
#include "interps.h"
+#include "main.h"
int
main (int argc, char **argv)
diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
index 5c6bbef551d..57435a5129e 100644
--- a/gdb/gdb_bfd.c
+++ b/gdb/gdb_bfd.c
@@ -19,11 +19,18 @@
#include "defs.h"
#include "gdb_bfd.h"
-#include "ui-out.h"
-#include "gdbcmd.h"
+
+/* Local non-gdb includes. */
#include "hashtab.h"
+
+/* Local subdirectory includes. */
#include "common/filestuff.h"
#include "common/vec.h"
+
+/* Local includes. */
+#include "gdbcmd.h"
+#include "ui-out.h"
+
#ifdef HAVE_MMAP
#include <sys/mman.h>
#ifndef MAP_FAILED
diff --git a/gdb/gdb_bfd.h b/gdb/gdb_bfd.h
index 87b48f51f7c..696e80f00e0 100644
--- a/gdb/gdb_bfd.h
+++ b/gdb/gdb_bfd.h
@@ -20,9 +20,11 @@
#ifndef GDB_BFD_H
#define GDB_BFD_H
-#include "registry.h"
#include "common/gdb_ref_ptr.h"
+/* Local includes. */
+#include "registry.h"
+
DECLARE_REGISTRY (bfd);
/* If supplied a path starting with this sequence, gdb_bfd_open will
diff --git a/gdb/gdb_regex.c b/gdb/gdb_regex.c
index 711f121c1dc..26669730dad 100644
--- a/gdb/gdb_regex.c
+++ b/gdb/gdb_regex.c
@@ -17,6 +17,8 @@
#include "defs.h"
#include "gdb_regex.h"
+
+/* Local subdirectory includes. */
#include "common/def-vector.h"
compiled_regex::compiled_regex (const char *regex, int cflags,
diff --git a/gdb/gdb_usleep.c b/gdb/gdb_usleep.c
index 25cc8e1b16c..1f139867f7b 100644
--- a/gdb/gdb_usleep.c
+++ b/gdb/gdb_usleep.c
@@ -17,9 +17,13 @@
#include "defs.h"
#include "gdb_usleep.h"
-#include "gdb_select.h"
+
+/* Local subdirectory includes. */
#include "common/gdb_sys_time.h"
+/* Local includes. */
+#include "gdb_select.h"
+
int
gdb_usleep (int usec)
{
diff --git a/gdb/gdbcmd.h b/gdb/gdbcmd.h
index 4614ec748c0..5576df9720e 100644
--- a/gdb/gdbcmd.h
+++ b/gdb/gdbcmd.h
@@ -24,9 +24,11 @@
#if !defined (GDBCMD_H)
#define GDBCMD_H 1
+#include "cli/cli-script.h"
+
+/* Local includes. */
#include "command.h"
#include "ui-out.h"
-#include "cli/cli-script.h"
/* Chain containing all defined commands. */
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 97bc3268fe6..ad537af9b5e 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,70 @@
+2019-03-30 Tom Tromey <tom@tromey.com>
+
+ * wincecompat.c: Sort headers.
+ * win32-low.c: Sort headers.
+ * win32-i386-low.c: Sort headers.
+ * win32-arm-low.c: Sort headers.
+ * utils.c: Sort headers.
+ * tracepoint.c: Sort headers.
+ * thread-db.c: Sort headers.
+ * tdesc.h: Sort headers.
+ * tdesc.c: Sort headers.
+ * target.h: Sort headers.
+ * target.c: Sort headers.
+ * symbol.c: Sort headers.
+ * spu-low.c: Sort headers.
+ * server.c: Sort headers.
+ * remote-utils.c: Sort headers.
+ * regcache.c: Sort headers.
+ * nto-x86-low.c: Sort headers.
+ * nto-low.c: Sort headers.
+ * notif.h: Sort headers.
+ * mem-break.c: Sort headers.
+ * lynx-ppc-low.c: Sort headers.
+ * lynx-low.c: Sort headers.
+ * lynx-i386-low.c: Sort headers.
+ * linux-xtensa-low.c: Sort headers.
+ * linux-x86-tdesc.c: Sort headers.
+ * linux-x86-tdesc-selftest.c: Sort headers.
+ * linux-x86-low.c: Sort headers.
+ * linux-tile-low.c: Sort headers.
+ * linux-tic6x-low.c: Sort headers.
+ * linux-sparc-low.c: Sort headers.
+ * linux-sh-low.c: Sort headers.
+ * linux-s390-low.c: Sort headers.
+ * linux-s390-ipa.c: Sort headers.
+ * linux-ppc-low.c: Sort headers.
+ * linux-ppc-ipa.c: Sort headers.
+ * linux-nios2-low.c: Sort headers.
+ * linux-mips-low.c: Sort headers.
+ * linux-m68k-low.c: Sort headers.
+ * linux-m32r-low.c: Sort headers.
+ * linux-low.h: Sort headers.
+ * linux-low.c: Sort headers.
+ * linux-ia64-low.c: Sort headers.
+ * linux-i386-ipa.c: Sort headers.
+ * linux-crisv32-low.c: Sort headers.
+ * linux-cris-low.c: Sort headers.
+ * linux-bfin-low.c: Sort headers.
+ * linux-arm-low.c: Sort headers.
+ * linux-amd64-ipa.c: Sort headers.
+ * linux-aarch64-tdesc.c: Sort headers.
+ * linux-aarch64-tdesc-selftest.c: Sort headers.
+ * linux-aarch64-low.c: Sort headers.
+ * linux-aarch64-ipa.c: Sort headers.
+ * linux-aarch32-low.c: Sort headers.
+ * inferiors.h: Sort headers.
+ * inferiors.c: Sort headers.
+ * i387-fp.c: Sort headers.
+ * hostio.c: Sort headers.
+ * hostio-errno.c: Sort headers.
+ * gdbthread.h: Sort headers.
+ * fork-child.c: Sort headers.
+ * event-loop.c: Sort headers.
+ * dll.c: Sort headers.
+ * debug.c: Sort headers.
+ * ax.c: Sort headers.
+
2019-03-28 Alan Hayward <alan.hayward@arm.com>
* linux-low.c (AT_HWCAP2): Add define if not already included.
diff --git a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c
index a16fba1ccd7..35a64a74f3f 100644
--- a/gdb/gdbserver/ax.c
+++ b/gdb/gdbserver/ax.c
@@ -18,10 +18,14 @@
#include "server.h"
#include "ax.h"
+
+/* Local subdirectory includes. */
#include "common/format.h"
-#include "tracepoint.h"
#include "common/rsp-low.h"
+/* Local includes. */
+#include "tracepoint.h"
+
static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
#ifdef IN_PROCESS_AGENT
diff --git a/gdb/gdbserver/debug.c b/gdb/gdbserver/debug.c
index a5b791b6dfb..ffc8cac71cb 100644
--- a/gdb/gdbserver/debug.c
+++ b/gdb/gdbserver/debug.c
@@ -17,6 +17,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+#include "debug.h"
+
+/* Standard C++ includes. */
#include <chrono>
/* Enable miscellaneous debugging output. The name is historical - it
diff --git a/gdb/gdbserver/dll.c b/gdb/gdbserver/dll.c
index 02baae31e45..c88d3012a78 100644
--- a/gdb/gdbserver/dll.c
+++ b/gdb/gdbserver/dll.c
@@ -18,6 +18,7 @@
#include "server.h"
#include "dll.h"
+/* Standard C++ includes. */
#include <algorithm>
/* An "unspecified" CORE_ADDR, for match_dll. */
diff --git a/gdb/gdbserver/event-loop.c b/gdb/gdbserver/event-loop.c
index 0442680c237..d2bd0c57889 100644
--- a/gdb/gdbserver/event-loop.c
+++ b/gdb/gdbserver/event-loop.c
@@ -19,8 +19,12 @@
/* Based on src/gdb/event-loop.c. */
#include "server.h"
+#include "event-loop.h"
+/* Standard C includes. */
#include <sys/types.h>
+
+/* Local subdirectory includes. */
#include "common/gdb_sys_time.h"
#ifdef USE_WIN32API
diff --git a/gdb/gdbserver/fork-child.c b/gdb/gdbserver/fork-child.c
index a8bd0403780..25e5eb88f63 100644
--- a/gdb/gdbserver/fork-child.c
+++ b/gdb/gdbserver/fork-child.c
@@ -17,12 +17,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "common/job-control.h"
-#include "nat/fork-inferior.h"
+
+/* Standard C includes. */
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
+/* Local subdirectory includes. */
+#include "common/job-control.h"
+#include "nat/fork-inferior.h"
+
#ifdef SIGTTOU
/* A file descriptor for the controlling terminal. */
static int terminal_fd;
diff --git a/gdb/gdbserver/gdbthread.h b/gdb/gdbserver/gdbthread.h
index 44ed3c4723c..3d79ce3629b 100644
--- a/gdb/gdbserver/gdbthread.h
+++ b/gdb/gdbserver/gdbthread.h
@@ -19,10 +19,13 @@
#ifndef GDBSERVER_GDBTHREAD_H
#define GDBSERVER_GDBTHREAD_H
-#include "common/common-gdbthread.h"
+#include <list>
+
+/* Local non-gdb includes. */
#include "inferiors.h"
-#include <list>
+/* Local subdirectory includes. */
+#include "common/common-gdbthread.h"
struct btrace_target_info;
struct regcache;
diff --git a/gdb/gdbserver/hostio-errno.c b/gdb/gdbserver/hostio-errno.c
index 6325fee3ffd..cbfb033fccd 100644
--- a/gdb/gdbserver/hostio-errno.c
+++ b/gdb/gdbserver/hostio-errno.c
@@ -22,6 +22,8 @@
on top of errno. */
#include "server.h"
+
+/* Local subdirectory includes. */
#include "common/fileio.h"
void
diff --git a/gdb/gdbserver/hostio.c b/gdb/gdbserver/hostio.c
index cf75de0c004..9eaa767972c 100644
--- a/gdb/gdbserver/hostio.c
+++ b/gdb/gdbserver/hostio.c
@@ -19,14 +19,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "gdb/fileio.h"
#include "hostio.h"
+/* Standard C includes. */
#include <fcntl.h>
#include <limits.h>
-#include <unistd.h>
-#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+/* Local non-gdb includes. */
+#include "gdb/fileio.h"
+
+/* Local subdirectory includes. */
#include "common/fileio.h"
extern int remote_debug;
diff --git a/gdb/gdbserver/i387-fp.c b/gdb/gdbserver/i387-fp.c
index 7dde85a61e5..1fecba92287 100644
--- a/gdb/gdbserver/i387-fp.c
+++ b/gdb/gdbserver/i387-fp.c
@@ -18,6 +18,8 @@
#include "server.h"
#include "i387-fp.h"
+
+/* Local subdirectory includes. */
#include "common/x86-xstate.h"
static const int num_mpx_bnd_registers = 4;
diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c
index 17bfd1f6ec8..a84b9577cf8 100644
--- a/gdb/gdbserver/inferiors.c
+++ b/gdb/gdbserver/inferiors.c
@@ -19,9 +19,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "gdbthread.h"
+#include "inferiors.h"
+
+/* Local non-gdb includes. */
#include "dll.h"
+/* Local includes. */
+#include "gdbthread.h"
+
std::list<process_info *> all_processes;
std::list<thread_info *> all_threads;
diff --git a/gdb/gdbserver/inferiors.h b/gdb/gdbserver/inferiors.h
index cf284b807bb..b7718c7f6b1 100644
--- a/gdb/gdbserver/inferiors.h
+++ b/gdb/gdbserver/inferiors.h
@@ -19,9 +19,11 @@
#ifndef GDBSERVER_INFERIORS_H
#define GDBSERVER_INFERIORS_H
-#include "common/gdb_vecs.h"
#include <list>
+/* Local subdirectory includes. */
+#include "common/gdb_vecs.h"
+
struct thread_info;
struct regcache;
struct target_desc;
diff --git a/gdb/gdbserver/linux-aarch32-low.c b/gdb/gdbserver/linux-aarch32-low.c
index 051e614c656..9b72031c9d5 100644
--- a/gdb/gdbserver/linux-aarch32-low.c
+++ b/gdb/gdbserver/linux-aarch32-low.c
@@ -16,12 +16,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "arch/arm.h"
-#include "arch/arm-linux.h"
-#include "linux-low.h"
#include "linux-aarch32-low.h"
+/* Standard C includes. */
#include <sys/ptrace.h>
+
+/* Local non-gdb includes. */
+#include "linux-low.h"
+
+/* Local subdirectory includes. */
+#include "arch/arm-linux.h"
+#include "arch/arm.h"
+
/* Don't include elf.h if linux/elf.h got included by gdb_proc_service.h.
On Bionic elf.h and linux/elf.h have conflicting definitions. */
#ifndef ELFMAG0
diff --git a/gdb/gdbserver/linux-aarch64-ipa.c b/gdb/gdbserver/linux-aarch64-ipa.c
index 3804b1e2394..cab44fa7b48 100644
--- a/gdb/gdbserver/linux-aarch64-ipa.c
+++ b/gdb/gdbserver/linux-aarch64-ipa.c
@@ -19,14 +19,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include <sys/mman.h>
-#include "tracepoint.h"
+
+/* Standard C includes. */
#include <elf.h>
#ifdef HAVE_GETAUXVAL
#include <sys/auxv.h>
#endif
+#include <sys/mman.h>
+
+/* Local non-gdb includes. */
#include "linux-aarch64-tdesc.h"
+/* Local includes. */
+#include "tracepoint.h"
+
/* Each register saved by the jump pad is in a 16 byte cell. */
#define FT_CR_SIZE 16
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
index dc4ee81d2a2..040a69799ae 100644
--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -20,32 +20,37 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "linux-low.h"
-#include "nat/aarch64-linux.h"
-#include "nat/aarch64-linux-hw-point.h"
-#include "arch/aarch64-insn.h"
-#include "linux-aarch32-low.h"
-#include "elf/common.h"
-#include "ax.h"
-#include "tracepoint.h"
-#include <signal.h>
-#include <sys/user.h>
-#include "nat/gdb_ptrace.h"
+/* Standard C includes. */
#include <asm/ptrace.h>
-#include <inttypes.h>
#include <endian.h>
+#include <inttypes.h>
+#include <signal.h>
+#ifdef HAVE_SYS_REG_H
+#include <sys/reg.h>
+#endif
#include <sys/uio.h>
+#include <sys/user.h>
-#include "gdb_proc_service.h"
-#include "arch/aarch64.h"
+/* Local non-gdb includes. */
+#include "elf/common.h"
+#include "linux-aarch32-low.h"
#include "linux-aarch64-tdesc.h"
-#include "nat/aarch64-sve-linux-ptrace.h"
+#include "linux-low.h"
#include "tdesc.h"
-#ifdef HAVE_SYS_REG_H
-#include <sys/reg.h>
-#endif
+/* Local subdirectory includes. */
+#include "arch/aarch64-insn.h"
+#include "arch/aarch64.h"
+#include "nat/aarch64-linux-hw-point.h"
+#include "nat/aarch64-linux.h"
+#include "nat/aarch64-sve-linux-ptrace.h"
+#include "nat/gdb_ptrace.h"
+
+/* Local includes. */
+#include "ax.h"
+#include "gdb_proc_service.h"
+#include "tracepoint.h"
/* Per-process arch-specific data we want to keep. */
diff --git a/gdb/gdbserver/linux-aarch64-tdesc-selftest.c b/gdb/gdbserver/linux-aarch64-tdesc-selftest.c
index bf24a27c598..490704661dc 100644
--- a/gdb/gdbserver/linux-aarch64-tdesc-selftest.c
+++ b/gdb/gdbserver/linux-aarch64-tdesc-selftest.c
@@ -16,9 +16,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Local non-gdb includes. */
+#include "linux-aarch64-tdesc.h"
#include "tdesc.h"
+
+/* Local subdirectory includes. */
#include "common/selftest.h"
-#include "linux-aarch64-tdesc.h"
/* Defined in auto-generated file features/aarch64.c. */
void init_registers_aarch64 (void);
diff --git a/gdb/gdbserver/linux-aarch64-tdesc.c b/gdb/gdbserver/linux-aarch64-tdesc.c
index 6f9b4f1efc6..903440b3321 100644
--- a/gdb/gdbserver/linux-aarch64-tdesc.c
+++ b/gdb/gdbserver/linux-aarch64-tdesc.c
@@ -18,10 +18,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+#include "linux-aarch64-tdesc.h"
+
+/* Standard C includes. */
+#include <inttypes.h>
+
+/* Local non-gdb includes. */
+#include "linux-aarch32-low.h"
#include "tdesc.h"
+
+/* Local subdirectory includes. */
#include "arch/aarch64.h"
-#include "linux-aarch32-low.h"
-#include <inttypes.h>
/* All possible aarch64 target descriptors. */
struct target_desc *tdesc_aarch64_list[AARCH64_MAX_SVE_VQ + 1][2/*pauth*/];
diff --git a/gdb/gdbserver/linux-amd64-ipa.c b/gdb/gdbserver/linux-amd64-ipa.c
index 99206536ca8..12dd5c1fad1 100644
--- a/gdb/gdbserver/linux-amd64-ipa.c
+++ b/gdb/gdbserver/linux-amd64-ipa.c
@@ -19,11 +19,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Standard C includes. */
#include <sys/mman.h>
-#include "tracepoint.h"
+
+/* Local non-gdb includes. */
#include "linux-x86-tdesc.h"
+
+/* Local subdirectory includes. */
#include "common/x86-xstate.h"
+/* Local includes. */
+#include "tracepoint.h"
+
/* Defined in auto-generated file amd64-linux.c. */
void init_registers_amd64_linux (void);
extern const struct target_desc *tdesc_amd64_linux;
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index ff72a489cba..c5146fd7231 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -17,13 +17,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Standard C includes. */
+#include <sys/uio.h>
+
+/* Local non-gdb includes. */
+#include "linux-aarch32-low.h"
#include "linux-low.h"
-#include "arch/arm.h"
-#include "arch/arm-linux.h"
+
+/* Local subdirectory includes. */
#include "arch/arm-get-next-pcs.h"
-#include "linux-aarch32-low.h"
+#include "arch/arm-linux.h"
+#include "arch/arm.h"
-#include <sys/uio.h>
/* Don't include elf.h if linux/elf.h got included by gdb_proc_service.h.
On Bionic elf.h and linux/elf.h have conflicting definitions. */
#ifndef ELFMAG0
diff --git a/gdb/gdbserver/linux-bfin-low.c b/gdb/gdbserver/linux-bfin-low.c
index 7e88bb231fa..5400cd21c3d 100644
--- a/gdb/gdbserver/linux-bfin-low.c
+++ b/gdb/gdbserver/linux-bfin-low.c
@@ -20,9 +20,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "linux-low.h"
+
+/* Standard C includes. */
#include <asm/ptrace.h>
+/* Local non-gdb includes. */
+#include "linux-low.h"
+
/* Defined in auto-generated file reg-bfin.c. */
void init_registers_bfin (void);
extern const struct target_desc *tdesc_bfin;
diff --git a/gdb/gdbserver/linux-cris-low.c b/gdb/gdbserver/linux-cris-low.c
index 5470fb8face..5d57197238b 100644
--- a/gdb/gdbserver/linux-cris-low.c
+++ b/gdb/gdbserver/linux-cris-low.c
@@ -17,7 +17,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Local non-gdb includes. */
#include "linux-low.h"
+
+/* Local subdirectory includes. */
#include "nat/gdb_ptrace.h"
/* Defined in auto-generated file reg-cris.c. */
diff --git a/gdb/gdbserver/linux-crisv32-low.c b/gdb/gdbserver/linux-crisv32-low.c
index 5c43241bfbf..2ac0c18451c 100644
--- a/gdb/gdbserver/linux-crisv32-low.c
+++ b/gdb/gdbserver/linux-crisv32-low.c
@@ -17,7 +17,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Local non-gdb includes. */
#include "linux-low.h"
+
+/* Local subdirectory includes. */
#include "nat/gdb_ptrace.h"
/* Defined in auto-generated file reg-crisv32.c. */
diff --git a/gdb/gdbserver/linux-i386-ipa.c b/gdb/gdbserver/linux-i386-ipa.c
index f5fd227505a..0e2549a6642 100644
--- a/gdb/gdbserver/linux-i386-ipa.c
+++ b/gdb/gdbserver/linux-i386-ipa.c
@@ -19,11 +19,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Standard C includes. */
#include <sys/mman.h>
-#include "tracepoint.h"
+
+/* Local non-gdb includes. */
#include "linux-x86-tdesc.h"
+
+/* Local subdirectory includes. */
#include "common/x86-xstate.h"
+/* Local includes. */
+#include "tracepoint.h"
+
/* GDB register numbers. */
enum i386_gdb_regnum
diff --git a/gdb/gdbserver/linux-ia64-low.c b/gdb/gdbserver/linux-ia64-low.c
index 673f03a1445..0ec5be2122e 100644
--- a/gdb/gdbserver/linux-ia64-low.c
+++ b/gdb/gdbserver/linux-ia64-low.c
@@ -17,12 +17,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "linux-low.h"
+/* Standard C includes. */
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
#endif
+/* Local non-gdb includes. */
+#include "linux-low.h"
+
/* Defined in auto-generated file reg-ia64.c. */
void init_registers_ia64 (void);
extern const struct target_desc *tdesc_ia64;
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 265043f97ea..58d58ef4c83 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -18,39 +18,48 @@
#include "server.h"
#include "linux-low.h"
-#include "nat/linux-osdata.h"
-#include "common/agent.h"
-#include "tdesc.h"
-#include "common/rsp-low.h"
-#include "common/signals-state-save-restore.h"
-#include "nat/linux-nat.h"
-#include "nat/linux-waitpid.h"
-#include "common/gdb_wait.h"
-#include "nat/gdb_ptrace.h"
-#include "nat/linux-ptrace.h"
-#include "nat/linux-procfs.h"
-#include "nat/linux-personality.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <pwd.h>
+#include <sched.h>
#include <signal.h>
#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <unistd.h>
+#include <sys/stat.h>
#include <sys/syscall.h>
-#include <sched.h>
-#include <ctype.h>
-#include <pwd.h>
#include <sys/types.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/vfs.h>
#include <sys/uio.h>
-#include "common/filestuff.h"
-#include "tracepoint.h"
+#include <sys/vfs.h>
+#include <unistd.h>
+
+/* Local non-gdb includes. */
#include "hostio.h"
-#include <inttypes.h>
+#include "tdesc.h"
+
+/* Local subdirectory includes. */
+#include "common/agent.h"
#include "common/common-inferior.h"
-#include "nat/fork-inferior.h"
#include "common/environ.h"
+#include "common/filestuff.h"
+#include "common/gdb_wait.h"
+#include "common/rsp-low.h"
#include "common/scoped_restore.h"
+#include "common/signals-state-save-restore.h"
+#include "nat/fork-inferior.h"
+#include "nat/gdb_ptrace.h"
+#include "nat/linux-nat.h"
+#include "nat/linux-osdata.h"
+#include "nat/linux-personality.h"
+#include "nat/linux-procfs.h"
+#include "nat/linux-ptrace.h"
+#include "nat/linux-waitpid.h"
+
+/* Local includes. */
+#include "tracepoint.h"
+
#ifndef ELFMAG0
/* Don't include <linux/elf.h> here. If it got included by gdb_proc_service.h
then ELFMAG0 will have been defined. If it didn't get included by
diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h
index d825184835d..f9d1ef9f76a 100644
--- a/gdb/gdbserver/linux-low.h
+++ b/gdb/gdbserver/linux-low.h
@@ -19,12 +19,15 @@
#ifndef GDBSERVER_LINUX_LOW_H
#define GDBSERVER_LINUX_LOW_H
-#include "nat/linux-nat.h"
-#include "nat/gdb_thread_db.h"
#include <signal.h>
-#include "gdbthread.h"
+/* Local subdirectory includes. */
+#include "nat/gdb_thread_db.h"
+#include "nat/linux-nat.h"
+
+/* Local includes. */
#include "gdb_proc_service.h"
+#include "gdbthread.h"
/* Included for ptrace type definitions. */
#include "nat/linux-ptrace.h"
diff --git a/gdb/gdbserver/linux-m32r-low.c b/gdb/gdbserver/linux-m32r-low.c
index f9f7aa019fe..f1ab09d556a 100644
--- a/gdb/gdbserver/linux-m32r-low.c
+++ b/gdb/gdbserver/linux-m32r-low.c
@@ -17,12 +17,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "linux-low.h"
+/* Standard C includes. */
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
#endif
+/* Local non-gdb includes. */
+#include "linux-low.h"
+
/* Defined in auto-generated file reg-m32r.c. */
void init_registers_m32r (void);
extern const struct target_desc *tdesc_m32r;
diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c
index 16f639d02fc..9c9beaa46ec 100644
--- a/gdb/gdbserver/linux-m68k-low.c
+++ b/gdb/gdbserver/linux-m68k-low.c
@@ -17,6 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Local non-gdb includes. */
#include "linux-low.h"
/* Defined in auto-generated file reg-m68k.c. */
diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c
index 3ff27cf90be..b7b7491f110 100644
--- a/gdb/gdbserver/linux-mips-low.c
+++ b/gdb/gdbserver/linux-mips-low.c
@@ -17,12 +17,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "linux-low.h"
-#include "nat/gdb_ptrace.h"
+/* Standard C includes. */
#include <endian.h>
+/* Local non-gdb includes. */
+#include "linux-low.h"
+
+/* Local subdirectory includes. */
+#include "nat/gdb_ptrace.h"
#include "nat/mips-linux-watch.h"
+
+/* Local includes. */
#include "gdb_proc_service.h"
/* Defined in auto-generated file mips-linux.c. */
diff --git a/gdb/gdbserver/linux-nios2-low.c b/gdb/gdbserver/linux-nios2-low.c
index c37698554fd..9d79082b3f0 100644
--- a/gdb/gdbserver/linux-nios2-low.c
+++ b/gdb/gdbserver/linux-nios2-low.c
@@ -20,12 +20,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "linux-low.h"
+
+/* Standard C includes. */
+#include <asm/ptrace.h>
+#include <endian.h>
+
+/* Local non-gdb includes. */
#include "elf/common.h"
+#include "linux-low.h"
+
+/* Local subdirectory includes. */
#include "nat/gdb_ptrace.h"
-#include <endian.h>
+
+/* Local includes. */
#include "gdb_proc_service.h"
-#include <asm/ptrace.h>
#ifndef PTRACE_GET_THREAD_AREA
#define PTRACE_GET_THREAD_AREA 25
diff --git a/gdb/gdbserver/linux-ppc-ipa.c b/gdb/gdbserver/linux-ppc-ipa.c
index 08adc52ce4c..3348c52a9b1 100644
--- a/gdb/gdbserver/linux-ppc-ipa.c
+++ b/gdb/gdbserver/linux-ppc-ipa.c
@@ -19,14 +19,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include <sys/mman.h>
-#include "tracepoint.h"
-#include "arch/ppc-linux-tdesc.h"
-#include "linux-ppc-tdesc-init.h"
+
+/* Standard C includes. */
#include <elf.h>
#ifdef HAVE_GETAUXVAL
#include <sys/auxv.h>
#endif
+#include <sys/mman.h>
+
+/* Local non-gdb includes. */
+#include "linux-ppc-tdesc-init.h"
+
+/* Local subdirectory includes. */
+#include "arch/ppc-linux-tdesc.h"
+
+/* Local includes. */
+#include "tracepoint.h"
/* These macros define the position of registers in the buffer collected
by the fast tracepoint jump pad. */
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 8deb0ce068b..85e43f94e51 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -18,18 +18,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "linux-low.h"
-#include "elf/common.h"
-#include <sys/uio.h>
-#include <elf.h>
+/* Standard C includes. */
#include <asm/ptrace.h>
+#include <elf.h>
+#include <sys/uio.h>
+
+/* Local non-gdb includes. */
+#include "elf/common.h"
+#include "linux-low.h"
+#include "linux-ppc-tdesc-init.h"
+/* Local subdirectory includes. */
#include "arch/ppc-linux-common.h"
#include "arch/ppc-linux-tdesc.h"
-#include "nat/ppc-linux.h"
#include "nat/linux-ptrace.h"
-#include "linux-ppc-tdesc-init.h"
+#include "nat/ppc-linux.h"
+
+/* Local includes. */
#include "ax.h"
#include "tracepoint.h"
diff --git a/gdb/gdbserver/linux-s390-ipa.c b/gdb/gdbserver/linux-s390-ipa.c
index 7697cd9cbd9..bb96e3332ba 100644
--- a/gdb/gdbserver/linux-s390-ipa.c
+++ b/gdb/gdbserver/linux-s390-ipa.c
@@ -19,13 +19,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include <sys/mman.h>
-#include "tracepoint.h"
-#include "linux-s390-tdesc.h"
+
+/* Standard C includes. */
#include <elf.h>
#ifdef HAVE_GETAUXVAL
#include <sys/auxv.h>
#endif
+#include <sys/mman.h>
+
+/* Local non-gdb includes. */
+#include "linux-s390-tdesc.h"
+
+/* Local includes. */
+#include "tracepoint.h"
#define FT_FPR(x) (0x000 + (x) * 0x10)
#define FT_VR(x) (0x000 + (x) * 0x10)
diff --git a/gdb/gdbserver/linux-s390-low.c b/gdb/gdbserver/linux-s390-low.c
index f65a1ec38ef..894fa003991 100644
--- a/gdb/gdbserver/linux-s390-low.c
+++ b/gdb/gdbserver/linux-s390-low.c
@@ -20,19 +20,25 @@
/* This file is used for both 31-bit and 64-bit S/390 systems. */
#include "server.h"
-#include "linux-low.h"
-#include "elf/common.h"
-#include "ax.h"
-#include "tracepoint.h"
+/* Standard C includes. */
#include <asm/ptrace.h>
-#include "nat/gdb_ptrace.h"
-#include <sys/uio.h>
#include <elf.h>
#include <inttypes.h>
+#include <sys/uio.h>
+/* Local non-gdb includes. */
+#include "elf/common.h"
+#include "linux-low.h"
#include "linux-s390-tdesc.h"
+/* Local subdirectory includes. */
+#include "nat/gdb_ptrace.h"
+
+/* Local includes. */
+#include "ax.h"
+#include "tracepoint.h"
+
#ifndef HWCAP_S390_HIGH_GPRS
#define HWCAP_S390_HIGH_GPRS 512
#endif
diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c
index 0953721a190..268e5728c41 100644
--- a/gdb/gdbserver/linux-sh-low.c
+++ b/gdb/gdbserver/linux-sh-low.c
@@ -17,6 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Local non-gdb includes. */
#include "linux-low.h"
/* Defined in auto-generated file reg-sh.c. */
diff --git a/gdb/gdbserver/linux-sparc-low.c b/gdb/gdbserver/linux-sparc-low.c
index 5a601ee304c..e643c28ddfc 100644
--- a/gdb/gdbserver/linux-sparc-low.c
+++ b/gdb/gdbserver/linux-sparc-low.c
@@ -17,10 +17,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Local non-gdb includes. */
#include "linux-low.h"
+/* Local subdirectory includes. */
#include "nat/gdb_ptrace.h"
+/* Local includes. */
#include "gdb_proc_service.h"
/* The stack pointer is offset from the stack frame by a BIAS of 2047
diff --git a/gdb/gdbserver/linux-tic6x-low.c b/gdb/gdbserver/linux-tic6x-low.c
index 7eecdeb7986..b27e3e8e8bc 100644
--- a/gdb/gdbserver/linux-tic6x-low.c
+++ b/gdb/gdbserver/linux-tic6x-low.c
@@ -20,13 +20,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Standard C includes. */
+#include <endian.h>
+
+/* Local non-gdb includes. */
#include "linux-low.h"
-#include "arch/tic6x.h"
#include "tdesc.h"
+/* Local subdirectory includes. */
+#include "arch/tic6x.h"
#include "nat/gdb_ptrace.h"
-#include <endian.h>
+/* Local includes. */
#include "gdb_proc_service.h"
#ifndef PTRACE_GET_THREAD_AREA
diff --git a/gdb/gdbserver/linux-tile-low.c b/gdb/gdbserver/linux-tile-low.c
index 7296375081f..1a2c104180a 100644
--- a/gdb/gdbserver/linux-tile-low.c
+++ b/gdb/gdbserver/linux-tile-low.c
@@ -18,9 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "linux-low.h"
+/* Standard C includes. */
#include <arch/abi.h>
+
+/* Local non-gdb includes. */
+#include "linux-low.h"
+
+/* Local subdirectory includes. */
#include "nat/gdb_ptrace.h"
/* Defined in auto-generated file reg-tilegx.c. */
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index 029796e3613..9b0f4c531b6 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -18,12 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include <signal.h>
-#include <limits.h>
+
+/* Standard C includes. */
#include <inttypes.h>
-#include "linux-low.h"
+#include <limits.h>
+#include <signal.h>
+
+/* Local non-gdb includes. */
#include "i387-fp.h"
+#include "linux-low.h"
#include "x86-low.h"
+
+/* Local subdirectory includes. */
#include "common/x86-xstate.h"
#include "nat/gdb_ptrace.h"
diff --git a/gdb/gdbserver/linux-x86-tdesc-selftest.c b/gdb/gdbserver/linux-x86-tdesc-selftest.c
index 50474b3668c..8f54344ef1a 100644
--- a/gdb/gdbserver/linux-x86-tdesc-selftest.c
+++ b/gdb/gdbserver/linux-x86-tdesc-selftest.c
@@ -16,8 +16,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Local non-gdb includes. */
#include "linux-x86-tdesc.h"
#include "tdesc.h"
+
+/* Local subdirectory includes. */
#include "common/selftest.h"
#include "common/x86-xstate.h"
diff --git a/gdb/gdbserver/linux-x86-tdesc.c b/gdb/gdbserver/linux-x86-tdesc.c
index 8f24a3d72d1..9f6f6d93337 100644
--- a/gdb/gdbserver/linux-x86-tdesc.c
+++ b/gdb/gdbserver/linux-x86-tdesc.c
@@ -18,10 +18,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "tdesc.h"
#include "linux-x86-tdesc.h"
+
+/* Local non-gdb includes. */
+#include "tdesc.h"
+
+/* Local subdirectory includes. */
#include "arch/i386.h"
#include "common/x86-xstate.h"
+
#ifdef __x86_64__
#include "arch/amd64.h"
#endif
diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c
index c5aae87dda5..5f841b58aaa 100644
--- a/gdb/gdbserver/linux-xtensa-low.c
+++ b/gdb/gdbserver/linux-xtensa-low.c
@@ -18,6 +18,8 @@
#include "server.h"
+
+/* Local non-gdb includes. */
#include "linux-low.h"
/* Defined in auto-generated file reg-xtensa.c. */
diff --git a/gdb/gdbserver/lynx-i386-low.c b/gdb/gdbserver/lynx-i386-low.c
index e47f6b92f63..3ec91820b85 100644
--- a/gdb/gdbserver/lynx-i386-low.c
+++ b/gdb/gdbserver/lynx-i386-low.c
@@ -16,13 +16,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "lynx-low.h"
+
+/* Standard C includes. */
#include <limits.h>
#include <sys/ptrace.h>
-#include "common/x86-xstate.h"
-#include "arch/i386.h"
+
+/* Local non-gdb includes. */
+#include "lynx-low.h"
#include "x86-tdesc.h"
+/* Local subdirectory includes. */
+#include "arch/i386.h"
+#include "common/x86-xstate.h"
+
/* The following two typedefs are defined in a .h file which is not
in the standard include path (/sys/include/family/x86/ucontext.h),
so we just duplicate them here.
diff --git a/gdb/gdbserver/lynx-low.c b/gdb/gdbserver/lynx-low.c
index 4f6314669eb..7c1d4b251bc 100644
--- a/gdb/gdbserver/lynx-low.c
+++ b/gdb/gdbserver/lynx-low.c
@@ -16,21 +16,26 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "target.h"
#include "lynx-low.h"
+/* Standard C includes. */
#include <limits.h>
-#include <sys/ptrace.h>
-#include <sys/piddef.h> /* Provides PIDGET, TIDGET, BUILDPID, etc. */
-#include <unistd.h>
+#include <signal.h>
#include <sys/ioctl.h>
+#include <sys/piddef.h>
+#include <sys/ptrace.h>
#include <sys/types.h>
-#include "common/gdb_wait.h"
-#include <signal.h>
-#include "common/filestuff.h"
+#include <unistd.h>
+
+/* Local subdirectory includes. */
#include "common/common-inferior.h"
+#include "common/filestuff.h"
+#include "common/gdb_wait.h"
#include "nat/fork-inferior.h"
+/* Local includes. */
+#include "target.h"
+
int using_threads = 1;
const struct target_desc *lynx_tdesc;
diff --git a/gdb/gdbserver/lynx-ppc-low.c b/gdb/gdbserver/lynx-ppc-low.c
index 8615e66aa1d..96296887f3a 100644
--- a/gdb/gdbserver/lynx-ppc-low.c
+++ b/gdb/gdbserver/lynx-ppc-low.c
@@ -16,10 +16,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "lynx-low.h"
+
+/* Standard C includes. */
#include <limits.h>
#include <sys/ptrace.h>
+/* Local non-gdb includes. */
+#include "lynx-low.h"
+
/* The following two typedefs are defined in a .h file which is not
in the standard include path (/sys/include/family/ppc/ucontext.h),
so we just duplicate them here. */
diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c
index 6327218cf66..727c593ca57 100644
--- a/gdb/gdbserver/mem-break.c
+++ b/gdb/gdbserver/mem-break.c
@@ -19,8 +19,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "regcache.h"
+#include "mem-break.h"
+
+/* Local includes. */
#include "ax.h"
+#include "regcache.h"
#define MAX_BREAKPOINT_LEN 8
diff --git a/gdb/gdbserver/notif.h b/gdb/gdbserver/notif.h
index 7d0767935bc..c7c85b2b173 100644
--- a/gdb/gdbserver/notif.h
+++ b/gdb/gdbserver/notif.h
@@ -19,9 +19,11 @@
#ifndef GDBSERVER_NOTIF_H
#define GDBSERVER_NOTIF_H
-#include "target.h"
#include "common/queue.h"
+/* Local includes. */
+#include "target.h"
+
/* Structure holding information related to a single event. We
keep a queue of these to push to GDB. It can be extended if
the event of given notification contains more information. */
diff --git a/gdb/gdbserver/nto-low.c b/gdb/gdbserver/nto-low.c
index 011701aa8ce..24bd716a77a 100644
--- a/gdb/gdbserver/nto-low.c
+++ b/gdb/gdbserver/nto-low.c
@@ -19,17 +19,22 @@
#include "server.h"
-#include "gdbthread.h"
#include "nto-low.h"
-#include "hostio.h"
-#include <limits.h>
+/* Standard C includes. */
#include <fcntl.h>
+#include <limits.h>
#include <spawn.h>
-#include <sys/procfs.h>
#include <sys/auxv.h>
#include <sys/iomgr.h>
#include <sys/neutrino.h>
+#include <sys/procfs.h>
+
+/* Local non-gdb includes. */
+#include "hostio.h"
+
+/* Local includes. */
+#include "gdbthread.h"
extern int using_threads;
diff --git a/gdb/gdbserver/nto-x86-low.c b/gdb/gdbserver/nto-x86-low.c
index cfbe7ba6d81..458ded96fc6 100644
--- a/gdb/gdbserver/nto-x86-low.c
+++ b/gdb/gdbserver/nto-x86-low.c
@@ -18,14 +18,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Standard C includes. */
+#include <x86/context.h>
+
+/* Local non-gdb includes. */
#include "nto-low.h"
#include "regdef.h"
-#include "regcache.h"
+#include "x86-tdesc.h"
-#include <x86/context.h>
-#include "common/x86-xstate.h"
+/* Local subdirectory includes. */
#include "arch/i386.h"
-#include "x86-tdesc.h"
+#include "common/x86-xstate.h"
+
+/* Local includes. */
+#include "regcache.h"
const unsigned char x86_breakpoint[] = { 0xCC };
#define x86_breakpoint_len 1
diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c
index a56b580654d..b7fb973a129 100644
--- a/gdb/gdbserver/regcache.c
+++ b/gdb/gdbserver/regcache.c
@@ -17,10 +17,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+#include "regcache.h"
+
+/* Local non-gdb includes. */
#include "regdef.h"
-#include "gdbthread.h"
#include "tdesc.h"
+
+/* Local subdirectory includes. */
#include "common/rsp-low.h"
+
+/* Local includes. */
+#include "gdbthread.h"
+
#ifndef IN_PROCESS_AGENT
struct regcache *
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 4e6f9c62de8..b95f63966bc 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -17,50 +17,59 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#if HAVE_TERMIOS_H
-#include <termios.h>
+#include "remote-utils.h"
+
+/* Standard C includes. */
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
#endif
-#include "target.h"
-#include "gdbthread.h"
-#include "tdesc.h"
-#include "dll.h"
-#include "common/rsp-low.h"
-#include "common/netstuff.h"
-#include "common/filestuff.h"
#include <ctype.h>
-#if HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
+#if HAVE_FCNTL_H
+#include <fcntl.h>
#endif
-#if HAVE_SYS_FILE_H
-#include <sys/file.h>
+#if HAVE_NETDB_H
+#include <netdb.h>
#endif
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_NETDB_H
-#include <netdb.h>
-#endif
#if HAVE_NETINET_TCP_H
#include <netinet/tcp.h>
#endif
-#if HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
#if HAVE_SIGNAL_H
#include <signal.h>
#endif
-#if HAVE_FCNTL_H
-#include <fcntl.h>
+#if HAVE_SYS_FILE_H
+#include <sys/file.h>
#endif
-#include "common/gdb_sys_time.h"
-#include <unistd.h>
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
#endif
#include <sys/stat.h>
+#if HAVE_TERMIOS_H
+#include <termios.h>
+#endif
+#include <unistd.h>
+
+/* Local non-gdb includes. */
+#include "dll.h"
+#include "tdesc.h"
+
+/* Local subdirectory includes. */
+#include "common/filestuff.h"
+#include "common/gdb_sys_time.h"
+#include "common/netstuff.h"
+#include "common/rsp-low.h"
+
+/* Local includes. */
+#include "gdbthread.h"
+#include "target.h"
#if USE_WIN32API
#if _WIN32_WINNT < 0x0501
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 25c62aad830..f2658330ebc 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -17,33 +17,43 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "gdbthread.h"
-#include "common/agent.h"
-#include "notif.h"
-#include "tdesc.h"
-#include "common/rsp-low.h"
-#include "common/signals-state-save-restore.h"
+#include "server.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include <unistd.h>
#if HAVE_SIGNAL_H
#include <signal.h>
#endif
-#include "common/gdb_vecs.h"
-#include "common/gdb_wait.h"
-#include "common/btrace-common.h"
-#include "common/filestuff.h"
-#include "tracepoint.h"
+#include <unistd.h>
+
+/* Standard C++ includes. */
+#include <vector>
+
+/* Local non-gdb includes. */
#include "dll.h"
+#include "filenames.h"
#include "hostio.h"
-#include <vector>
+#include "notif.h"
+#include "tdesc.h"
+
+/* Local subdirectory includes. */
+#include "common/agent.h"
+#include "common/btrace-common.h"
#include "common/common-inferior.h"
-#include "common/job-control.h"
#include "common/environ.h"
-#include "filenames.h"
+#include "common/filestuff.h"
+#include "common/gdb_vecs.h"
+#include "common/gdb_wait.h"
+#include "common/job-control.h"
#include "common/pathstuff.h"
-
-#include "common/selftest.h"
+#include "common/rsp-low.h"
#include "common/scope-exit.h"
+#include "common/selftest.h"
+#include "common/signals-state-save-restore.h"
+
+/* Local includes. */
+#include "gdbthread.h"
+#include "tracepoint.h"
#define require_running_or_return(BUF) \
if (!target_running ()) \
diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c
index 97f985ae8f8..b4ea85af673 100644
--- a/gdb/gdbserver/spu-low.c
+++ b/gdb/gdbserver/spu-low.c
@@ -20,13 +20,18 @@
#include "server.h"
-#include "common/gdb_wait.h"
-#include <sys/ptrace.h>
+/* Standard C includes. */
#include <fcntl.h>
-#include <unistd.h>
+#include <sys/ptrace.h>
#include <sys/syscall.h>
-#include "common/filestuff.h"
+#include <unistd.h>
+
+/* Local non-gdb includes. */
#include "hostio.h"
+
+/* Local subdirectory includes. */
+#include "common/filestuff.h"
+#include "common/gdb_wait.h"
#include "nat/fork-inferior.h"
/* Some older glibc versions do not define this. */
diff --git a/gdb/gdbserver/symbol.c b/gdb/gdbserver/symbol.c
index 20eb492f6be..ce12b51458c 100644
--- a/gdb/gdbserver/symbol.c
+++ b/gdb/gdbserver/symbol.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Local subdirectory includes. */
#include "common/symbol.h"
/* See common/symbol.h. */
diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c
index 25f91eeba73..01b67193822 100644
--- a/gdb/gdbserver/target.c
+++ b/gdb/gdbserver/target.c
@@ -19,6 +19,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+#include "target.h"
+
+/* Local includes. */
#include "tracepoint.h"
struct target_ops *the_target;
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index a4c9ad49106..a398920bb97 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -21,14 +21,20 @@
#ifndef GDBSERVER_TARGET_H
#define GDBSERVER_TARGET_H
-#include <sys/types.h> /* for mode_t */
-#include "target/target.h"
+#include <sys/types.h>
+
+/* Standard C++ includes. */
+#include <vector>
+
+/* Local non-gdb includes. */
+#include "mem-break.h"
+
+/* Local subdirectory includes. */
+#include "common/btrace-common.h"
#include "target/resume.h"
+#include "target/target.h"
#include "target/wait.h"
#include "target/waitstatus.h"
-#include "mem-break.h"
-#include "common/btrace-common.h"
-#include <vector>
struct emit_ops;
struct buffer;
diff --git a/gdb/gdbserver/tdesc.c b/gdb/gdbserver/tdesc.c
index 04c702fa033..f0860a04bf1 100644
--- a/gdb/gdbserver/tdesc.c
+++ b/gdb/gdbserver/tdesc.c
@@ -17,6 +17,8 @@
#include "server.h"
#include "tdesc.h"
+
+/* Local non-gdb includes. */
#include "regdef.h"
#ifndef IN_PROCESS_AGENT
diff --git a/gdb/gdbserver/tdesc.h b/gdb/gdbserver/tdesc.h
index 8ccacbb7ed4..1a9b1e7dfcc 100644
--- a/gdb/gdbserver/tdesc.h
+++ b/gdb/gdbserver/tdesc.h
@@ -19,10 +19,13 @@
#ifndef GDBSERVER_TDESC_H
#define GDBSERVER_TDESC_H
-#include "common/tdesc.h"
+#include <vector>
+/* Local non-gdb includes. */
#include "regdef.h"
-#include <vector>
+
+/* Local subdirectory includes. */
+#include "common/tdesc.h"
/* A target description. Inherit from tdesc_feature so that target_desc
can be used as tdesc_feature. */
diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c
index d4d4958c73e..58f2ef03708 100644
--- a/gdb/gdbserver/thread-db.c
+++ b/gdb/gdbserver/thread-db.c
@@ -20,6 +20,7 @@
#include "server.h"
+/* Local non-gdb includes. */
#include "linux-low.h"
extern int debug_threads;
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 9577ab7f1e9..2f9401e4b20 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -18,17 +18,26 @@
#include "server.h"
#include "tracepoint.h"
-#include "gdbthread.h"
-#include "common/rsp-low.h"
+/* Standard C includes. */
#include <ctype.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <unistd.h>
+
+/* Standard C++ includes. */
#include <chrono>
-#include <inttypes.h>
-#include "ax.h"
+
+/* Local non-gdb includes. */
#include "tdesc.h"
+/* Local subdirectory includes. */
+#include "common/rsp-low.h"
+
+/* Local includes. */
+#include "ax.h"
+#include "gdbthread.h"
+
#define IPA_SYM_STRUCT_NAME ipa_sym_addresses
#include "common/agent.h"
diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c
index 79a7e80f625..9049a29e13d 100644
--- a/gdb/gdbserver/utils.c
+++ b/gdb/gdbserver/utils.c
@@ -17,6 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+#include "utils.h"
#ifdef IN_PROCESS_AGENT
# define PREFIX "ipa: "
diff --git a/gdb/gdbserver/win32-arm-low.c b/gdb/gdbserver/win32-arm-low.c
index 2d7dfde35cd..2ca8c47433b 100644
--- a/gdb/gdbserver/win32-arm-low.c
+++ b/gdb/gdbserver/win32-arm-low.c
@@ -16,6 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Local non-gdb includes. */
#include "win32-low.h"
#ifndef CONTEXT_FLOATING_POINT
diff --git a/gdb/gdbserver/win32-i386-low.c b/gdb/gdbserver/win32-i386-low.c
index 7b187d3bea3..8956652fc37 100644
--- a/gdb/gdbserver/win32-i386-low.c
+++ b/gdb/gdbserver/win32-i386-low.c
@@ -16,9 +16,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+/* Local non-gdb includes. */
#include "win32-low.h"
#include "x86-low.h"
+
+/* Local subdirectory includes. */
#include "common/x86-xstate.h"
+
#ifdef __x86_64__
#include "arch/amd64.h"
#endif
diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c
index 1a50141c123..fb0fd834433 100644
--- a/gdb/gdbserver/win32-low.c
+++ b/gdb/gdbserver/win32-low.c
@@ -19,21 +19,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
-#include "regcache.h"
-#include "gdb/fileio.h"
-#include "mem-break.h"
#include "win32-low.h"
-#include "gdbthread.h"
-#include "dll.h"
-#include "hostio.h"
-#include <windows.h>
-#include <winnt.h>
+
+/* Standard C includes. */
#include <imagehlp.h>
-#include <tlhelp32.h>
-#include <psapi.h>
#include <process.h>
-#include "common/gdb_tilde_expand.h"
+#include <psapi.h>
+#include <tlhelp32.h>
+#include <windows.h>
+#include <winnt.h>
+
+/* Local non-gdb includes. */
+#include "dll.h"
+#include "gdb/fileio.h"
+#include "hostio.h"
+#include "mem-break.h"
+
+/* Local subdirectory includes. */
#include "common/common-inferior.h"
+#include "common/gdb_tilde_expand.h"
+
+/* Local includes. */
+#include "gdbthread.h"
+#include "regcache.h"
#ifndef USE_WIN32API
#include <sys/cygwin.h>
diff --git a/gdb/gdbserver/wincecompat.c b/gdb/gdbserver/wincecompat.c
index f55e821ddea..bb3879f0dde 100644
--- a/gdb/gdbserver/wincecompat.c
+++ b/gdb/gdbserver/wincecompat.c
@@ -17,7 +17,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+#include "wincecompat.h"
+/* Standard C includes. */
#include <windows.h>
void
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index b1a51374d96..21adc87567a 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -20,25 +20,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "bfd.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "objfiles.h"
#include "gdbtypes.h"
-#include "expression.h"
-#include "language.h"
-#include "target.h"
-#include "value.h"
+
+/* Local non-gdb includes. */
+#include "bfd.h"
#include "demangle.h"
+#include "floatformat.h"
+#include "hashtab.h"
+
+/* Local includes. */
+#include "bcache.h"
#include "complaints.h"
-#include "gdbcmd.h"
#include "cp-abi.h"
-#include "hashtab.h"
#include "cp-support.h"
-#include "bcache.h"
#include "dwarf2loc.h"
+#include "expression.h"
+#include "gdbcmd.h"
#include "gdbcore.h"
-#include "floatformat.h"
+#include "language.h"
+#include "objfiles.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
+#include "value.h"
/* Initialize BADNESS constants. */
diff --git a/gdb/glibc-tdep.c b/gdb/glibc-tdep.c
index e91421bc4f3..2d915754459 100644
--- a/gdb/glibc-tdep.c
+++ b/gdb/glibc-tdep.c
@@ -18,12 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "glibc-tdep.h"
+
+/* Local includes. */
#include "frame.h"
-#include "symtab.h"
-#include "symfile.h"
#include "objfiles.h"
-
-#include "glibc-tdep.h"
+#include "symfile.h"
+#include "symtab.h"
/* Calling functions in shared libraries. */
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index c1fafed156e..22c746cc729 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -21,6 +21,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Include this first, to pick up the <mach.h> 'thread_info' diversion. */
+#include "defs.h"
#include "gnu-nat.h"
/* Mach/Hurd headers are not yet ready for C++ compilation. */
diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
index 30405684dd8..ac230132519 100644
--- a/gdb/gnu-v2-abi.c
+++ b/gdb/gnu-v2-abi.c
@@ -20,14 +20,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "value.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
#include "demangle.h"
-#include "gdb-demangle.h"
+
+/* Local includes. */
#include "cp-abi.h"
#include "cp-support.h"
-#include <ctype.h>
+#include "gdb-demangle.h"
+#include "gdbtypes.h"
+#include "symtab.h"
+#include "value.h"
struct cp_abi_ops gnu_v2_abi_ops;
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index 15c7c667001..0bec747a817 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -19,15 +19,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "value.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "demangle.h"
+
+/* Local includes. */
+#include "c-lang.h"
#include "cp-abi.h"
#include "cp-support.h"
-#include "demangle.h"
#include "objfiles.h"
-#include "valprint.h"
-#include "c-lang.h"
#include "typeprint.h"
-#include <algorithm>
+#include "valprint.h"
+#include "value.h"
static struct cp_abi_ops gnu_v3_abi_ops;
diff --git a/gdb/go-lang.c b/gdb/go-lang.c
index 5af88f805a7..206bdfdb92f 100644
--- a/gdb/go-lang.c
+++ b/gdb/go-lang.c
@@ -32,17 +32,20 @@
*/
#include "defs.h"
-#include "gdb_obstack.h"
-#include "block.h"
-#include "symtab.h"
-#include "language.h"
-#include "varobj.h"
#include "go-lang.h"
-#include "c-lang.h"
-#include "parser-defs.h"
+/* Standard C includes. */
#include <ctype.h>
+/* Local includes. */
+#include "block.h"
+#include "c-lang.h"
+#include "gdb_obstack.h"
+#include "language.h"
+#include "parser-defs.h"
+#include "symtab.h"
+#include "varobj.h"
+
/* The main function in the main package. */
static const char GO_MAIN_MAIN[] = "main.main";
diff --git a/gdb/go-typeprint.c b/gdb/go-typeprint.c
index ee7a2c234da..0cb4cad3873 100644
--- a/gdb/go-typeprint.c
+++ b/gdb/go-typeprint.c
@@ -24,8 +24,10 @@
*/
#include "defs.h"
-#include "gdbtypes.h"
+
+/* Local includes. */
#include "c-lang.h"
+#include "gdbtypes.h"
#include "go-lang.h"
/* Print a description of a type TYPE.
diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c
index eda40f8ed8b..f4060d33153 100644
--- a/gdb/go-valprint.c
+++ b/gdb/go-valprint.c
@@ -24,10 +24,12 @@
support is unavailable. */
#include "defs.h"
-#include "gdbtypes.h"
+
+/* Local includes. */
+#include "c-lang.h"
#include "gdbcore.h"
+#include "gdbtypes.h"
#include "go-lang.h"
-#include "c-lang.h"
#include "valprint.h"
/* Print a Go string.
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index ea0872363d3..87f1e9fdb6e 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -83,37 +83,43 @@
#include "defs.h"
+/* Standard C includes. */
+#include <ctype.h>
+#include <debug/dbgcom.h>
+#include <debug/v2load.h>
+#include <dos.h>
+#include <dpmi.h>
#include <fcntl.h>
+#include <go32.h>
+#include <io.h>
+#include <sys/farptr.h>
+#include <sys/utsname.h>
+#include <unistd.h>
-#include "x86-nat.h"
-#include "inferior.h"
-#include "infrun.h"
-#include "gdbthread.h"
+/* Local non-gdb includes. */
+#include "floatformat.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
#include "common/gdb_wait.h"
-#include "gdbcore.h"
+#include "nat/x86-cpuid.h"
+
+/* Local includes. */
+#include "buildsym-legacy.h"
#include "command.h"
#include "gdbcmd.h"
-#include "floatformat.h"
-#include "buildsym-legacy.h"
-#include "i387-tdep.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
#include "i386-tdep.h"
-#include "nat/x86-cpuid.h"
-#include "value.h"
+#include "i387-tdep.h"
+#include "inf-child.h"
+#include "inferior.h"
+#include "infrun.h"
#include "regcache.h"
#include "top.h"
-#include "cli/cli-utils.h"
-#include "inf-child.h"
+#include "value.h"
+#include "x86-nat.h"
-#include <ctype.h>
-#include <unistd.h>
-#include <sys/utsname.h>
-#include <io.h>
-#include <dos.h>
-#include <dpmi.h>
-#include <go32.h>
-#include <sys/farptr.h>
-#include <debug/v2load.h>
-#include <debug/dbgcom.h>
#if __DJGPP_MINOR__ > 2
#include <debug/redir.h>
#endif
diff --git a/gdb/guile/guile.c b/gdb/guile/guile.c
index faf7f3326c8..dd1ba0d0d37 100644
--- a/gdb/guile/guile.c
+++ b/gdb/guile/guile.c
@@ -21,21 +21,24 @@
conventions, et.al. */
#include "defs.h"
-#include "breakpoint.h"
+#include "guile/guile.h"
+
+/* Standard C includes. */
+#include <signal.h>
+
+/* Local subdirectory includes. */
#include "cli/cli-cmds.h"
#include "cli/cli-script.h"
#include "cli/cli-utils.h"
+#include "common/version.h"
+
+/* Local includes. */
+#include "breakpoint.h"
#include "command.h"
+#include "extension-priv.h"
#include "gdbcmd.h"
#include "top.h"
-#include "extension-priv.h"
#include "utils.h"
-#include "common/version.h"
-#ifdef HAVE_GUILE
-#include "guile.h"
-#include "guile-internal.h"
-#endif
-#include <signal.h>
/* The Guile version we're using.
We *could* use the macros in libguile/version.h but that would preclude
diff --git a/gdb/guile/scm-arch.c b/gdb/guile/scm-arch.c
index ea18a2f34a1..618423e4e5b 100644
--- a/gdb/guile/scm-arch.c
+++ b/gdb/guile/scm-arch.c
@@ -21,10 +21,14 @@
conventions, et.al. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "charset.h"
#include "gdbarch.h"
-#include "arch-utils.h"
-#include "guile-internal.h"
/* The <gdb:arch> smob.
The typedef for this struct is in guile-internal.h. */
diff --git a/gdb/guile/scm-auto-load.c b/gdb/guile/scm-auto-load.c
index cadf987b6f2..5c5d622edda 100644
--- a/gdb/guile/scm-auto-load.c
+++ b/gdb/guile/scm-auto-load.c
@@ -18,13 +18,19 @@
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 "guile-internal.h"
+#include "guile.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-cmds.h"
+
+/* Local includes. */
#include "auto-load.h"
-#include "guile.h"
-#include "guile-internal.h"
+#include "gdbcmd.h"
+#include "objfiles.h"
+#include "top.h"
/* User-settable option to enable/disable auto-loading of Guile scripts:
set auto-load guile-scripts on|off
diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c
index df1dfe57526..6968b0b9471 100644
--- a/gdb/guile/scm-block.c
+++ b/gdb/guile/scm-block.c
@@ -21,12 +21,16 @@
conventions, et.al. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.h"
+
+/* Local includes. */
#include "block.h"
#include "dictionary.h"
#include "objfiles.h"
#include "source.h"
#include "symtab.h"
-#include "guile-internal.h"
/* A smob describing a gdb block. */
diff --git a/gdb/guile/scm-breakpoint.c b/gdb/guile/scm-breakpoint.c
index d052748dd40..8079e234340 100644
--- a/gdb/guile/scm-breakpoint.c
+++ b/gdb/guile/scm-breakpoint.c
@@ -21,17 +21,23 @@
conventions, et.al. */
#include "defs.h"
-#include "value.h"
-#include "breakpoint.h"
-#include "gdbcmd.h"
-#include "gdbthread.h"
-#include "observable.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-script.h"
+
+/* Local includes. */
#include "ada-lang.h"
#include "arch-utils.h"
+#include "breakpoint.h"
+#include "gdbcmd.h"
+#include "gdbthread.h"
#include "language.h"
-#include "guile-internal.h"
#include "location.h"
+#include "observable.h"
+#include "value.h"
/* The <gdb:breakpoint> smob.
N.B.: The name of this struct is known to breakpoint.h.
diff --git a/gdb/guile/scm-cmd.c b/gdb/guile/scm-cmd.c
index 1266a790947..bf68286bdcb 100644
--- a/gdb/guile/scm-cmd.c
+++ b/gdb/guile/scm-cmd.c
@@ -21,12 +21,20 @@
conventions, et.al. */
#include "defs.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "charset.h"
-#include "gdbcmd.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-decode.h"
+
+/* Local includes. */
+#include "charset.h"
#include "completer.h"
-#include "guile-internal.h"
+#include "gdbcmd.h"
/* The <gdb:command> smob.
diff --git a/gdb/guile/scm-disasm.c b/gdb/guile/scm-disasm.c
index e4a9c92a56b..b0dec90a07d 100644
--- a/gdb/guile/scm-disasm.c
+++ b/gdb/guile/scm-disasm.c
@@ -21,12 +21,16 @@
conventions, et.al. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "guile-internal.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "disasm.h"
-#include "dis-asm.h"
#include "gdbarch.h"
-#include "gdbcore.h" /* Why is memory_error here? */
-#include "guile-internal.h"
+#include "gdbcore.h"
static SCM port_keyword;
static SCM offset_keyword;
diff --git a/gdb/guile/scm-exception.c b/gdb/guile/scm-exception.c
index e37edd01787..30d7e5189cc 100644
--- a/gdb/guile/scm-exception.c
+++ b/gdb/guile/scm-exception.c
@@ -29,7 +29,11 @@
not exscm_ on purpose. */
#include "defs.h"
+
+/* Standard C includes. */
#include <signal.h>
+
+/* Local non-gdb includes. */
#include "guile-internal.h"
/* The <gdb:exception> smob.
diff --git a/gdb/guile/scm-frame.c b/gdb/guile/scm-frame.c
index 22c78928adf..79ecfa16c5e 100644
--- a/gdb/guile/scm-frame.c
+++ b/gdb/guile/scm-frame.c
@@ -21,16 +21,20 @@
conventions, et.al. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.h"
+
+/* Local includes. */
#include "block.h"
#include "frame.h"
#include "inferior.h"
#include "objfiles.h"
+#include "stack.h"
#include "symfile.h"
#include "symtab.h"
-#include "stack.h"
#include "user-regs.h"
#include "value.h"
-#include "guile-internal.h"
/* The <gdb:frame> smob.
The typedef for this struct is in guile-internal.h. */
diff --git a/gdb/guile/scm-gsmob.c b/gdb/guile/scm-gsmob.c
index 5a88e2a35b0..5d5293e07c0 100644
--- a/gdb/guile/scm-gsmob.c
+++ b/gdb/guile/scm-gsmob.c
@@ -42,9 +42,13 @@
lifetime-tracking is required. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.h"
#include "hashtab.h"
+
+/* Local includes. */
#include "objfiles.h"
-#include "guile-internal.h"
/* We need to call this. Undo our hack to prevent others from calling it. */
#undef scm_make_smob_type
diff --git a/gdb/guile/scm-iterator.c b/gdb/guile/scm-iterator.c
index e21215f9cde..8d61ff0647a 100644
--- a/gdb/guile/scm-iterator.c
+++ b/gdb/guile/scm-iterator.c
@@ -51,6 +51,8 @@
this interface of course). */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "guile-internal.h"
/* A smob for iterating over something.
diff --git a/gdb/guile/scm-lazy-string.c b/gdb/guile/scm-lazy-string.c
index a874e685c0c..06846393de1 100644
--- a/gdb/guile/scm-lazy-string.c
+++ b/gdb/guile/scm-lazy-string.c
@@ -21,11 +21,15 @@
conventions, et.al. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.h"
+
+/* Local includes. */
#include "charset.h"
-#include "value.h"
-#include "valprint.h"
#include "language.h"
-#include "guile-internal.h"
+#include "valprint.h"
+#include "value.h"
/* The <gdb:lazy-string> smob. */
diff --git a/gdb/guile/scm-math.c b/gdb/guile/scm-math.c
index d351ed0522c..46c0fab5af7 100644
--- a/gdb/guile/scm-math.c
+++ b/gdb/guile/scm-math.c
@@ -21,15 +21,19 @@
conventions, et.al. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "charset.h"
#include "cp-abi.h"
-#include "target-float.h"
-#include "symtab.h" /* Needed by language.h. */
#include "language.h"
+#include "symtab.h"
+#include "target-float.h"
#include "valprint.h"
#include "value.h"
-#include "guile-internal.h"
/* Note: Use target types here to remain consistent with the values system in
GDB (which uses target arithmetic). */
diff --git a/gdb/guile/scm-objfile.c b/gdb/guile/scm-objfile.c
index c70de766176..eb80d23a4ee 100644
--- a/gdb/guile/scm-objfile.c
+++ b/gdb/guile/scm-objfile.c
@@ -21,10 +21,14 @@
conventions, et.al. */
#include "defs.h"
-#include "objfiles.h"
-#include "language.h"
+
+/* Local non-gdb includes. */
#include "guile-internal.h"
+/* Local includes. */
+#include "language.h"
+#include "objfiles.h"
+
/* The <gdb:objfile> smob.
The typedef for this struct is in guile-internal.h. */
diff --git a/gdb/guile/scm-param.c b/gdb/guile/scm-param.c
index 69bc97eddc7..350e61eb75a 100644
--- a/gdb/guile/scm-param.c
+++ b/gdb/guile/scm-param.c
@@ -18,14 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "value.h"
-#include "charset.h"
-#include "gdbcmd.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.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 "guile-internal.h"
+#include "value.h"
/* A union that can hold anything described by enum var_types. */
diff --git a/gdb/guile/scm-ports.c b/gdb/guile/scm-ports.c
index 2950b1e39ec..e4256e70d51 100644
--- a/gdb/guile/scm-ports.c
+++ b/gdb/guile/scm-ports.c
@@ -22,12 +22,18 @@
conventions, et.al. */
#include "defs.h"
-#include "gdb_select.h"
-#include "top.h"
-#include "target.h"
+
+/* Local non-gdb includes. */
#include "guile-internal.h"
+
+/* Local subdirectory includes. */
#include "common/gdb_optional.h"
+/* Local includes. */
+#include "gdb_select.h"
+#include "target.h"
+#include "top.h"
+
#ifdef HAVE_POLL
#if defined (HAVE_POLL_H)
#include <poll.h>
diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c
index e5096944b68..1df1a328e95 100644
--- a/gdb/guile/scm-pretty-print.c
+++ b/gdb/guile/scm-pretty-print.c
@@ -21,13 +21,17 @@
conventions, et.al. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.h"
+
+/* Local includes. */
#include "charset.h"
-#include "symtab.h" /* Needed by language.h. */
#include "language.h"
#include "objfiles.h"
-#include "value.h"
+#include "symtab.h"
#include "valprint.h"
-#include "guile-internal.h"
+#include "value.h"
/* Return type of print_string_repr. */
diff --git a/gdb/guile/scm-progspace.c b/gdb/guile/scm-progspace.c
index 352d32d147f..b442d49565a 100644
--- a/gdb/guile/scm-progspace.c
+++ b/gdb/guile/scm-progspace.c
@@ -18,12 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "charset.h"
-#include "progspace.h"
-#include "objfiles.h"
#include "language.h"
-#include "arch-utils.h"
-#include "guile-internal.h"
+#include "objfiles.h"
+#include "progspace.h"
/* NOTE: Python exports the name "Progspace", so we export "progspace".
Internally we shorten that to "pspace". */
diff --git a/gdb/guile/scm-safe-call.c b/gdb/guile/scm-safe-call.c
index 86e3bbc356b..518c2643978 100644
--- a/gdb/guile/scm-safe-call.c
+++ b/gdb/guile/scm-safe-call.c
@@ -21,8 +21,12 @@
conventions, et.al. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "filenames.h"
#include "guile-internal.h"
+
+/* Local subdirectory includes. */
#include "common/pathstuff.h"
/* Struct to marshall args to scscm_safe_call_body. */
diff --git a/gdb/guile/scm-string.c b/gdb/guile/scm-string.c
index 56de8d1ab61..b159936db12 100644
--- a/gdb/guile/scm-string.c
+++ b/gdb/guile/scm-string.c
@@ -21,9 +21,13 @@
conventions, et.al. */
#include "defs.h"
-#include "charset.h"
+
+/* Local non-gdb includes. */
#include "guile-internal.h"
+/* Local includes. */
+#include "charset.h"
+
/* Convert STRING to an int.
STRING must be a valid integer. */
diff --git a/gdb/guile/scm-symbol.c b/gdb/guile/scm-symbol.c
index de3a1589e46..b33446de45a 100644
--- a/gdb/guile/scm-symbol.c
+++ b/gdb/guile/scm-symbol.c
@@ -21,12 +21,16 @@
conventions, et.al. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.h"
+
+/* Local includes. */
#include "block.h"
#include "frame.h"
-#include "symtab.h"
#include "objfiles.h"
+#include "symtab.h"
#include "value.h"
-#include "guile-internal.h"
/* The <gdb:symbol> smob. */
diff --git a/gdb/guile/scm-symtab.c b/gdb/guile/scm-symtab.c
index 5ba77557439..7cc51f0c24f 100644
--- a/gdb/guile/scm-symtab.c
+++ b/gdb/guile/scm-symtab.c
@@ -21,12 +21,16 @@
conventions, et.al. */
#include "defs.h"
-#include "symtab.h"
-#include "source.h"
-#include "objfiles.h"
-#include "block.h"
+
+/* Local non-gdb includes. */
#include "guile-internal.h"
+/* Local includes. */
+#include "block.h"
+#include "objfiles.h"
+#include "source.h"
+#include "symtab.h"
+
/* A <gdb:symtab> smob. */
typedef struct
diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c
index 2d2e3ddb3e1..d5865588ea6 100644
--- a/gdb/guile/scm-type.c
+++ b/gdb/guile/scm-type.c
@@ -21,16 +21,22 @@
conventions, et.al. */
#include "defs.h"
-#include "arch-utils.h"
-#include "value.h"
-#include "gdbtypes.h"
-#include "objfiles.h"
-#include "language.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.h"
+
+/* Local subdirectory includes. */
#include "common/vec.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "bcache.h"
#include "dwarf2loc.h"
+#include "gdbtypes.h"
+#include "language.h"
+#include "objfiles.h"
#include "typeprint.h"
-#include "guile-internal.h"
+#include "value.h"
/* The <gdb:type> smob.
The type is chained with all types associated with its objfile, if any.
diff --git a/gdb/guile/scm-utils.c b/gdb/guile/scm-utils.c
index 2710b110c08..9dd45536ef2 100644
--- a/gdb/guile/scm-utils.c
+++ b/gdb/guile/scm-utils.c
@@ -21,6 +21,8 @@
conventions, et.al. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "guile-internal.h"
/* Define VARIABLES in the gdb module. */
diff --git a/gdb/guile/scm-value.c b/gdb/guile/scm-value.c
index 658924b1197..a9f91f59fae 100644
--- a/gdb/guile/scm-value.c
+++ b/gdb/guile/scm-value.c
@@ -21,16 +21,20 @@
conventions, et.al. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "guile-internal.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "charset.h"
#include "cp-abi.h"
-#include "target-float.h"
#include "infcall.h"
-#include "symtab.h" /* Needed by language.h. */
#include "language.h"
+#include "symtab.h"
+#include "target-float.h"
#include "valprint.h"
#include "value.h"
-#include "guile-internal.h"
/* The <gdb:value> smob. */
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index b41a0b6c260..8b0a77f2fcd 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -23,15 +23,19 @@
*/
#include "defs.h"
-#include "value.h"
-#include "arch-utils.h"
-#include "regcache.h"
-#include "gdbcore.h"
-#include "objfiles.h"
+
+/* Local non-gdb includes. */
#include "dis-asm.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "dwarf2-frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
+#include "gdbcore.h"
+#include "objfiles.h"
+#include "regcache.h"
+#include "value.h"
enum gdb_regnum
{
diff --git a/gdb/hppa-bsd-tdep.c b/gdb/hppa-bsd-tdep.c
index 2ebb4269f12..0e7ce7e2a1e 100644
--- a/gdb/hppa-bsd-tdep.c
+++ b/gdb/hppa-bsd-tdep.c
@@ -18,16 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "objfiles.h"
-#include "target.h"
-#include "value.h"
+#include "hppa-bsd-tdep.h"
+/* Local non-gdb includes. */
#include "elf/common.h"
-#include "hppa-tdep.h"
-#include "hppa-bsd-tdep.h"
+/* Local includes. */
#include "dwarf2-frame.h"
+#include "hppa-tdep.h"
+#include "objfiles.h"
#include "solib-svr4.h"
+#include "target.h"
+#include "value.h"
static CORE_ADDR
hppabsd_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
diff --git a/gdb/hppa-linux-nat.c b/gdb/hppa-linux-nat.c
index aea21d1c84b..e81cac78a64 100644
--- a/gdb/hppa-linux-nat.c
+++ b/gdb/hppa-linux-nat.c
@@ -18,21 +18,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "inferior.h"
-#include "target.h"
-#include "linux-nat.h"
-#include "inf-ptrace.h"
+/* Standard C includes. */
+#include <asm/ptrace.h>
+#include <linux/version.h>
#include <sys/procfs.h>
+
+/* Local subdirectory includes. */
#include "nat/gdb_ptrace.h"
-#include <linux/version.h>
-#include <asm/ptrace.h>
+/* Local includes. */
+#include "gdbcore.h"
#include "hppa-linux-offsets.h"
-
#include "hppa-tdep.h"
+#include "inf-ptrace.h"
+#include "inferior.h"
+#include "linux-nat.h"
+#include "regcache.h"
+#include "target.h"
class hppa_linux_nat_target final : public linux_nat_target
{
diff --git a/gdb/hppa-linux-tdep.c b/gdb/hppa-linux-tdep.c
index dfa4113a023..b07c73346bd 100644
--- a/gdb/hppa-linux-tdep.c
+++ b/gdb/hppa-linux-tdep.c
@@ -18,21 +18,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "elf/common.h"
+
+/* Local includes. */
+#include "dwarf2-frame.h"
+#include "frame-unwind.h"
#include "gdbcore.h"
-#include "osabi.h"
-#include "target.h"
+#include "glibc-tdep.h"
+#include "hppa-tdep.h"
+#include "linux-tdep.h"
#include "objfiles.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
#include "solib-svr4.h"
-#include "glibc-tdep.h"
-#include "frame-unwind.h"
+#include "target.h"
#include "trad-frame.h"
-#include "dwarf2-frame.h"
#include "value.h"
-#include "regset.h"
-#include "regcache.h"
-#include "hppa-tdep.h"
-#include "linux-tdep.h"
-#include "elf/common.h"
/* Map DWARF DBX register numbers to GDB register numbers. */
static int
diff --git a/gdb/hppa-nbsd-nat.c b/gdb/hppa-nbsd-nat.c
index 2e365d3fddb..6b21bfd05fb 100644
--- a/gdb/hppa-nbsd-nat.c
+++ b/gdb/hppa-nbsd-nat.c
@@ -18,17 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "regcache.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
+/* Standard C includes. */
#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
+/* Local includes. */
#include "hppa-tdep.h"
#include "inf-ptrace.h"
-
+#include "inferior.h"
#include "nbsd-nat.h"
+#include "regcache.h"
class hppa_nbsd_nat_target final : public nbsd_nat_target
{
diff --git a/gdb/hppa-nbsd-tdep.c b/gdb/hppa-nbsd-tdep.c
index 2ce842e7af7..fb0fd571863 100644
--- a/gdb/hppa-nbsd-tdep.c
+++ b/gdb/hppa-nbsd-tdep.c
@@ -18,16 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
+#include "hppa-bsd-tdep.h"
+#include "hppa-tdep.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
-
#include "trad-frame.h"
#include "tramp-frame.h"
-#include "hppa-tdep.h"
-#include "hppa-bsd-tdep.h"
-
/* From <machine/mcontext.h>. */
static int hppanbsd_mc_reg_offset[] =
{
diff --git a/gdb/hppa-obsd-nat.c b/gdb/hppa-obsd-nat.c
index 9ce4ab41380..e59ac670a87 100644
--- a/gdb/hppa-obsd-nat.c
+++ b/gdb/hppa-obsd-nat.c
@@ -18,18 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "target.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
+/* Standard C includes. */
#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
+/* Local includes. */
#include "hppa-tdep.h"
#include "inf-ptrace.h"
-
+#include "inferior.h"
#include "obsd-nat.h"
+#include "regcache.h"
+#include "target.h"
struct hppa_obsd_nat_target final : public obsd_nat_target
{
diff --git a/gdb/hppa-obsd-tdep.c b/gdb/hppa-obsd-tdep.c
index 553334535ee..8860834b31b 100644
--- a/gdb/hppa-obsd-tdep.c
+++ b/gdb/hppa-obsd-tdep.c
@@ -18,13 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
+#include "hppa-bsd-tdep.h"
+#include "hppa-tdep.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
-#include "hppa-tdep.h"
-#include "hppa-bsd-tdep.h"
-
/* Core file support. */
/* Sizeof `struct reg' in <machine/reg.h>. */
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index d2b3336cfc7..74c7c9f7cf6 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -21,12 +21,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "hppa-tdep.h"
+
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "inferior.h"
-#include "regcache.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "completer.h"
+#include "inferior.h"
#include "osabi.h"
-#include "arch-utils.h"
+#include "regcache.h"
+
/* For argument passing to the inferior. */
#include "symtab.h"
#include "dis-asm.h"
diff --git a/gdb/i386-bsd-nat.c b/gdb/i386-bsd-nat.c
index a10b496096e..4f2be63bc0d 100644
--- a/gdb/i386-bsd-nat.c
+++ b/gdb/i386-bsd-nat.c
@@ -18,20 +18,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "regcache.h"
+#include "i386-bsd-nat.h"
+/* Standard C includes. */
+#include <machine/frame.h>
+#include <machine/reg.h>
#include <signal.h>
-#include <sys/types.h>
#include <sys/ptrace.h>
-#include <machine/reg.h>
-#include <machine/frame.h>
+#include <sys/types.h>
+/* Local includes. */
#include "i386-tdep.h"
#include "i387-tdep.h"
-#include "x86-bsd-nat.h"
-#include "i386-bsd-nat.h"
#include "inf-ptrace.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "x86-bsd-nat.h"
+
/* In older BSD versions we cannot get at some of the segment
diff --git a/gdb/i386-bsd-tdep.c b/gdb/i386-bsd-tdep.c
index 607e4d8b6ba..463eac28bc8 100644
--- a/gdb/i386-bsd-tdep.c
+++ b/gdb/i386-bsd-tdep.c
@@ -18,13 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "frame.h"
#include "gdbcore.h"
-#include "regcache.h"
-#include "osabi.h"
-
#include "i386-tdep.h"
+#include "osabi.h"
+#include "regcache.h"
/* Support for signal handlers. */
diff --git a/gdb/i386-cygwin-tdep.c b/gdb/i386-cygwin-tdep.c
index 1acd37975ee..6577f0edb46 100644
--- a/gdb/i386-cygwin-tdep.c
+++ b/gdb/i386-cygwin-tdep.c
@@ -18,14 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
-#include "i386-tdep.h"
-#include "windows-tdep.h"
-#include "regset.h"
+
+/* Local includes. */
#include "gdb_obstack.h"
-#include "xml-support.h"
#include "gdbcore.h"
+#include "i386-tdep.h"
#include "inferior.h"
+#include "osabi.h"
+#include "regset.h"
+#include "windows-tdep.h"
+#include "xml-support.h"
/* Core file support. */
diff --git a/gdb/i386-darwin-nat.c b/gdb/i386-darwin-nat.c
index 1187fc57f6d..9c4acfd2a94 100644
--- a/gdb/i386-darwin-nat.c
+++ b/gdb/i386-darwin-nat.c
@@ -19,23 +19,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "darwin-nat.h"
#include "frame.h"
-#include "inferior.h"
-#include "target.h"
-#include "symfile.h"
-#include "symtab.h"
-#include "objfiles.h"
+#include "gdbarch.h"
#include "gdbcmd.h"
-#include "regcache.h"
+#include "gdbcore.h"
+#include "i386-darwin-tdep.h"
#include "i386-tdep.h"
#include "i387-tdep.h"
-#include "gdbarch.h"
-#include "arch-utils.h"
-#include "gdbcore.h"
-
+#include "inferior.h"
+#include "objfiles.h"
+#include "regcache.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
#include "x86-nat.h"
-#include "darwin-nat.h"
-#include "i386-darwin-tdep.h"
#ifdef BFD64
#include "amd64-nat.h"
diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c
index 22653d36606..8bf7449ded3 100644
--- a/gdb/i386-darwin-tdep.c
+++ b/gdb/i386-darwin-tdep.c
@@ -19,23 +19,26 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "i386-darwin-tdep.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local includes. */
+#include "dwarf2-frame.h"
#include "frame.h"
-#include "inferior.h"
#include "gdbcore.h"
-#include "target.h"
-#include "symtab.h"
-#include "regcache.h"
-#include "objfiles.h"
-
-#include "i387-tdep.h"
#include "i386-tdep.h"
+#include "i387-tdep.h"
+#include "inferior.h"
+#include "objfiles.h"
#include "osabi.h"
-#include "ui-out.h"
-#include "i386-darwin-tdep.h"
-#include "solib.h"
+#include "regcache.h"
#include "solib-darwin.h"
-#include "dwarf2-frame.h"
-#include <algorithm>
+#include "solib.h"
+#include "symtab.h"
+#include "target.h"
+#include "ui-out.h"
/* Offsets into the struct i386_thread_state where we'll find the saved regs.
From <mach/i386/thread_status.h> and i386-tdep.h. */
diff --git a/gdb/i386-dicos-tdep.c b/gdb/i386-dicos-tdep.c
index 3f78cebb526..d1cb1774de5 100644
--- a/gdb/i386-dicos-tdep.c
+++ b/gdb/i386-dicos-tdep.c
@@ -18,8 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
+
+/* Local includes. */
#include "dicos-tdep.h"
+#include "osabi.h"
static void
i386_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
diff --git a/gdb/i386-fbsd-nat.c b/gdb/i386-fbsd-nat.c
index be5d4c67be7..67544cf2fae 100644
--- a/gdb/i386-fbsd-nat.c
+++ b/gdb/i386-fbsd-nat.c
@@ -18,21 +18,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "target.h"
-#include <sys/types.h>
+/* Standard C includes. */
#include <sys/ptrace.h>
#include <sys/sysctl.h>
+#include <sys/types.h>
#include <sys/user.h>
+/* Local subdirectory includes. */
+#include "common/x86-xstate.h"
+
+/* Local includes. */
#include "fbsd-nat.h"
+#include "i386-bsd-nat.h"
#include "i386-tdep.h"
-#include "x86-nat.h"
-#include "common/x86-xstate.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "target.h"
#include "x86-bsd-nat.h"
-#include "i386-bsd-nat.h"
+#include "x86-nat.h"
class i386_fbsd_nat_target final
: public i386_bsd_nat_target<fbsd_nat_target>
diff --git a/gdb/i386-fbsd-tdep.c b/gdb/i386-fbsd-tdep.c
index f274847174c..76b0dc7225f 100644
--- a/gdb/i386-fbsd-tdep.c
+++ b/gdb/i386-fbsd-tdep.c
@@ -18,17 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "gdbcore.h"
-#include "osabi.h"
-#include "regcache.h"
-#include "regset.h"
#include "i386-fbsd-tdep.h"
+
+/* Local subdirectory includes. */
#include "common/x86-xstate.h"
+/* Local includes. */
+#include "arch-utils.h"
+#include "fbsd-tdep.h"
+#include "gdbcore.h"
#include "i386-tdep.h"
#include "i387-tdep.h"
-#include "fbsd-tdep.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
#include "solib-svr4.h"
/* Support for signal handlers. */
diff --git a/gdb/i386-gnu-nat.c b/gdb/i386-gnu-nat.c
index 087445bc626..fc11a56d15a 100644
--- a/gdb/i386-gnu-nat.c
+++ b/gdb/i386-gnu-nat.c
@@ -18,6 +18,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Include this first, to pick up the <mach.h> 'thread_info' diversion. */
+#include "defs.h"
+
+/* Local includes. */
#include "gnu-nat.h"
/* Mach/Hurd headers are not yet ready for C++ compilation. */
diff --git a/gdb/i386-gnu-tdep.c b/gdb/i386-gnu-tdep.c
index cb4f11a29dd..ba698f900c1 100644
--- a/gdb/i386-gnu-tdep.c
+++ b/gdb/i386-gnu-tdep.c
@@ -17,10 +17,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
-#include "solib-svr4.h"
+/* Local includes. */
#include "i386-tdep.h"
+#include "osabi.h"
+#include "solib-svr4.h"
/* From <sys/ucontext.h>. */
static int i386gnu_gregset_reg_offset[] =
diff --git a/gdb/i386-go32-tdep.c b/gdb/i386-go32-tdep.c
index 30db72d880e..64d10dcbe8a 100644
--- a/gdb/i386-go32-tdep.c
+++ b/gdb/i386-go32-tdep.c
@@ -18,10 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "i386-tdep.h"
+
+/* Local subdirectory includes. */
#include "common/x86-xstate.h"
-#include "target-descriptions.h"
+
+/* Local includes. */
+#include "i386-tdep.h"
#include "osabi.h"
+#include "target-descriptions.h"
static void
i386_go32_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index abcf72f8989..3316027fb72 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -18,24 +18,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "elf/common.h"
-#include "nat/gdb_ptrace.h"
+#include "i386-linux-nat.h"
+
+/* Standard C includes. */
#include <sys/uio.h>
-#include "gregset.h"
-#include "gdb_proc_service.h"
-#include "i386-linux-nat.h"
-#include "i387-tdep.h"
-#include "i386-tdep.h"
-#include "i386-linux-tdep.h"
-#include "common/x86-xstate.h"
+/* Local non-gdb includes. */
+#include "elf/common.h"
-#include "x86-linux-nat.h"
+/* Local subdirectory includes. */
+#include "common/x86-xstate.h"
+#include "nat/gdb_ptrace.h"
#include "nat/linux-ptrace.h"
+
+/* Local includes. */
+#include "gdb_proc_service.h"
+#include "gdbcore.h"
+#include "gregset.h"
+#include "i386-linux-tdep.h"
+#include "i386-tdep.h"
+#include "i387-tdep.h"
#include "inf-ptrace.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "x86-linux-nat.h"
struct i386_linux_nat_target final : public x86_linux_nat_target
{
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index fa6b86f1c89..09a0bb619f8 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -18,28 +18,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
+#include "i386-linux-tdep.h"
+
+/* Local subdirectory includes. */
+#include "common/x86-xstate.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "dwarf2-frame.h"
#include "frame.h"
-#include "value.h"
-#include "regcache.h"
-#include "regset.h"
+#include "gdbcore.h"
+#include "glibc-tdep.h"
+#include "i386-tdep.h"
+#include "i387-tdep.h"
#include "inferior.h"
+#include "linux-tdep.h"
#include "osabi.h"
+#include "regcache.h"
#include "reggroups.h"
-#include "dwarf2-frame.h"
-#include "i386-tdep.h"
-#include "i386-linux-tdep.h"
-#include "linux-tdep.h"
-#include "utils.h"
-#include "glibc-tdep.h"
+#include "regset.h"
#include "solib-svr4.h"
#include "symtab.h"
-#include "arch-utils.h"
+#include "utils.h"
+#include "value.h"
#include "xml-syscall.h"
-#include "i387-tdep.h"
-#include "common/x86-xstate.h"
-
/* The syscall's XML filename for i386. */
#define XML_SYSCALL_FILENAME_I386 "syscalls/i386-linux.xml"
diff --git a/gdb/i386-nbsd-nat.c b/gdb/i386-nbsd-nat.c
index 6e92ea8dbd6..94635bff293 100644
--- a/gdb/i386-nbsd-nat.c
+++ b/gdb/i386-nbsd-nat.c
@@ -18,13 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "gdbcore.h"
+#include "i386-bsd-nat.h"
+#include "i386-tdep.h"
#include "regcache.h"
#include "target.h"
-#include "i386-tdep.h"
-#include "i386-bsd-nat.h"
-
/* Support for debugging kernel virtual memory images. */
#include <sys/types.h>
diff --git a/gdb/i386-nbsd-tdep.c b/gdb/i386-nbsd-tdep.c
index d39d1b4d4c3..70c012b7dfd 100644
--- a/gdb/i386-nbsd-tdep.c
+++ b/gdb/i386-nbsd-tdep.c
@@ -18,21 +18,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "frame.h"
#include "gdbcore.h"
+#include "i386-tdep.h"
+#include "i387-tdep.h"
+#include "nbsd-tdep.h"
+#include "osabi.h"
#include "regcache.h"
#include "regset.h"
-#include "osabi.h"
+#include "solib-svr4.h"
#include "symtab.h"
#include "trad-frame.h"
#include "tramp-frame.h"
-#include "i386-tdep.h"
-#include "i387-tdep.h"
-#include "nbsd-tdep.h"
-#include "solib-svr4.h"
-
/* From <machine/reg.h>. */
static int i386nbsd_r_reg_offset[] =
{
diff --git a/gdb/i386-nto-tdep.c b/gdb/i386-nto-tdep.c
index 91f99da0c1e..ccdf5217765 100644
--- a/gdb/i386-nto-tdep.c
+++ b/gdb/i386-nto-tdep.c
@@ -20,16 +20,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "osabi.h"
-#include "regcache.h"
-#include "target.h"
+/* Local includes. */
+#include "frame.h"
#include "i386-tdep.h"
#include "i387-tdep.h"
#include "nto-tdep.h"
-#include "solib.h"
+#include "osabi.h"
+#include "regcache.h"
#include "solib-svr4.h"
+#include "solib.h"
+#include "target.h"
#ifndef X86_CPU_FXSR
#define X86_CPU_FXSR (1L << 12)
diff --git a/gdb/i386-obsd-nat.c b/gdb/i386-obsd-nat.c
index e0eb9573753..335624e269d 100644
--- a/gdb/i386-obsd-nat.c
+++ b/gdb/i386-obsd-nat.c
@@ -18,18 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "target.h"
-#include <sys/sysctl.h>
+/* Standard C includes. */
#include <machine/frame.h>
#include <machine/pcb.h>
+#include <sys/sysctl.h>
-#include "i386-tdep.h"
+/* Local includes. */
+#include "bsd-kvm.h"
+#include "gdbcore.h"
#include "i386-bsd-nat.h"
+#include "i386-tdep.h"
#include "obsd-nat.h"
-#include "bsd-kvm.h"
+#include "regcache.h"
+#include "target.h"
static int
i386obsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
diff --git a/gdb/i386-obsd-tdep.c b/gdb/i386-obsd-tdep.c
index 574f45d7405..81ae232146b 100644
--- a/gdb/i386-obsd-tdep.c
+++ b/gdb/i386-obsd-tdep.c
@@ -18,24 +18,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "arch-utils.h"
-#include "frame.h"
+#include "bsd-uthread.h"
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
+#include "i386-tdep.h"
+#include "i387-tdep.h"
+#include "objfiles.h"
+#include "obsd-tdep.h"
+#include "osabi.h"
#include "regcache.h"
#include "regset.h"
+#include "solib-svr4.h"
#include "symtab.h"
-#include "objfiles.h"
-#include "osabi.h"
#include "target.h"
#include "trad-frame.h"
-#include "obsd-tdep.h"
-#include "i386-tdep.h"
-#include "i387-tdep.h"
-#include "solib-svr4.h"
-#include "bsd-uthread.h"
-
/* Support for signal handlers. */
/* Since OpenBSD 3.2, the sigtramp routine is mapped at a random page
diff --git a/gdb/i386-sol2-nat.c b/gdb/i386-sol2-nat.c
index b5a334b8095..e79b889a1d5 100644
--- a/gdb/i386-sol2-nat.c
+++ b/gdb/i386-sol2-nat.c
@@ -18,13 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "regcache.h"
-#include <sys/reg.h>
+/* Standard C includes. */
#include <sys/procfs.h>
+#include <sys/reg.h>
+
+/* Local includes. */
#include "gregset.h"
-#include "target.h"
#include "procfs.h"
+#include "regcache.h"
+#include "target.h"
/* This file provids the (temporary) glue between the Solaris x86
target dependent code and the machine independent SVR4 /proc
diff --git a/gdb/i386-sol2-tdep.c b/gdb/i386-sol2-tdep.c
index 328d33cf574..afd63560b2e 100644
--- a/gdb/i386-sol2-tdep.c
+++ b/gdb/i386-sol2-tdep.c
@@ -18,12 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "value.h"
-#include "osabi.h"
-#include "sol2-tdep.h"
+/* Local includes. */
#include "i386-tdep.h"
+#include "osabi.h"
+#include "sol2-tdep.h"
#include "solib-svr4.h"
+#include "value.h"
/* From <ia32/sys/reg.h>. */
static int i386_sol2_gregset_reg_offset[] =
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 4e63832b0e6..3c21239c8c6 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -18,53 +18,60 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "i386-tdep.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
#include "opcode/i386.h"
+
+/* Local subdirectory includes. */
+#include "arch/i386.h"
+#include "cli/cli-utils.h"
+#include "common/x86-xstate.h"
+
+/* Local includes. */
#include "arch-utils.h"
+#include "ax-gdb.h"
+#include "ax.h"
#include "command.h"
+#include "disasm.h"
#include "dummy-frame.h"
#include "dwarf2-frame.h"
-#include "frame.h"
+#include "expression.h"
#include "frame-base.h"
#include "frame-unwind.h"
-#include "inferior.h"
-#include "infrun.h"
+#include "frame.h"
#include "gdbcmd.h"
#include "gdbcore.h"
#include "gdbtypes.h"
+#include "i387-tdep.h"
+#include "inferior.h"
+#include "infrun.h"
#include "objfiles.h"
#include "osabi.h"
+#include "parser-defs.h"
+#include "record-full.h"
+#include "record.h"
#include "regcache.h"
#include "reggroups.h"
#include "regset.h"
+#include "remote.h"
+#include "stap-probe.h"
#include "symfile.h"
#include "symtab.h"
-#include "target.h"
+#include "target-descriptions.h"
#include "target-float.h"
+#include "target.h"
+#include "user-regs.h"
#include "value.h"
-#include "dis-asm.h"
-#include "disasm.h"
-#include "remote.h"
-#include "i386-tdep.h"
-#include "i387-tdep.h"
-#include "common/x86-xstate.h"
#include "x86-tdep.h"
-#include "record.h"
-#include "record-full.h"
-#include "target-descriptions.h"
-#include "arch/i386.h"
-
-#include "ax.h"
-#include "ax-gdb.h"
-
-#include "stap-probe.h"
-#include "user-regs.h"
-#include "cli/cli-utils.h"
-#include "expression.h"
-#include "parser-defs.h"
-#include <ctype.h>
-#include <algorithm>
-
/* Register names. */
static const char *i386_register_names[] =
diff --git a/gdb/i386-windows-nat.c b/gdb/i386-windows-nat.c
index fa85cd1de3e..e21bb63683a 100644
--- a/gdb/i386-windows-nat.c
+++ b/gdb/i386-windows-nat.c
@@ -16,12 +16,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "windows-nat.h"
-#include "x86-nat.h"
-#include "i386-tdep.h"
+/* Standard C includes. */
#include <windows.h>
+/* Local includes. */
+#include "i386-tdep.h"
+#include "windows-nat.h"
+#include "x86-nat.h"
+
#define context_offset(x) ((int)&(((CONTEXT *)NULL)->x))
static const int mappings[] =
{
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index 25786619bfa..6df6810a1cc 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -18,18 +18,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "i387-tdep.h"
+
+/* Local subdirectory includes. */
+#include "common/x86-xstate.h"
+
+/* Local includes. */
#include "frame.h"
#include "gdbcore.h"
+#include "i386-tdep.h"
#include "inferior.h"
#include "language.h"
#include "regcache.h"
#include "target-float.h"
#include "value.h"
-#include "i386-tdep.h"
-#include "i387-tdep.h"
-#include "common/x86-xstate.h"
-
/* Print the floating point number specified by RAW. */
static void
diff --git a/gdb/ia64-libunwind-tdep.c b/gdb/ia64-libunwind-tdep.c
index 00ebf638f4d..762357fae76 100644
--- a/gdb/ia64-libunwind-tdep.c
+++ b/gdb/ia64-libunwind-tdep.c
@@ -20,23 +20,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "ia64-libunwind-tdep.h"
-#include "inferior.h"
-#include "frame.h"
+/* Standard C includes. */
+#include <dlfcn.h>
+
+/* Local subdirectory includes. */
+#include "common/preprocessor.h"
+
+/* Local includes. */
+#include "complaints.h"
#include "frame-base.h"
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
#include "gdbtypes.h"
-#include "symtab.h"
+#include "inferior.h"
#include "objfiles.h"
#include "regcache.h"
-
-#include <dlfcn.h>
-
-#include "ia64-libunwind-tdep.h"
-
-#include "complaints.h"
-#include "common/preprocessor.h"
+#include "symtab.h"
/* IA-64 is the only target that currently uses ia64-libunwind-tdep.
Note how UNW_TARGET, UNW_OBJ, etc. are compile time constants below.
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index a77a86f490c..261a4f7fcfc 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -19,24 +19,28 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "ia64-tdep.h"
-#include "linux-nat.h"
+/* Standard C includes. */
+#include <asm/ptrace_offsets.h>
#include <signal.h>
-#include "nat/gdb_ptrace.h"
-#include "common/gdb_wait.h"
+#include <sys/procfs.h>
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
#endif
#include <sys/syscall.h>
#include <sys/user.h>
-#include <asm/ptrace_offsets.h>
-#include <sys/procfs.h>
+/* Local subdirectory includes. */
+#include "common/gdb_wait.h"
+#include "nat/gdb_ptrace.h"
+
+/* Local includes. */
+#include "gdbcore.h"
+#include "ia64-tdep.h"
+#include "inferior.h"
+#include "linux-nat.h"
+#include "regcache.h"
+#include "target.h"
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
diff --git a/gdb/ia64-linux-tdep.c b/gdb/ia64-linux-tdep.c
index f1954911a71..76101667c42 100644
--- a/gdb/ia64-linux-tdep.c
+++ b/gdb/ia64-linux-tdep.c
@@ -18,17 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "ia64-tdep.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local includes. */
#include "arch-utils.h"
#include "gdbcore.h"
-#include "regcache.h"
+#include "ia64-tdep.h"
+#include "linux-tdep.h"
#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
#include "solib-svr4.h"
#include "symtab.h"
-#include "linux-tdep.h"
-#include "regset.h"
-
-#include <ctype.h>
/* The sigtramp code is in a non-readable (executable-only) region
of memory called the ``gate page''. The addresses in question
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 7b4d0a0bfa1..a2501a008b1 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -18,26 +18,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "arch-utils.h"
+#include "ia64-tdep.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "elf-bfd.h"
+#include "elf/common.h"
#include "floatformat.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "cp-abi.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcore.h"
#include "gdbtypes.h"
+#include "infcall.h"
+#include "inferior.h"
+#include "objfiles.h"
+#include "osabi.h"
#include "regcache.h"
#include "reggroups.h"
-#include "frame.h"
-#include "frame-base.h"
-#include "frame-unwind.h"
#include "target-float.h"
#include "value.h"
-#include "objfiles.h"
-#include "elf/common.h" /* for DT_PLTGOT value */
-#include "elf-bfd.h"
-#include "dis-asm.h"
-#include "infcall.h"
-#include "osabi.h"
-#include "ia64-tdep.h"
-#include "cp-abi.h"
#ifdef HAVE_LIBUNWIND_IA64_H
#include "elf/ia64.h" /* for PT_IA_64_UNWIND value */
diff --git a/gdb/ia64-vms-tdep.c b/gdb/ia64-vms-tdep.c
index 6a15c92c805..ab6485c4e65 100644
--- a/gdb/ia64-vms-tdep.c
+++ b/gdb/ia64-vms-tdep.c
@@ -18,11 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "frame-unwind.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
#include "ia64-tdep.h"
#include "osabi.h"
-#include "gdbtypes.h"
-#include "gdbcore.h"
#ifdef HAVE_LIBUNWIND_IA64_H
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index 41e9e67252b..e8a010d76e3 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -23,22 +23,27 @@
necessary. */
#include "defs.h"
-#include "regcache.h"
-#include "memattr.h"
-#include "symtab.h"
-#include "target.h"
-#include "inferior.h"
-#include <sys/stat.h>
#include "inf-child.h"
-#include "common/fileio.h"
-#include "common/agent.h"
-#include "common/gdb_wait.h"
-#include "common/filestuff.h"
-#include <sys/types.h>
+/* Standard C includes. */
#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
+/* Local subdirectory includes. */
+#include "common/agent.h"
+#include "common/fileio.h"
+#include "common/filestuff.h"
+#include "common/gdb_wait.h"
+
+/* Local includes. */
+#include "inferior.h"
+#include "memattr.h"
+#include "regcache.h"
+#include "symtab.h"
+#include "target.h"
+
static const target_info inf_child_target_info = {
"native",
N_("Native process"),
diff --git a/gdb/inf-child.h b/gdb/inf-child.h
index b3e451837c7..6dd5bfeccc6 100644
--- a/gdb/inf-child.h
+++ b/gdb/inf-child.h
@@ -20,8 +20,8 @@
#ifndef INF_CHILD_H
#define INF_CHILD_H
-#include "target.h"
#include "process-stratum-target.h"
+#include "target.h"
/* A prototype child target. The client can override it with local
methods. */
diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c
index d0e19d5f824..1693e4aacaa 100644
--- a/gdb/inf-loop.c
+++ b/gdb/inf-loop.c
@@ -18,18 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "infrun.h"
+#include "inf-loop.h"
+
+/* Local includes. */
+#include "continuations.h"
#include "event-loop.h"
#include "event-top.h"
-#include "inf-loop.h"
-#include "remote.h"
-#include "language.h"
#include "gdbthread.h"
-#include "continuations.h"
+#include "inferior.h"
+#include "infrun.h"
#include "interps.h"
-#include "top.h"
+#include "language.h"
#include "observable.h"
+#include "remote.h"
+#include "top.h"
/* General function to handle events in the inferior. */
diff --git a/gdb/inf-loop.h b/gdb/inf-loop.h
index 15d684c41c1..be317d2ff92 100644
--- a/gdb/inf-loop.h
+++ b/gdb/inf-loop.h
@@ -20,7 +20,7 @@
#ifndef INF_LOOP_H
#define INF_LOOP_H
-#include "target.h" /* For enum inferior_event_type. */
+#include "target.h"
extern void inferior_event_handler (enum inferior_event_type event_type,
void* client_data);
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index e1acd8dc9df..59697e908a3 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -18,20 +18,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "inf-ptrace.h"
+
+/* Standard C includes. */
+#include <signal.h>
+
+/* Local subdirectory includes. */
+#include "common/gdb_wait.h"
+#include "nat/fork-inferior.h"
+#include "nat/gdb_ptrace.h"
+
+/* Local includes. */
#include "command.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "inf-child.h"
#include "inferior.h"
#include "inflow.h"
-#include "terminal.h"
-#include "gdbcore.h"
#include "regcache.h"
-#include "nat/gdb_ptrace.h"
-#include "common/gdb_wait.h"
-#include <signal.h>
-
-#include "inf-ptrace.h"
-#include "inf-child.h"
-#include "gdbthread.h"
-#include "nat/fork-inferior.h"
+#include "terminal.h"
#include "utils.h"
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 0deb37da962..4127773b3ea 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -19,29 +19,35 @@
#include "defs.h"
#include "infcall.h"
-#include "breakpoint.h"
-#include "tracepoint.h"
-#include "target.h"
-#include "regcache.h"
-#include "inferior.h"
-#include "infrun.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local subdirectory includes. */
+#include "common/scope-exit.h"
+
+/* Local includes. */
+#include "ada-lang.h"
#include "block.h"
-#include "gdbcore.h"
-#include "language.h"
-#include "objfiles.h"
-#include "gdbcmd.h"
+#include "breakpoint.h"
#include "command.h"
#include "dummy-frame.h"
-#include "ada-lang.h"
+#include "event-top.h"
#include "f-lang.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
#include "gdbthread.h"
-#include "event-top.h"
-#include "observable.h"
-#include "top.h"
+#include "inferior.h"
+#include "infrun.h"
#include "interps.h"
+#include "language.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "regcache.h"
+#include "target.h"
#include "thread-fsm.h"
-#include <algorithm>
-#include "common/scope-exit.h"
+#include "top.h"
+#include "tracepoint.h"
/* If we can't find a function's name from its address,
we print this instead. */
diff --git a/gdb/infcall.h b/gdb/infcall.h
index 330fc921593..0ba5bf4c9eb 100644
--- a/gdb/infcall.h
+++ b/gdb/infcall.h
@@ -20,9 +20,11 @@
#ifndef INFCALL_H
#define INFCALL_H
-#include "dummy-frame.h"
#include "common/array-view.h"
+/* Local includes. */
+#include "dummy-frame.h"
+
struct value;
struct type;
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index c5977c48a90..d4a77e677a2 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -18,48 +18,54 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
+
+/* Standard C includes. */
+#include <ctype.h>
#include <signal.h>
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "frame.h"
-#include "inferior.h"
-#include "infrun.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-decode.h"
+#include "cli/cli-utils.h"
#include "common/environ.h"
-#include "value.h"
+#include "common/gdb_optional.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "block.h"
+#include "completer.h"
+#include "continuations.h"
+#include "event-top.h"
+#include "frame.h"
#include "gdbcmd.h"
-#include "symfile.h"
#include "gdbcore.h"
-#include "target.h"
+#include "gdbthread.h"
+#include "gdbtypes.h"
+#include "inf-loop.h"
+#include "infcall.h"
+#include "inferior.h"
+#include "infrun.h"
+#include "inline-frame.h"
+#include "interps.h"
#include "language.h"
+#include "linespec.h"
#include "objfiles.h"
-#include "completer.h"
-#include "ui-out.h"
-#include "event-top.h"
+#include "observable.h"
#include "parser-defs.h"
#include "regcache.h"
#include "reggroups.h"
-#include "block.h"
#include "solib.h"
-#include <ctype.h>
-#include "observable.h"
+#include "source.h"
+#include "symfile.h"
+#include "symtab.h"
#include "target-descriptions.h"
-#include "user-regs.h"
-#include "cli/cli-decode.h"
-#include "gdbthread.h"
-#include "valprint.h"
-#include "inline-frame.h"
-#include "tracepoint.h"
-#include "inf-loop.h"
-#include "continuations.h"
-#include "linespec.h"
-#include "cli/cli-utils.h"
-#include "infcall.h"
+#include "target.h"
#include "thread-fsm.h"
#include "top.h"
-#include "interps.h"
-#include "common/gdb_optional.h"
-#include "source.h"
+#include "tracepoint.h"
+#include "ui-out.h"
+#include "user-regs.h"
+#include "valprint.h"
+#include "value.h"
/* Local functions: */
diff --git a/gdb/inferior.c b/gdb/inferior.c
index e995af816c1..1d99f1458f4 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -18,24 +18,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "exec.h"
#include "inferior.h"
-#include "target.h"
+
+/* Local non-gdb includes. */
+#include "readline/tilde.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+#include "common/environ.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "command.h"
#include "completer.h"
+#include "continuations.h"
+#include "exec.h"
#include "gdbcmd.h"
+#include "gdbcore.h"
#include "gdbthread.h"
-#include "ui-out.h"
#include "observable.h"
-#include "gdbcore.h"
+#include "progspace-and-thread.h"
#include "symfile.h"
-#include "common/environ.h"
-#include "cli/cli-utils.h"
-#include "continuations.h"
-#include "arch-utils.h"
#include "target-descriptions.h"
-#include "readline/tilde.h"
-#include "progspace-and-thread.h"
+#include "target.h"
+#include "ui-out.h"
/* Keep a registry of per-inferior data-pointers required by other GDB
modules. */
diff --git a/gdb/inflow.c b/gdb/inflow.c
index b71511308b3..6a56bf6acde 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -17,28 +17,32 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "command.h"
-#include "serial.h"
-#include "terminal.h"
-#include "target.h"
-#include "gdbthread.h"
-#include "observable.h"
-#include <signal.h>
-#include <fcntl.h>
-#include "gdb_select.h"
-
#include "inflow.h"
-#include "gdbcmd.h"
+
+/* Standard C includes. */
+#include <fcntl.h>
+#include <signal.h>
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
+
+/* Local subdirectory includes. */
#include "common/job-control.h"
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
+/* Local includes. */
+#include "command.h"
+#include "frame.h"
+#include "gdb_select.h"
+#include "gdbcmd.h"
+#include "gdbthread.h"
+#include "inferior.h"
+#include "observable.h"
+#include "serial.h"
+#include "target.h"
+#include "terminal.h"
#ifndef O_NOCTTY
#define O_NOCTTY 0
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 0cfa2d6825d..3c3f2145550 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -20,55 +20,61 @@
#include "defs.h"
#include "infrun.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "symtab.h"
-#include "frame.h"
-#include "inferior.h"
-#include "breakpoint.h"
+#include <signal.h>
+
+/* Local subdirectory includes. */
+#include "cli/cli-script.h"
+#include "common/enum-flags.h"
+#include "common/forward-scope-exit.h"
+#include "common/gdb_optional.h"
#include "common/gdb_wait.h"
-#include "gdbcore.h"
+#include "common/scope-exit.h"
+#include "mi/mi-common.h"
+
+/* Local includes. */
+#include "annotate.h"
+#include "arch-utils.h"
+#include "block.h"
+#include "breakpoint.h"
+#include "completer.h"
+#include "continuations.h"
+#include "dictionary.h"
+#include "event-loop.h"
+#include "event-top.h"
+#include "frame.h"
#include "gdbcmd.h"
-#include "cli/cli-script.h"
-#include "target.h"
+#include "gdbcore.h"
#include "gdbthread.h"
-#include "annotate.h"
-#include "symfile.h"
-#include "top.h"
-#include <signal.h>
#include "inf-loop.h"
-#include "regcache.h"
-#include "value.h"
-#include "observable.h"
+#include "inferior.h"
+#include "inline-frame.h"
+#include "interps.h"
+#include "jit.h"
#include "language.h"
-#include "solib.h"
#include "main.h"
-#include "dictionary.h"
-#include "block.h"
-#include "mi/mi-common.h"
-#include "event-top.h"
-#include "record.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "probe.h"
+#include "progspace-and-thread.h"
#include "record-full.h"
-#include "inline-frame.h"
-#include "jit.h"
-#include "tracepoint.h"
-#include "continuations.h"
-#include "interps.h"
+#include "record.h"
+#include "regcache.h"
#include "skip.h"
-#include "probe.h"
-#include "objfiles.h"
-#include "completer.h"
-#include "target-descriptions.h"
+#include "solib.h"
+#include "solist.h"
+#include "symfile.h"
+#include "symtab.h"
#include "target-dcache.h"
+#include "target-descriptions.h"
+#include "target.h"
#include "terminal.h"
-#include "solist.h"
-#include "event-loop.h"
#include "thread-fsm.h"
-#include "common/enum-flags.h"
-#include "progspace-and-thread.h"
-#include "common/gdb_optional.h"
-#include "arch-utils.h"
-#include "common/scope-exit.h"
-#include "common/forward-scope-exit.h"
+#include "top.h"
+#include "tracepoint.h"
+#include "value.h"
/* Prototypes for local functions */
diff --git a/gdb/infrun.h b/gdb/infrun.h
index e53fd81e716..a798698f2fc 100644
--- a/gdb/infrun.h
+++ b/gdb/infrun.h
@@ -18,9 +18,11 @@
#ifndef INFRUN_H
#define INFRUN_H 1
-#include "symtab.h"
#include "common/byte-vector.h"
+/* Local includes. */
+#include "symtab.h"
+
struct target_waitstatus;
struct frame_info;
struct address_space;
diff --git a/gdb/inline-frame.c b/gdb/inline-frame.c
index 214cb824976..958d121c8c2 100644
--- a/gdb/inline-frame.c
+++ b/gdb/inline-frame.c
@@ -18,18 +18,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "breakpoint.h"
#include "inline-frame.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local subdirectory includes. */
+#include "common/vec.h"
+
+/* Local includes. */
#include "addrmap.h"
#include "block.h"
+#include "breakpoint.h"
#include "frame-unwind.h"
-#include "inferior.h"
+#include "frame.h"
#include "gdbthread.h"
+#include "inferior.h"
#include "regcache.h"
#include "symtab.h"
-#include "common/vec.h"
-#include "frame.h"
-#include <algorithm>
/* We need to save a few variables for every thread stopped at the
virtual call site of an inlined function. If there was always a
diff --git a/gdb/interps.c b/gdb/interps.c
index b62e33339a2..53bb00dfc0c 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -30,14 +30,16 @@
them take over the input in their resume proc. */
#include "defs.h"
-#include "gdbcmd.h"
-#include "ui-out.h"
-#include "event-loop.h"
-#include "event-top.h"
#include "interps.h"
+
+/* Local includes. */
#include "completer.h"
-#include "top.h" /* For command_loop. */
#include "continuations.h"
+#include "event-loop.h"
+#include "event-top.h"
+#include "gdbcmd.h"
+#include "top.h"
+#include "ui-out.h"
/* Each UI has its own independent set of interpreters. */
diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c
index c37f763a2f2..f1e4177b57b 100644
--- a/gdb/iq2000-tdep.c
+++ b/gdb/iq2000-tdep.c
@@ -21,17 +21,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "dwarf2-frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
-#include "dwarf2-frame.h"
+#include "frame.h"
+#include "gdbcore.h"
#include "gdbtypes.h"
-#include "value.h"
-#include "dis-asm.h"
-#include "arch-utils.h"
-#include "regcache.h"
#include "osabi.h"
-#include "gdbcore.h"
+#include "regcache.h"
+#include "value.h"
enum gdb_regnum
{
diff --git a/gdb/jit.c b/gdb/jit.c
index 1f87bf2538d..46a6255337c 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -18,29 +18,34 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-
#include "jit.h"
+
+/* Standard C includes. */
+#include <sys/stat.h>
+
+/* Local non-gdb includes. */
+#include "filenames.h"
#include "jit-reader.h"
+#include "readline/tilde.h"
+
+/* Local includes. */
#include "block.h"
#include "breakpoint.h"
#include "command.h"
+#include "completer.h"
#include "dictionary.h"
-#include "filenames.h"
#include "frame-unwind.h"
+#include "gdb-dlfcn.h"
+#include "gdb_bfd.h"
#include "gdbcmd.h"
#include "gdbcore.h"
#include "inferior.h"
-#include "observable.h"
#include "objfiles.h"
+#include "observable.h"
#include "regcache.h"
#include "symfile.h"
#include "symtab.h"
#include "target.h"
-#include "gdb-dlfcn.h"
-#include <sys/stat.h>
-#include "gdb_bfd.h"
-#include "readline/tilde.h"
-#include "completer.h"
static const char *jit_reader_dir = NULL;
diff --git a/gdb/language.c b/gdb/language.c
index ea294e670b6..04af039c9fe 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -29,22 +29,30 @@
whenever the working language changes. That would be a lot faster. */
#include "defs.h"
-#include <ctype.h>
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "value.h"
-#include "gdbcmd.h"
-#include "expression.h"
#include "language.h"
-#include "varobj.h"
-#include "target.h"
-#include "parser-defs.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "demangle.h"
-#include "symfile.h"
+
+/* Local includes. */
+#include "c-lang.h"
#include "cp-support.h"
+#include "expression.h"
#include "frame.h"
-#include "c-lang.h"
-#include <algorithm>
+#include "gdbcmd.h"
+#include "gdbtypes.h"
+#include "parser-defs.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
+#include "value.h"
+#include "varobj.h"
static int unk_lang_parser (struct parser_state *);
diff --git a/gdb/language.h b/gdb/language.h
index d56ec200208..4173f383f95 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -23,9 +23,11 @@
#if !defined (LANGUAGE_H)
#define LANGUAGE_H 1
-#include "symtab.h"
#include "common/function-view.h"
+
+/* Local includes. */
#include "expression.h"
+#include "symtab.h"
/* Forward decls for prototypes. */
struct value;
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 2f39d090848..bdff3e1b319 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -18,35 +18,45 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "frame.h"
-#include "command.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "source.h"
+#include "linespec.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "demangle.h"
-#include "value.h"
+#include "filenames.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+#include "common/def-vector.h"
+#include "common/function-view.h"
+#include "mi/mi-cmds.h"
+
+/* Local includes. */
+#include "ada-lang.h"
+#include "arch-utils.h"
+#include "block.h"
+#include "command.h"
#include "completer.h"
#include "cp-abi.h"
#include "cp-support.h"
-#include "parser-defs.h"
-#include "block.h"
-#include "objc-lang.h"
-#include "linespec.h"
-#include "language.h"
+#include "frame.h"
#include "interps.h"
-#include "mi/mi-cmds.h"
-#include "target.h"
-#include "arch-utils.h"
-#include <ctype.h>
-#include "cli/cli-utils.h"
-#include "filenames.h"
-#include "ada-lang.h"
-#include "stack.h"
+#include "language.h"
#include "location.h"
-#include "common/function-view.h"
-#include "common/def-vector.h"
-#include <algorithm>
+#include "objc-lang.h"
+#include "objfiles.h"
+#include "parser-defs.h"
+#include "source.h"
+#include "stack.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
+#include "value.h"
/* An enumeration of the various things a user might attempt to
complete for a linespec location. */
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index dde63d5572f..97508b6d252 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -18,25 +18,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "inferior.h"
-#include "infrun.h"
-#include "regcache.h"
-#include "gdbcmd.h"
-#include "infcall.h"
-#include "objfiles.h"
#include "linux-fork.h"
-#include "linux-nat.h"
-#include "gdbthread.h"
-#include "source.h"
-#include "nat/gdb_ptrace.h"
-#include "common/gdb_wait.h"
-#include <dirent.h>
+/* Standard C includes. */
#include <ctype.h>
+#include <dirent.h>
+/* Standard C++ includes. */
#include <list>
+/* Local subdirectory includes. */
+#include "common/gdb_wait.h"
+#include "nat/gdb_ptrace.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "gdbcmd.h"
+#include "gdbthread.h"
+#include "infcall.h"
+#include "inferior.h"
+#include "infrun.h"
+#include "linux-nat.h"
+#include "objfiles.h"
+#include "regcache.h"
+#include "source.h"
+
/* Fork list data structure: */
struct fork_info
{
diff --git a/gdb/linux-nat-trad.c b/gdb/linux-nat-trad.c
index 04507e80418..bb06444f515 100644
--- a/gdb/linux-nat-trad.c
+++ b/gdb/linux-nat-trad.c
@@ -20,7 +20,10 @@
#include "defs.h"
#include "linux-nat-trad.h"
+/* Local subdirectory includes. */
#include "nat/gdb_ptrace.h"
+
+/* Local includes. */
#include "inf-ptrace.h"
/* Fetch register REGNUM from the inferior. */
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 58da62a7964..4821a46bfc6 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -18,55 +18,63 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "infrun.h"
-#include "target.h"
-#include "nat/linux-nat.h"
-#include "nat/linux-waitpid.h"
-#include "common/gdb_wait.h"
-#include <unistd.h>
+#include "linux-nat.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <pwd.h>
+#include <sys/procfs.h>
+#include <sys/stat.h>
#include <sys/syscall.h>
+#include <sys/types.h>
+#include <sys/vfs.h>
+#include <unistd.h>
+
+/* Local non-gdb includes. */
+#include "elf-bfd.h"
+
+/* Local subdirectory includes. */
+#include "common/agent.h"
+#include "common/buffer.h"
+#include "common/fileio.h"
+#include "common/filestuff.h"
+#include "common/gdb_wait.h"
+#include "common/scope-exit.h"
#include "nat/gdb_ptrace.h"
-#include "linux-nat.h"
-#include "nat/linux-ptrace.h"
-#include "nat/linux-procfs.h"
+#include "nat/linux-namespaces.h"
+#include "nat/linux-nat.h"
+#include "nat/linux-osdata.h"
#include "nat/linux-personality.h"
-#include "linux-fork.h"
-#include "gdbthread.h"
-#include "gdbcmd.h"
-#include "regcache.h"
-#include "regset.h"
-#include "inf-child.h"
-#include "inf-ptrace.h"
+#include "nat/linux-procfs.h"
+#include "nat/linux-ptrace.h"
+#include "nat/linux-waitpid.h"
+
+/* Local includes. */
#include "auxv.h"
-#include <sys/procfs.h> /* for elf_gregset etc. */
-#include "elf-bfd.h" /* for elfcore_write_* */
-#include "gregset.h" /* for gregset */
-#include "gdbcore.h" /* for get_exec_file */
-#include <ctype.h> /* for isdigit */
-#include <sys/stat.h> /* for struct stat */
-#include <fcntl.h> /* for O_RDONLY */
-#include "inf-loop.h"
#include "event-loop.h"
#include "event-top.h"
-#include <pwd.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include "xml-support.h"
-#include <sys/vfs.h>
-#include "solib.h"
-#include "nat/linux-osdata.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "gregset.h"
+#include "inf-child.h"
+#include "inf-loop.h"
+#include "inf-ptrace.h"
+#include "inferior.h"
+#include "infrun.h"
+#include "linux-fork.h"
#include "linux-tdep.h"
+#include "objfiles.h"
+#include "regcache.h"
+#include "regset.h"
+#include "solib.h"
#include "symfile.h"
-#include "common/agent.h"
-#include "tracepoint.h"
-#include "common/buffer.h"
#include "target-descriptions.h"
-#include "common/filestuff.h"
-#include "objfiles.h"
-#include "nat/linux-namespaces.h"
-#include "common/fileio.h"
-#include "common/scope-exit.h"
+#include "target.h"
+#include "tracepoint.h"
+#include "xml-support.h"
#ifndef SPUFS_MAGIC
#define SPUFS_MAGIC 0x23c9b64e
diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
index 0c1695ad102..35c17e9f092 100644
--- a/gdb/linux-nat.h
+++ b/gdb/linux-nat.h
@@ -20,10 +20,14 @@
#ifndef LINUX_NAT_H
#define LINUX_NAT_H
+#include <signal.h>
+
+/* Local subdirectory includes. */
#include "nat/linux-nat.h"
+
+/* Local includes. */
#include "inf-ptrace.h"
#include "target.h"
-#include <signal.h>
/* A prototype generic GNU/Linux target. A concrete instance should
override it with local methods. */
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index 338e8b93c91..b13d536b514 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -18,12 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
+#include "linux-record.h"
+
+/* Local includes. */
#include "gdbtypes.h"
-#include "regcache.h"
-#include "record.h"
#include "record-full.h"
-#include "linux-record.h"
+#include "record.h"
+#include "regcache.h"
+#include "target.h"
/* These macros are the values of the first argument of system call
"sys_ptrace". The values of these macros were obtained from Linux
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index f6c4f7b2081..4a4cd1b24ce 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -18,29 +18,36 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbtypes.h"
#include "linux-tdep.h"
-#include "auxv.h"
-#include "target.h"
-#include "gdbthread.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "regset.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
+#include "elf-bfd.h"
#include "elf/common.h"
-#include "elf-bfd.h" /* for elfcore_write_* */
-#include "inferior.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-utils.h"
-#include "arch-utils.h"
-#include "gdb_obstack.h"
-#include "observable.h"
-#include "objfiles.h"
-#include "infcall.h"
-#include "gdbcmd.h"
-#include "gdb_regex.h"
#include "common/enum-flags.h"
#include "common/gdb_optional.h"
-#include <ctype.h>
+/* Local includes. */
+#include "arch-utils.h"
+#include "auxv.h"
+#include "gdb_obstack.h"
+#include "gdb_regex.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "gdbtypes.h"
+#include "infcall.h"
+#include "inferior.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "regcache.h"
+#include "regset.h"
+#include "target.h"
/* This enum represents the values that the user can choose when
informing the Linux kernel about which memory mappings will be
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index a735807f58c..811df26445a 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -18,35 +18,45 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Standard C includes. */
+#include <ctype.h>
#include <dlfcn.h>
-#include "gdb_proc_service.h"
-#include "nat/gdb_thread_db.h"
-#include "common/gdb_vecs.h"
+#include <signal.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "bfd.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+#include "common/gdb_vecs.h"
+#include "common/pathstuff.h"
+#include "nat/gdb_thread_db.h"
+#include "nat/linux-namespaces.h"
+#include "nat/linux-osdata.h"
+#include "nat/linux-procfs.h"
+#include "nat/linux-ptrace.h"
+
+/* Local includes. */
+#include "auto-load.h"
#include "command.h"
+#include "gdb_proc_service.h"
#include "gdbcmd.h"
+#include "gdbcore.h"
#include "gdbthread.h"
#include "inferior.h"
#include "infrun.h"
-#include "symfile.h"
+#include "linux-nat.h"
#include "objfiles.h"
-#include "target.h"
+#include "observable.h"
#include "regcache.h"
-#include "solib.h"
#include "solib-svr4.h"
-#include "gdbcore.h"
-#include "observable.h"
-#include "linux-nat.h"
-#include "nat/linux-procfs.h"
-#include "nat/linux-ptrace.h"
-#include "nat/linux-osdata.h"
-#include "auto-load.h"
-#include "cli/cli-utils.h"
-#include <signal.h>
-#include <ctype.h>
-#include "nat/linux-namespaces.h"
-#include <algorithm>
-#include "common/pathstuff.h"
+#include "solib.h"
+#include "symfile.h"
+#include "target.h"
#include "valprint.h"
/* GNU/Linux libthread_db support.
diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c
index f217dbae69c..3b7e40199f0 100644
--- a/gdb/lm32-tdep.c
+++ b/gdb/lm32-tdep.c
@@ -19,24 +19,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "inferior.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "../opcodes/lm32-desc.h"
#include "dis-asm.h"
-#include "symfile.h"
-#include "remote.h"
-#include "gdbcore.h"
-#include "gdb/sim-lm32.h"
#include "gdb/callback.h"
#include "gdb/remote-sim.h"
-#include "sim-regno.h"
+#include "gdb/sim-lm32.h"
+
+/* Local includes. */
#include "arch-utils.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcore.h"
+#include "inferior.h"
#include "regcache.h"
-#include "trad-frame.h"
#include "reggroups.h"
-#include "../opcodes/lm32-desc.h"
-#include <algorithm>
+#include "remote.h"
+#include "sim-regno.h"
+#include "symfile.h"
+#include "trad-frame.h"
/* Macros to extract fields from an instruction. */
#define LM32_OPCODE(insn) ((insn >> 26) & 0x3f)
diff --git a/gdb/location.c b/gdb/location.c
index 2b375872c77..7e47a2aa9b0 100644
--- a/gdb/location.c
+++ b/gdb/location.c
@@ -17,18 +17,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/gdb_assert.h"
#include "location.h"
-#include "symtab.h"
-#include "language.h"
-#include "linespec.h"
-#include "cli/cli-utils.h"
-#include "probe.h"
-#include "cp-support.h"
+/* Standard C includes. */
#include <ctype.h>
#include <string.h>
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+#include "common/gdb_assert.h"
+
+/* Local includes. */
+#include "cp-support.h"
+#include "language.h"
+#include "linespec.h"
+#include "probe.h"
+#include "symtab.h"
+
/* An event location used to set a stop event in the inferior.
This structure is an amalgam of the various ways
to specify where a stop event should be set. */
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
index 1a72aba73c9..efe2a13e539 100644
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -18,15 +18,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "parser-defs.h"
-#include "language.h"
-#include "varobj.h"
#include "m2-lang.h"
+
+/* Local includes. */
#include "c-lang.h"
+#include "expression.h"
+#include "gdbtypes.h"
+#include "language.h"
+#include "parser-defs.h"
+#include "symtab.h"
#include "valprint.h"
+#include "varobj.h"
static void m2_printchar (int, struct type *, struct ui_file *);
static void m2_emit_char (int, struct type *, struct ui_file *, int);
diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c
index dae07d1c531..ceb13ce8766 100644
--- a/gdb/m2-typeprint.c
+++ b/gdb/m2-typeprint.c
@@ -17,20 +17,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdb_obstack.h"
-#include "bfd.h" /* Binary File Description */
-#include "symtab.h"
-#include "gdbtypes.h"
+
+/* Local non-gdb includes. */
+#include "bfd.h"
+#include "demangle.h"
+
+/* Local includes. */
+#include "c-lang.h"
+#include "cp-abi.h"
#include "expression.h"
-#include "value.h"
+#include "gdb_obstack.h"
#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "language.h"
#include "m2-lang.h"
+#include "symtab.h"
#include "target.h"
-#include "language.h"
-#include "demangle.h"
-#include "c-lang.h"
#include "typeprint.h"
-#include "cp-abi.h"
+#include "value.h"
static void m2_print_bounds (struct type *type,
struct ui_file *stream, int show, int level,
diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c
index 74f89ee45fb..9d1b3befb58 100644
--- a/gdb/m2-valprint.c
+++ b/gdb/m2-valprint.c
@@ -18,16 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+
+/* Local includes. */
+#include "c-lang.h"
#include "expression.h"
-#include "value.h"
-#include "valprint.h"
+#include "gdbtypes.h"
#include "language.h"
-#include "typeprint.h"
-#include "c-lang.h"
#include "m2-lang.h"
+#include "symtab.h"
#include "target.h"
+#include "typeprint.h"
+#include "valprint.h"
+#include "value.h"
static int print_unpacked_pointer (struct type *type,
CORE_ADDR address, CORE_ADDR addr,
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index 709d33dbd66..32c58805d64 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -18,24 +18,28 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
#include "elf-bfd.h"
#include "elf/m32c.h"
#include "gdb/sim-m32c.h"
-#include "dis-asm.h"
-#include "gdbtypes.h"
-#include "regcache.h"
+
+/* Local includes. */
#include "arch-utils.h"
-#include "frame.h"
-#include "frame-unwind.h"
#include "dwarf2-frame.h"
#include "dwarf2expr.h"
-#include "symtab.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
-#include "value.h"
-#include "reggroups.h"
+#include "gdbtypes.h"
+#include "objfiles.h"
#include "prologue-value.h"
+#include "regcache.h"
+#include "reggroups.h"
+#include "symtab.h"
#include "target.h"
-#include "objfiles.h"
+#include "value.h"
/* The m32c tdep structure. */
diff --git a/gdb/m32r-linux-nat.c b/gdb/m32r-linux-nat.c
index 6323db3f19d..b0cca4b95dc 100644
--- a/gdb/m32r-linux-nat.c
+++ b/gdb/m32r-linux-nat.c
@@ -18,15 +18,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
+
+/* Standard C includes. */
+#include <sys/procfs.h>
+#include <sys/user.h>
+
+/* Local subdirectory includes. */
+#include "nat/gdb_ptrace.h"
+
+/* Local includes. */
#include "gdbcore.h"
-#include "regcache.h"
+#include "inf-ptrace.h"
+#include "inferior.h"
#include "linux-nat.h"
+#include "regcache.h"
#include "target.h"
-#include "nat/gdb_ptrace.h"
-#include <sys/user.h>
-#include <sys/procfs.h>
-#include "inf-ptrace.h"
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
diff --git a/gdb/m32r-linux-tdep.c b/gdb/m32r-linux-tdep.c
index 4c088ec0dee..85d5fbedc78 100644
--- a/gdb/m32r-linux-tdep.c
+++ b/gdb/m32r-linux-tdep.c
@@ -18,24 +18,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
+
+/* Local includes. */
+#include "frame-unwind.h"
#include "frame.h"
-#include "value.h"
-#include "regcache.h"
+#include "gdbcore.h"
+#include "glibc-tdep.h"
#include "inferior.h"
+#include "linux-tdep.h"
+#include "m32r-tdep.h"
#include "osabi.h"
+#include "regcache.h"
#include "reggroups.h"
#include "regset.h"
-
-#include "glibc-tdep.h"
#include "solib-svr4.h"
#include "symtab.h"
-
#include "trad-frame.h"
-#include "frame-unwind.h"
-
-#include "m32r-tdep.h"
-#include "linux-tdep.h"
+#include "value.h"
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index 18acdb6990c..025a3bb003d 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -18,25 +18,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
+#include "m32r-tdep.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "frame-base.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcmd.h"
#include "gdbcore.h"
-#include "value.h"
+#include "gdbtypes.h"
#include "inferior.h"
-#include "symfile.h"
+#include "language.h"
#include "objfiles.h"
#include "osabi.h"
-#include "language.h"
-#include "arch-utils.h"
#include "regcache.h"
+#include "symfile.h"
+#include "symtab.h"
#include "trad-frame.h"
-#include "dis-asm.h"
-#include "m32r-tdep.h"
-#include <algorithm>
+#include "value.h"
/* The size of the argument registers (r0 - r3) in bytes. */
#define M32R_ARG_REGISTER_SIZE 4
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 4e07f90bdc0..c228739c1d8 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -21,28 +21,31 @@
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "elf-bfd.h"
+#include "elf/m68hc11.h"
+#include "opcode/m68hc11.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "dwarf2-frame.h"
-#include "trad-frame.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcmd.h"
#include "gdbcore.h"
-#include "value.h"
+#include "gdbtypes.h"
#include "inferior.h"
-#include "dis-asm.h"
-#include "symfile.h"
#include "objfiles.h"
-#include "arch-utils.h"
#include "regcache.h"
#include "reggroups.h"
-
+#include "symfile.h"
+#include "symtab.h"
#include "target.h"
-#include "opcode/m68hc11.h"
-#include "elf/m68hc11.h"
-#include "elf-bfd.h"
+#include "trad-frame.h"
+#include "value.h"
/* Macros for setting and testing a bit in a minimal symbol.
For 68HC11/68HC12 we have two flags that tell which return
diff --git a/gdb/m68k-bsd-nat.c b/gdb/m68k-bsd-nat.c
index 5e4fc17efc8..e791bcd3926 100644
--- a/gdb/m68k-bsd-nat.c
+++ b/gdb/m68k-bsd-nat.c
@@ -18,16 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
-#include "inferior.h"
-#include "regcache.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
+/* Standard C includes. */
#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
-#include "m68k-tdep.h"
+/* Local includes. */
+#include "gdbcore.h"
#include "inf-ptrace.h"
+#include "inferior.h"
+#include "m68k-tdep.h"
+#include "regcache.h"
struct m68k_bsd_nat_target final : public inf_ptrace_target
{
diff --git a/gdb/m68k-bsd-tdep.c b/gdb/m68k-bsd-tdep.c
index b2ae6554971..5c6c659102d 100644
--- a/gdb/m68k-bsd-tdep.c
+++ b/gdb/m68k-bsd-tdep.c
@@ -18,17 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "frame.h"
+#include "gdbtypes.h"
+#include "m68k-tdep.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
+#include "solib-svr4.h"
#include "trad-frame.h"
#include "tramp-frame.h"
-#include "gdbtypes.h"
-
-#include "m68k-tdep.h"
-#include "solib-svr4.h"
/* Core file support. */
diff --git a/gdb/m68k-linux-nat.c b/gdb/m68k-linux-nat.c
index 91e68bae29c..9b970c83ab6 100644
--- a/gdb/m68k-linux-nat.c
+++ b/gdb/m68k-linux-nat.c
@@ -18,33 +18,36 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "language.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "target.h"
-#include "linux-nat.h"
-
-#include "m68k-tdep.h"
-#include <sys/dir.h>
+/* Standard C includes. */
+#include <fcntl.h>
#include <signal.h>
-#include "nat/gdb_ptrace.h"
-#include <sys/user.h>
+#include <sys/dir.h>
+#include <sys/file.h>
#include <sys/ioctl.h>
-#include <fcntl.h>
#include <sys/procfs.h>
-
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
#endif
-
-#include <sys/file.h>
#include <sys/stat.h>
+#include <sys/user.h>
+/* Local non-gdb includes. */
#include "floatformat.h"
+/* Local subdirectory includes. */
+#include "nat/gdb_ptrace.h"
+
+/* Local includes. */
+#include "frame.h"
+#include "gdbcore.h"
+#include "inferior.h"
+#include "language.h"
+#include "linux-nat.h"
+#include "m68k-tdep.h"
+#include "regcache.h"
+#include "target.h"
+
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
diff --git a/gdb/m68k-linux-tdep.c b/gdb/m68k-linux-tdep.c
index 56d1436f9df..e656489f2b8 100644
--- a/gdb/m68k-linux-tdep.c
+++ b/gdb/m68k-linux-tdep.c
@@ -18,24 +18,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
+
+/* Local non-gdb includes. */
+#include "elf/common.h"
+
+/* Local includes. */
+#include "auxv.h"
+#include "frame-unwind.h"
#include "frame.h"
-#include "target.h"
+#include "gdbcore.h"
#include "gdbtypes.h"
+#include "glibc-tdep.h"
+#include "linux-tdep.h"
+#include "m68k-tdep.h"
+#include "objfiles.h"
+#include "observable.h"
#include "osabi.h"
#include "regcache.h"
-#include "objfiles.h"
+#include "regset.h"
+#include "solib-svr4.h"
#include "symtab.h"
-#include "m68k-tdep.h"
+#include "target.h"
#include "trad-frame.h"
-#include "frame-unwind.h"
-#include "glibc-tdep.h"
-#include "solib-svr4.h"
-#include "auxv.h"
-#include "observable.h"
-#include "elf/common.h"
-#include "linux-tdep.h"
-#include "regset.h"
+
/* Offsets (in target ints) into jmp_buf. */
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index fb18cadfc7f..adc5d50c678 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -18,24 +18,28 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "m68k-tdep.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "floatformat.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "dwarf2-frame.h"
-#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
-#include "gdbtypes.h"
-#include "symtab.h"
+#include "frame.h"
#include "gdbcore.h"
-#include "value.h"
+#include "gdbtypes.h"
#include "inferior.h"
-#include "regcache.h"
-#include "arch-utils.h"
#include "osabi.h"
-#include "dis-asm.h"
+#include "regcache.h"
+#include "symtab.h"
#include "target-descriptions.h"
-#include "floatformat.h"
#include "target-float.h"
+#include "value.h"
-#include "m68k-tdep.h"
#define P_LINKL_FP 0x480e
diff --git a/gdb/machoread.c b/gdb/machoread.c
index 84e39fdf885..fb95060512c 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -19,21 +19,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+#include <string>
+
+/* Local non-gdb includes. */
+#include "aout/stab_gnu.h"
#include "bfd.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "gdbcmd.h"
-#include "gdbcore.h"
#include "mach-o.h"
-#include "aout/stab_gnu.h"
+
+/* Local subdirectory includes. */
#include "common/vec.h"
-#include "psympriv.h"
+
+/* Local includes. */
#include "complaints.h"
#include "gdb_bfd.h"
-#include <string>
-#include <algorithm>
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "objfiles.h"
+#include "psympriv.h"
+#include "symfile.h"
+#include "symtab.h"
/* If non-zero displays debugging message. */
static unsigned int mach_o_debug_level = 0;
diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c
index 0f81c3d5da4..dfc3521d27b 100644
--- a/gdb/macrocmd.c
+++ b/gdb/macrocmd.c
@@ -19,14 +19,18 @@
#include "defs.h"
-#include "macrotab.h"
-#include "macroexp.h"
-#include "macroscope.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-style.h"
#include "cli/cli-utils.h"
+
+/* Local includes. */
#include "command.h"
#include "gdbcmd.h"
#include "linespec.h"
+#include "macroexp.h"
+#include "macroscope.h"
+#include "macrotab.h"
/* The `macro' prefix command. */
diff --git a/gdb/macroexp.c b/gdb/macroexp.c
index 33a72a7271f..bd939c26d60 100644
--- a/gdb/macroexp.c
+++ b/gdb/macroexp.c
@@ -18,10 +18,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdb_obstack.h"
-#include "macrotab.h"
#include "macroexp.h"
+
+/* Local includes. */
#include "c-lang.h"
+#include "gdb_obstack.h"
+#include "macrotab.h"
diff --git a/gdb/macroscope.c b/gdb/macroscope.c
index f3845047767..ce46f22e3ed 100644
--- a/gdb/macroscope.c
+++ b/gdb/macroscope.c
@@ -18,14 +18,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-
#include "macroscope.h"
-#include "symtab.h"
-#include "source.h"
-#include "target.h"
+
+/* Local includes. */
+#include "complaints.h"
#include "frame.h"
#include "inferior.h"
-#include "complaints.h"
+#include "source.h"
+#include "symtab.h"
+#include "target.h"
/* A table of user-defined macros. Unlike the macro tables used for
symtabs, this one uses xmalloc for all its allocation, not an
diff --git a/gdb/macrotab.c b/gdb/macrotab.c
index 90f29439c09..63e449ac265 100644
--- a/gdb/macrotab.c
+++ b/gdb/macrotab.c
@@ -18,16 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdb_obstack.h"
-#include "splay-tree.h"
-#include "filenames.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "objfiles.h"
#include "macrotab.h"
+
+/* Local non-gdb includes. */
+#include "filenames.h"
+#include "splay-tree.h"
+
+/* Local includes. */
#include "bcache.h"
#include "complaints.h"
+#include "gdb_obstack.h"
#include "macroexp.h"
+#include "objfiles.h"
+#include "symfile.h"
+#include "symtab.h"
/* The macro table structure. */
diff --git a/gdb/main.c b/gdb/main.c
index 97ffc3fba48..b8ffc30a2b0 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -18,36 +18,43 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "top.h"
-#include "target.h"
-#include "inferior.h"
-#include "symfile.h"
-#include "gdbcore.h"
-#include "getopt.h"
+#include "main.h"
-#include <sys/types.h>
-#include <sys/stat.h>
+/* Standard C includes. */
#include <ctype.h>
-#include "event-loop.h"
-#include "ui-out.h"
+#include <signal.h>
+#include <sys/stat.h>
+#include <sys/types.h>
-#include "interps.h"
-#include "main.h"
-#include "source.h"
-#include "cli/cli-cmds.h"
-#include "objfiles.h"
-#include "auto-load.h"
-#include "maint.h"
+/* Standard C++ includes. */
+#include <vector>
+/* Local non-gdb includes. */
#include "filenames.h"
+#include "getopt.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-cmds.h"
+#include "cli/cli-style.h"
#include "common/filestuff.h"
-#include <signal.h>
+#include "common/pathstuff.h"
+#include "common/signals-state-save-restore.h"
+
+/* Local includes. */
+#include "auto-load.h"
+#include "event-loop.h"
#include "event-top.h"
+#include "gdbcore.h"
+#include "inferior.h"
#include "infrun.h"
-#include "common/signals-state-save-restore.h"
-#include <vector>
-#include "common/pathstuff.h"
-#include "cli/cli-style.h"
+#include "interps.h"
+#include "maint.h"
+#include "objfiles.h"
+#include "source.h"
+#include "symfile.h"
+#include "target.h"
+#include "top.h"
+#include "ui-out.h"
/* The selected interpreter. This will be used as a set command
variable, so it should always be malloc'ed - since
diff --git a/gdb/maint.c b/gdb/maint.c
index 8fc660eb939..a505b802cd3 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -21,28 +21,35 @@
#include "defs.h"
-#include "arch-utils.h"
+#include "maint.h"
+
+/* Standard C includes. */
#include <ctype.h>
#include <signal.h>
+
+/* Local non-gdb includes. */
+#include "demangle.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-decode.h"
+#include "cli/cli-setshow.h"
+#include "cli/cli-utils.h"
+#include "common/selftest.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "block.h"
#include "command.h"
+#include "expression.h"
#include "gdbcmd.h"
-#include "symtab.h"
-#include "block.h"
-#include "gdbtypes.h"
-#include "demangle.h"
#include "gdbcore.h"
-#include "expression.h" /* For language.h */
+#include "gdbtypes.h"
#include "language.h"
-#include "symfile.h"
#include "objfiles.h"
-#include "value.h"
+#include "symfile.h"
+#include "symtab.h"
#include "top.h"
-#include "maint.h"
-#include "common/selftest.h"
-
-#include "cli/cli-decode.h"
-#include "cli/cli-utils.h"
-#include "cli/cli-setshow.h"
+#include "value.h"
static void maintenance_do_deprecate (const char *, int);
diff --git a/gdb/maint.h b/gdb/maint.h
index 1d8d2cc5574..82ca18cf3a6 100644
--- a/gdb/maint.h
+++ b/gdb/maint.h
@@ -19,9 +19,11 @@
#ifndef MAINT_H
#define MAINT_H
-#include "common/run-time-clock.h"
#include <chrono>
+/* Local subdirectory includes. */
+#include "common/run-time-clock.h"
+
extern void set_per_command_time (int);
extern void set_per_command_space (int);
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 35e7890f357..c88d0c22b01 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -40,33 +40,35 @@
on any type of host. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "gdbcore.h"
-#include "filenames.h"
-#include "objfiles.h"
-#include "gdb_obstack.h"
-#include "buildsym-legacy.h"
-#include "stabsread.h"
-#include "complaints.h"
-#include "demangle.h"
-#include "gdb-demangle.h"
-#include "block.h"
-#include "dictionary.h"
#include "mdebugread.h"
-#include <sys/stat.h>
-#include "psympriv.h"
-#include "source.h"
-
-#include "bfd.h"
-#include "coff/ecoff.h" /* COFF-like aspects of ecoff files. */
+/* Standard C includes. */
+#include <sys/stat.h>
-#include "libaout.h" /* Private BFD a.out information. */
+/* Local non-gdb includes. */
#include "aout/aout64.h"
-#include "aout/stab_gnu.h" /* STABS information. */
+#include "aout/stab_gnu.h"
+#include "bfd.h"
+#include "coff/ecoff.h"
+#include "demangle.h"
+#include "filenames.h"
+#include "libaout.h"
+/* Local includes. */
+#include "block.h"
+#include "buildsym-legacy.h"
+#include "complaints.h"
+#include "dictionary.h"
#include "expression.h"
+#include "gdb-demangle.h"
+#include "gdb_obstack.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "objfiles.h"
+#include "psympriv.h"
+#include "source.h"
+#include "stabsread.h"
+#include "symtab.h"
/* Provide a way to test if we have both ECOFF and ELF symbol tables.
We use this define in order to know whether we should override a
diff --git a/gdb/mdebugread.h b/gdb/mdebugread.h
index 1b94ff8ee65..9fbfd2f9811 100644
--- a/gdb/mdebugread.h
+++ b/gdb/mdebugread.h
@@ -20,7 +20,7 @@
#ifndef MDEBUGREAD_H
#define MDEBUGREAD_H
-#include "coff/sym.h" /* Needed for PDR below. */
+#include "coff/sym.h"
#include "coff/symconst.h"
/* Specific information about a procedure. Architectures (ab)uses
diff --git a/gdb/mem-break.c b/gdb/mem-break.c
index abf8885b5ad..fc93a5447f8 100644
--- a/gdb/mem-break.c
+++ b/gdb/mem-break.c
@@ -20,10 +20,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
+
+/* Local includes. */
#include "breakpoint.h"
#include "inferior.h"
+#include "symtab.h"
#include "target.h"
+
/* Insert a breakpoint on targets that don't have any better
breakpoint support. We read the contents of the target location
and stash it, then overwrite it with a breakpoint instruction.
diff --git a/gdb/memattr.c b/gdb/memattr.c
index 858a41abfb4..2f6423fe6a4 100644
--- a/gdb/memattr.c
+++ b/gdb/memattr.c
@@ -18,17 +18,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "memattr.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+#include "common/vec.h"
+
+/* Local includes. */
+#include "breakpoint.h"
#include "command.h"
#include "gdbcmd.h"
-#include "memattr.h"
-#include "target.h"
+#include "language.h"
#include "target-dcache.h"
+#include "target.h"
#include "value.h"
-#include "language.h"
-#include "common/vec.h"
-#include "breakpoint.h"
-#include "cli/cli-utils.h"
-#include <algorithm>
static std::vector<mem_region> user_mem_region_list, target_mem_region_list;
static std::vector<mem_region> *mem_region_list = &target_mem_region_list;
diff --git a/gdb/memrange.c b/gdb/memrange.c
index 0f999815c54..7da7c3352ff 100644
--- a/gdb/memrange.c
+++ b/gdb/memrange.c
@@ -19,6 +19,8 @@
#include "defs.h"
#include "memrange.h"
+
+/* Standard C++ includes. */
#include <algorithm>
int
diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
index 3288291a461..f391bda6702 100644
--- a/gdb/mep-tdep.c
+++ b/gdb/mep-tdep.c
@@ -20,31 +20,35 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
+
+/* Local non-gdb includes. */
+#include "cgen/bitset.h"
+#include "dis-asm.h"
+#include "elf-bfd.h"
+#include "elf/mep.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "disasm.h"
#include "frame-base.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcmd.h"
#include "gdbcore.h"
-#include "value.h"
+#include "gdbtypes.h"
+#include "infcall.h"
#include "inferior.h"
-#include "dis-asm.h"
-#include "symfile.h"
-#include "objfiles.h"
#include "language.h"
-#include "arch-utils.h"
+#include "objfiles.h"
+#include "prologue-value.h"
#include "regcache.h"
+#include "reggroups.h"
#include "remote.h"
#include "sim-regno.h"
-#include "disasm.h"
+#include "symfile.h"
+#include "symtab.h"
#include "trad-frame.h"
-#include "reggroups.h"
-#include "elf-bfd.h"
-#include "elf/mep.h"
-#include "prologue-value.h"
-#include "cgen/bitset.h"
-#include "infcall.h"
+#include "value.h"
/* Get the user's customized MeP coprocessor register names from
libopcodes. */
diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c
index 4f25977311d..2e111aaca36 100644
--- a/gdb/mi/mi-cmd-break.c
+++ b/gdb/mi/mi-cmd-break.c
@@ -18,21 +18,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
+#include "mi/mi-cmd-break.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
#include "mi-cmds.h"
-#include "ui-out.h"
-#include "mi-out.h"
-#include "breakpoint.h"
#include "mi-getopt.h"
-#include "observable.h"
#include "mi-main.h"
-#include "mi-cmd-break.h"
+#include "mi-out.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "breakpoint.h"
+#include "gdb_obstack.h"
#include "language.h"
-#include "location.h"
#include "linespec.h"
-#include "gdb_obstack.h"
-#include <ctype.h>
+#include "location.h"
+#include "observable.h"
#include "tracepoint.h"
+#include "ui-out.h"
enum
{
diff --git a/gdb/mi/mi-cmd-catch.c b/gdb/mi/mi-cmd-catch.c
index 87929c48ca4..ab28a7433bb 100644
--- a/gdb/mi/mi-cmd-catch.c
+++ b/gdb/mi/mi-cmd-catch.c
@@ -19,12 +19,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "breakpoint.h"
-#include "ada-lang.h"
+
+/* Local non-gdb includes. */
+#include "mi-cmd-break.h"
#include "mi-cmds.h"
#include "mi-getopt.h"
-#include "mi-cmd-break.h"
+
+/* Local includes. */
+#include "ada-lang.h"
+#include "arch-utils.h"
+#include "breakpoint.h"
/* Handler for the -catch-assert command. */
diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c
index 7d38b8c5e0c..e7bddd862bc 100644
--- a/gdb/mi/mi-cmd-disas.c
+++ b/gdb/mi/mi-cmd-disas.c
@@ -18,13 +18,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "target.h"
-#include "value.h"
+
+/* Local non-gdb includes. */
#include "mi-cmds.h"
#include "mi-getopt.h"
-#include "ui-out.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "disasm.h"
+#include "target.h"
+#include "ui-out.h"
+#include "value.h"
/* The arguments to be passed on the command line and parsed here are
either:
diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index fcc49b9eb36..987e83c344e 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -19,19 +19,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "value.h"
-#include "mi-out.h"
+
+/* Standard C includes. */
+#include <sys/stat.h>
+
+/* Local non-gdb includes. */
#include "mi-cmds.h"
#include "mi-getopt.h"
-#include "symtab.h"
-#include "target.h"
+#include "mi-out.h"
+
+/* Local subdirectory includes. */
#include "common/environ.h"
+
+/* Local includes. */
#include "command.h"
-#include "ui-out.h"
-#include "top.h"
-#include <sys/stat.h>
+#include "inferior.h"
#include "source.h"
+#include "symtab.h"
+#include "target.h"
+#include "top.h"
+#include "ui-out.h"
+#include "value.h"
static const char path_var_name[] = "PATH";
static char *orig_path = NULL;
diff --git a/gdb/mi/mi-cmd-file.c b/gdb/mi/mi-cmd-file.c
index 714ab01b264..f466d21c4de 100644
--- a/gdb/mi/mi-cmd-file.c
+++ b/gdb/mi/mi-cmd-file.c
@@ -18,17 +18,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "mi-cmds.h"
#include "mi-getopt.h"
#include "mi-interp.h"
-#include "ui-out.h"
-#include "symtab.h"
-#include "source.h"
+
+/* Local includes. */
+#include "gdb_regex.h"
#include "objfiles.h"
#include "psymtab.h"
#include "solib.h"
#include "solist.h"
-#include "gdb_regex.h"
+#include "source.h"
+#include "symtab.h"
+#include "ui-out.h"
/* Return to the client the absolute path and line number of the
current file being executed. */
diff --git a/gdb/mi/mi-cmd-info.c b/gdb/mi/mi-cmd-info.c
index 39da6c489d4..a8f54e9f0f6 100644
--- a/gdb/mi/mi-cmd-info.c
+++ b/gdb/mi/mi-cmd-info.c
@@ -17,10 +17,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osdata.h"
+
+/* Local non-gdb includes. */
#include "mi-cmds.h"
+
+/* Local includes. */
#include "ada-lang.h"
#include "arch-utils.h"
+#include "osdata.h"
/* Implement the "-info-ada-exceptions" GDB/MI command. */
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index 119e887e6b3..85c9f376e07 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -18,24 +18,32 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
-#include "frame.h"
-#include "value.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
#include "mi-cmds.h"
-#include "ui-out.h"
-#include "symtab.h"
+#include "mi-getopt.h"
+#include "mi-parse.h"
+#include "safe-ctype.h"
+
+/* Local subdirectory includes. */
+#include "common/gdb_optional.h"
+
+/* Local includes. */
#include "block.h"
-#include "stack.h"
#include "dictionary.h"
+#include "extension.h"
+#include "frame.h"
#include "language.h"
-#include "valprint.h"
+#include "stack.h"
+#include "symtab.h"
+#include "target.h"
+#include "ui-out.h"
#include "utils.h"
-#include "mi-getopt.h"
-#include "extension.h"
-#include <ctype.h>
-#include "mi-parse.h"
-#include "common/gdb_optional.h"
-#include "safe-ctype.h"
+#include "valprint.h"
+#include "value.h"
enum what_to_list { locals, arguments, all };
diff --git a/gdb/mi/mi-cmd-target.c b/gdb/mi/mi-cmd-target.c
index 7f77b98506a..b4e0f79799d 100644
--- a/gdb/mi/mi-cmd-target.c
+++ b/gdb/mi/mi-cmd-target.c
@@ -17,8 +17,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "mi-cmds.h"
#include "mi-getopt.h"
+
+/* Local includes. */
#include "remote.h"
/* Get a file from the target. */
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 0c2e0c3b7bf..884c0b9f7a8 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -19,19 +19,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
#include "mi-cmds.h"
+#include "mi-getopt.h"
#include "mi-main.h"
-#include "ui-out.h"
#include "mi-out.h"
-#include "varobj.h"
-#include "language.h"
-#include "value.h"
-#include <ctype.h>
-#include "mi-getopt.h"
-#include "gdbthread.h"
#include "mi-parse.h"
+
+/* Local subdirectory includes. */
#include "common/gdb_optional.h"
+
+/* Local includes. */
+#include "gdbthread.h"
#include "inferior.h"
+#include "language.h"
+#include "ui-out.h"
+#include "value.h"
+#include "varobj.h"
extern unsigned int varobjdebug; /* defined in varobj.c. */
diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
index fe30ac2e822..b80fd8bce05 100644
--- a/gdb/mi/mi-cmds.c
+++ b/gdb/mi/mi-cmds.c
@@ -19,10 +19,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "top.h"
-#include "mi-cmds.h"
+#include "mi/mi-cmds.h"
+
+/* Local non-gdb includes. */
#include "mi-main.h"
+/* Local includes. */
+#include "top.h"
+
struct mi_cmd;
static struct mi_cmd **lookup_table (const char *command);
static void build_table (struct mi_cmd *commands);
diff --git a/gdb/mi/mi-common.c b/gdb/mi/mi-common.c
index c495b808dbb..343959434b7 100644
--- a/gdb/mi/mi-common.c
+++ b/gdb/mi/mi-common.c
@@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "mi-common.h"
+#include "mi/mi-common.h"
static const char * const async_reason_string_lookup[] =
{
diff --git a/gdb/mi/mi-console.c b/gdb/mi/mi-console.c
index 5d90bef11de..90dc198533f 100644
--- a/gdb/mi/mi-console.c
+++ b/gdb/mi/mi-console.c
@@ -25,7 +25,7 @@
"&". */
#include "defs.h"
-#include "mi-console.h"
+#include "mi/mi-console.h"
/* Create a console that wraps the given output stream RAW with the
string PREFIX and quoting it with QUOTE. */
diff --git a/gdb/mi/mi-getopt.c b/gdb/mi/mi-getopt.c
index 7adb722e526..e1284295676 100644
--- a/gdb/mi/mi-getopt.c
+++ b/gdb/mi/mi-getopt.c
@@ -18,7 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "mi-getopt.h"
+#include "mi/mi-getopt.h"
+
/* See comments about mi_getopt and mi_getopt_silent in mi-getopt.h.
When there is an unknown option, if ERROR_ON_UNKNOWN is true,
throw an error, otherwise return -1. */
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 3c5a0d8fb78..46ab367f11e 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -18,26 +18,33 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "interps.h"
-#include "event-top.h"
+#include "mi/mi-interp.h"
+
+/* Local non-gdb includes. */
+#include "mi-cmds.h"
+#include "mi-common.h"
+#include "mi-console.h"
+#include "mi-main.h"
+#include "mi-out.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-interp.h"
+
+/* Local includes. */
+#include "cli-out.h"
#include "event-loop.h"
+#include "event-top.h"
+#include "gdbthread.h"
#include "inferior.h"
#include "infrun.h"
-#include "ui-out.h"
-#include "top.h"
-#include "mi-main.h"
-#include "mi-cmds.h"
-#include "mi-out.h"
-#include "mi-console.h"
-#include "mi-common.h"
+#include "interps.h"
+#include "objfiles.h"
#include "observable.h"
-#include "gdbthread.h"
#include "solist.h"
-#include "objfiles.h"
-#include "tracepoint.h"
-#include "cli-out.h"
#include "thread-fsm.h"
-#include "cli/cli-interp.h"
+#include "top.h"
+#include "tracepoint.h"
+#include "ui-out.h"
/* These are the interpreter setup, etc. functions for the MI
interpreter. */
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 06559851745..d53ed399f96 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -20,49 +20,58 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "target.h"
-#include "inferior.h"
-#include "infrun.h"
-#include "top.h"
-#include "gdbthread.h"
+#include "mi/mi-main.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+#include <chrono>
+#include <map>
+#include <set>
+
+/* Local non-gdb includes. */
#include "mi-cmds.h"
-#include "mi-parse.h"
-#include "mi-getopt.h"
+#include "mi-common.h"
#include "mi-console.h"
-#include "ui-out.h"
+#include "mi-getopt.h"
#include "mi-out.h"
-#include "interps.h"
+#include "mi-parse.h"
+
+/* Local subdirectory includes. */
+#include "common/byte-vector.h"
+#include "common/gdb_optional.h"
+#include "common/gdb_splay_tree.h"
+#include "common/rsp-low.h"
+#include "common/run-time-clock.h"
+
+/* Local includes. */
+#include "ada-lang.h"
+#include "arch-utils.h"
+#include "ctf.h"
#include "event-loop.h"
#include "event-top.h"
-#include "gdbcore.h" /* For write_memory(). */
-#include "value.h"
-#include "regcache.h"
+#include "extension.h"
#include "frame.h"
-#include "mi-main.h"
-#include "mi-common.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "inferior.h"
+#include "infrun.h"
+#include "interps.h"
#include "language.h"
-#include "valprint.h"
-#include "osdata.h"
-#include "common/gdb_splay_tree.h"
-#include "tracepoint.h"
-#include "ctf.h"
-#include "ada-lang.h"
#include "linespec.h"
-#include "extension.h"
-#include "gdbcmd.h"
#include "observable.h"
-#include "common/gdb_optional.h"
-#include "common/byte-vector.h"
-
-#include <ctype.h>
-#include "common/run-time-clock.h"
-#include <chrono>
+#include "osdata.h"
#include "progspace-and-thread.h"
-#include "common/rsp-low.h"
-#include <algorithm>
-#include <set>
-#include <map>
+#include "regcache.h"
+#include "target.h"
+#include "top.h"
+#include "tracepoint.h"
+#include "ui-out.h"
+#include "valprint.h"
+#include "value.h"
enum
{
diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c
index e485beef69c..6759ab8bd65 100644
--- a/gdb/mi/mi-out.c
+++ b/gdb/mi/mi-out.c
@@ -20,10 +20,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "mi-out.h"
+#include "mi/mi-out.h"
+/* Standard C++ includes. */
#include <vector>
+/* Local includes. */
#include "interps.h"
#include "ui-out.h"
#include "utils.h"
diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c
index cc6a4419d08..04498015c36 100644
--- a/gdb/mi/mi-parse.c
+++ b/gdb/mi/mi-parse.c
@@ -20,12 +20,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "mi-cmds.h"
-#include "mi-parse.h"
-#include "charset.h"
+#include "mi/mi-parse.h"
+/* Standard C includes. */
#include <ctype.h>
+
+/* Local non-gdb includes. */
+#include "mi-cmds.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-utils.h"
+
+/* Local includes. */
+#include "charset.h"
#include "language.h"
static const char mi_no_values[] = "--no-values";
diff --git a/gdb/mi/mi-parse.h b/gdb/mi/mi-parse.h
index 2262ff56f96..cd8954f1300 100644
--- a/gdb/mi/mi-parse.h
+++ b/gdb/mi/mi-parse.h
@@ -20,9 +20,13 @@
#ifndef MI_MI_PARSE_H
#define MI_MI_PARSE_H
-#include "common/run-time-clock.h"
#include <chrono>
-#include "mi-cmds.h" /* For enum print_values. */
+
+/* Local non-gdb includes. */
+#include "mi-cmds.h"
+
+/* Local subdirectory includes. */
+#include "common/run-time-clock.h"
/* MI parser */
diff --git a/gdb/mi/mi-symbol-cmds.c b/gdb/mi/mi-symbol-cmds.c
index 78a5590a15d..a8bbad2bb73 100644
--- a/gdb/mi/mi-symbol-cmds.c
+++ b/gdb/mi/mi-symbol-cmds.c
@@ -17,9 +17,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
#include "mi-cmds.h"
-#include "symtab.h"
+
+/* Local includes. */
#include "objfiles.h"
+#include "symtab.h"
#include "ui-out.h"
/* Print the list of all pc addresses and lines of code for the
diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c
index 4e5f60cd4e5..baf62716505 100644
--- a/gdb/microblaze-linux-tdep.c
+++ b/gdb/microblaze-linux-tdep.c
@@ -18,24 +18,26 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
+#include "frame-unwind.h"
#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-#include "target.h"
-#include "gdbcore.h"
#include "gdbcmd.h"
-#include "symfile.h"
+#include "gdbcore.h"
+#include "inferior.h"
+#include "linux-tdep.h"
+#include "microblaze-tdep.h"
#include "objfiles.h"
-#include "regcache.h"
-#include "value.h"
#include "osabi.h"
+#include "regcache.h"
#include "regset.h"
#include "solib-svr4.h"
-#include "microblaze-tdep.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
#include "trad-frame.h"
-#include "frame-unwind.h"
#include "tramp-frame.h"
-#include "linux-tdep.h"
+#include "value.h"
static int
microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index 1248acbdc9e..3d9abad977e 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -18,29 +18,35 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
+#include "microblaze-tdep.h"
+
+/* Local non-gdb includes. */
+#include "../opcodes/microblaze-dis.h"
+#include "../opcodes/microblaze-opcm.h"
#include "dis-asm.h"
-#include "frame.h"
-#include "trad-frame.h"
-#include "symtab.h"
-#include "value.h"
-#include "gdbcmd.h"
+
+/* Local subdirectory includes. */
+#include "features/microblaze-with-stack-protect.c"
+#include "features/microblaze.c"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "breakpoint.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "target.h"
+#include "dwarf2-frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
-#include "dwarf2-frame.h"
+#include "frame.h"
+#include "gdbcmd.h"
+#include "inferior.h"
#include "osabi.h"
-#include "target-descriptions.h"
-#include "../opcodes/microblaze-opcm.h"
-#include "../opcodes/microblaze-dis.h"
-#include "microblaze-tdep.h"
+#include "regcache.h"
#include "remote.h"
+#include "symtab.h"
+#include "target-descriptions.h"
+#include "target.h"
+#include "trad-frame.h"
+#include "value.h"
-#include "features/microblaze-with-stack-protect.c"
-#include "features/microblaze.c"
/* Instruction macros used for analyzing the prologue. */
/* This set of instruction macros need to be changed whenever the
diff --git a/gdb/mingw-hdep.c b/gdb/mingw-hdep.c
index 8ed4b44ddce..91e041920a3 100644
--- a/gdb/mingw-hdep.c
+++ b/gdb/mingw-hdep.c
@@ -18,14 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "main.h"
-#include "serial.h"
-#include "event-loop.h"
-#include "gdb_select.h"
+/* Standard C includes. */
+#include <windows.h>
+
+/* Local non-gdb includes. */
#include "readline/readline.h"
-#include <windows.h>
+/* Local includes. */
+#include "event-loop.h"
+#include "gdb_select.h"
+#include "main.h"
+#include "serial.h"
/* Return an absolute file name of the running GDB, if possible, or
ARGV0 if not. The return value is in malloc'ed storage. */
diff --git a/gdb/minidebug.c b/gdb/minidebug.c
index 6c67b4e04b3..77438c45e4d 100644
--- a/gdb/minidebug.c
+++ b/gdb/minidebug.c
@@ -18,11 +18,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local includes. */
#include "gdb_bfd.h"
-#include "symfile.h"
-#include "objfiles.h"
#include "gdbcore.h"
-#include <algorithm>
+#include "objfiles.h"
+#include "symfile.h"
#ifdef HAVE_LIBLZMA
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 51b65f51421..3af1e2a74e5 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -37,22 +37,33 @@
#include "defs.h"
+#include "minsyms.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "symtab.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "filenames.h"
-#include "symfile.h"
-#include "objfiles.h"
#include "demangle.h"
-#include "value.h"
+#include "filenames.h"
+#include "safe-ctype.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+#include "common/symbol.h"
+
+/* Local includes. */
#include "cp-abi.h"
-#include "target.h"
#include "cp-support.h"
#include "language.h"
-#include "cli/cli-utils.h"
-#include "common/symbol.h"
-#include <algorithm>
-#include "safe-ctype.h"
+#include "objfiles.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
+#include "value.h"
/* See minsyms.h. */
diff --git a/gdb/mips-fbsd-nat.c b/gdb/mips-fbsd-nat.c
index 6ed20cedd53..82f29375f70 100644
--- a/gdb/mips-fbsd-nat.c
+++ b/gdb/mips-fbsd-nat.c
@@ -18,18 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "target.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
+/* Standard C includes. */
#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
+/* Local includes. */
#include "fbsd-nat.h"
-#include "mips-tdep.h"
-#include "mips-fbsd-tdep.h"
#include "inf-ptrace.h"
+#include "inferior.h"
+#include "mips-fbsd-tdep.h"
+#include "mips-tdep.h"
+#include "regcache.h"
+#include "target.h"
struct mips_fbsd_nat_target final : public fbsd_nat_target
{
diff --git a/gdb/mips-fbsd-tdep.c b/gdb/mips-fbsd-tdep.c
index 71cd4c5af2a..e8e4f60f5d2 100644
--- a/gdb/mips-fbsd-tdep.c
+++ b/gdb/mips-fbsd-tdep.c
@@ -18,16 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
-#include "regset.h"
-#include "trad-frame.h"
-#include "tramp-frame.h"
+#include "mips-fbsd-tdep.h"
+/* Local includes. */
#include "fbsd-tdep.h"
#include "mips-tdep.h"
-#include "mips-fbsd-tdep.h"
-
+#include "osabi.h"
+#include "regset.h"
#include "solib-svr4.h"
+#include "trad-frame.h"
+#include "tramp-frame.h"
/* Core file support. */
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index e68ed1e4da9..29c5bde108e 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -18,25 +18,28 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Standard C includes. */
+#include <asm/ptrace.h>
+#include <sgidefs.h>
+
+/* Local subdirectory includes. */
+#include "nat/gdb_ptrace.h"
+#include "nat/mips-linux-watch.h"
+
+/* Local includes. */
#include "command.h"
+#include "gdb_proc_service.h"
#include "gdbcmd.h"
+#include "gregset.h"
+#include "inf-ptrace.h"
#include "inferior.h"
-#include "mips-tdep.h"
-#include "target.h"
-#include "regcache.h"
#include "linux-nat-trad.h"
#include "mips-linux-tdep.h"
+#include "mips-tdep.h"
+#include "regcache.h"
#include "target-descriptions.h"
-
-#include "gdb_proc_service.h"
-#include "gregset.h"
-
-#include <sgidefs.h>
-#include "nat/gdb_ptrace.h"
-#include <asm/ptrace.h>
-#include "inf-ptrace.h"
-
-#include "nat/mips-linux-watch.h"
+#include "target.h"
#ifndef PTRACE_GET_THREAD_AREA
#define PTRACE_GET_THREAD_AREA 25
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 13c5e06675f..54f25b1d245 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -18,32 +18,35 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
-#include "target.h"
-#include "solib-svr4.h"
-#include "osabi.h"
-#include "mips-tdep.h"
+#include "mips-linux-tdep.h"
+
+/* Local subdirectory includes. */
+#include "common/gdb_signals.h"
+#include "features/mips-dsp-linux.c"
+#include "features/mips-linux.c"
+#include "features/mips64-dsp-linux.c"
+#include "features/mips64-linux.c"
+
+/* Local includes. */
#include "frame.h"
-#include "regcache.h"
-#include "trad-frame.h"
-#include "tramp-frame.h"
+#include "gdbcore.h"
#include "gdbtypes.h"
+#include "glibc-tdep.h"
+#include "linux-tdep.h"
+#include "mips-tdep.h"
#include "objfiles.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
+#include "solib-svr4.h"
#include "solib.h"
#include "solist.h"
#include "symtab.h"
#include "target-descriptions.h"
-#include "regset.h"
-#include "mips-linux-tdep.h"
-#include "glibc-tdep.h"
-#include "linux-tdep.h"
+#include "target.h"
+#include "trad-frame.h"
+#include "tramp-frame.h"
#include "xml-syscall.h"
-#include "common/gdb_signals.h"
-
-#include "features/mips-linux.c"
-#include "features/mips-dsp-linux.c"
-#include "features/mips64-linux.c"
-#include "features/mips64-dsp-linux.c"
static struct target_so_ops mips_svr4_so_ops;
diff --git a/gdb/mips-nbsd-nat.c b/gdb/mips-nbsd-nat.c
index e942f9dc6b5..fc3521c1c73 100644
--- a/gdb/mips-nbsd-nat.c
+++ b/gdb/mips-nbsd-nat.c
@@ -18,17 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "target.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
+/* Standard C includes. */
#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
-#include "mips-tdep.h"
-#include "mips-nbsd-tdep.h"
+/* Local includes. */
#include "inf-ptrace.h"
+#include "inferior.h"
+#include "mips-nbsd-tdep.h"
+#include "mips-tdep.h"
+#include "regcache.h"
+#include "target.h"
class mips_nbsd_nat_target final : public inf_ptrace_target
{
diff --git a/gdb/mips-nbsd-tdep.c b/gdb/mips-nbsd-tdep.c
index 95de2ab8401..219fc42043a 100644
--- a/gdb/mips-nbsd-tdep.c
+++ b/gdb/mips-nbsd-tdep.c
@@ -20,18 +20,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "mips-nbsd-tdep.h"
+
+/* Local includes. */
#include "gdbcore.h"
+#include "mips-tdep.h"
+#include "nbsd-tdep.h"
+#include "osabi.h"
#include "regcache.h"
#include "regset.h"
+#include "solib-svr4.h"
#include "target.h"
#include "value.h"
-#include "osabi.h"
-
-#include "nbsd-tdep.h"
-#include "mips-nbsd-tdep.h"
-#include "mips-tdep.h"
-
-#include "solib-svr4.h"
/* Shorthand for some register numbers used below. */
#define MIPS_PC_REGNUM MIPS_EMBED_PC_REGNUM
diff --git a/gdb/mips-sde-tdep.c b/gdb/mips-sde-tdep.c
index cf1ce378737..5ebd1ad273e 100644
--- a/gdb/mips-sde-tdep.c
+++ b/gdb/mips-sde-tdep.c
@@ -18,17 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
+
+/* Local non-gdb includes. */
#include "elf-bfd.h"
-#include "block.h"
-#include "symtab.h"
-#include "frame.h"
-#include "frame-unwind.h"
+/* Local includes. */
+#include "block.h"
#include "frame-base.h"
-#include "trad-frame.h"
-
+#include "frame-unwind.h"
+#include "frame.h"
#include "mips-tdep.h"
+#include "osabi.h"
+#include "symtab.h"
+#include "trad-frame.h"
/* Fill in the register cache *THIS_CACHE for THIS_FRAME for use
in the SDE frame unwinder. */
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index f3361388225..a10cfcc03c4 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -21,42 +21,48 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-#include "value.h"
-#include "gdbcmd.h"
-#include "language.h"
-#include "gdbcore.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "gdbtypes.h"
-#include "target.h"
-#include "arch-utils.h"
-#include "regcache.h"
-#include "osabi.h"
#include "mips-tdep.h"
-#include "block.h"
-#include "reggroups.h"
-#include "opcode/mips.h"
-#include "elf/mips.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
#include "elf-bfd.h"
+#include "elf/mips.h"
+#include "opcode/mips.h"
#include "symcat.h"
-#include "sim-regno.h"
-#include "dis-asm.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "ax.h"
+#include "block.h"
#include "disasm.h"
-#include "frame-unwind.h"
+#include "dwarf2-frame.h"
#include "frame-base.h"
-#include "trad-frame.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
#include "infcall.h"
+#include "inferior.h"
+#include "language.h"
+#include "objfiles.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "reggroups.h"
#include "remote.h"
+#include "sim-regno.h"
+#include "symfile.h"
+#include "symtab.h"
#include "target-descriptions.h"
-#include "dwarf2-frame.h"
+#include "target-float.h"
+#include "target.h"
+#include "trad-frame.h"
#include "user-regs.h"
#include "valprint.h"
-#include "ax.h"
-#include "target-float.h"
-#include <algorithm>
+#include "value.h"
static const struct objfile_data *mips_pdr_data;
diff --git a/gdb/mips64-obsd-nat.c b/gdb/mips64-obsd-nat.c
index 44d262b6a86..a8cffa6aae3 100644
--- a/gdb/mips64-obsd-nat.c
+++ b/gdb/mips64-obsd-nat.c
@@ -18,17 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "target.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
+/* Standard C includes. */
#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
-#include "mips-tdep.h"
+/* Local includes. */
#include "inf-ptrace.h"
+#include "inferior.h"
+#include "mips-tdep.h"
#include "obsd-nat.h"
+#include "regcache.h"
+#include "target.h"
/* Shorthand for some register numbers used below. */
#define MIPS_PC_REGNUM MIPS_EMBED_PC_REGNUM
diff --git a/gdb/mips64-obsd-tdep.c b/gdb/mips64-obsd-tdep.c
index 1603f3e5f91..028c0e12678 100644
--- a/gdb/mips64-obsd-tdep.c
+++ b/gdb/mips64-obsd-tdep.c
@@ -18,17 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "gdbtypes.h"
+#include "mips-tdep.h"
+#include "obsd-tdep.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
+#include "solib-svr4.h"
#include "trad-frame.h"
#include "tramp-frame.h"
-#include "obsd-tdep.h"
-#include "mips-tdep.h"
-#include "solib-svr4.h"
-
/* The MIPS64 Floating-Point Quad-Precision format is similar to
big-endian IA-64 Quad-Precision format. */
#define floatformats_mips64_quad floatformats_ia64_quad
diff --git a/gdb/mipsread.c b/gdb/mipsread.c
index e54dc5de45a..42c1b64abfb 100644
--- a/gdb/mipsread.c
+++ b/gdb/mipsread.c
@@ -24,22 +24,24 @@
mdebugread.c. */
#include "defs.h"
-#include "bfd.h"
-#include "symtab.h"
-#include "objfiles.h"
-#include "stabsread.h"
-#include "mdebugread.h"
-#include "coff/sym.h"
-#include "coff/internal.h"
+/* Local non-gdb includes. */
+#include "bfd.h"
#include "coff/ecoff.h"
-#include "libcoff.h" /* Private BFD COFF information. */
-#include "libecoff.h" /* Private BFD ECOFF information. */
+#include "coff/internal.h"
+#include "coff/sym.h"
#include "elf/common.h"
#include "elf/internal.h"
#include "elf/mips.h"
+#include "libcoff.h"
+#include "libecoff.h"
+/* Local includes. */
+#include "mdebugread.h"
+#include "objfiles.h"
#include "psymtab.h"
+#include "stabsread.h"
+#include "symtab.h"
static void
read_alphacoff_dynamic_symtab (minimal_symbol_reader &,
diff --git a/gdb/mn10300-linux-tdep.c b/gdb/mn10300-linux-tdep.c
index 706096c7529..87ea9acf861 100644
--- a/gdb/mn10300-linux-tdep.c
+++ b/gdb/mn10300-linux-tdep.c
@@ -18,18 +18,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "mn10300-tdep.h"
+
+/* Local non-gdb includes. */
#include "bfd.h"
#include "elf-bfd.h"
+
+/* Local includes. */
+#include "frame.h"
+#include "gdbcore.h"
+#include "linux-tdep.h"
+#include "mn10300-tdep.h"
#include "osabi.h"
+#include "regcache.h"
#include "regset.h"
#include "solib-svr4.h"
-#include "frame.h"
#include "trad-frame.h"
#include "tramp-frame.h"
-#include "linux-tdep.h"
/* Transliterated from <asm-mn10300/elf.h>... */
#define MN10300_ELF_NGREG 28
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 583827e447d..c58fc4ba2f9 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -18,23 +18,26 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
+#include "mn10300-tdep.h"
+
+/* Local non-gdb includes. */
#include "dis-asm.h"
-#include "gdbtypes.h"
-#include "regcache.h"
-#include "gdbcore.h" /* For write_memory_unsigned_integer. */
-#include "value.h"
-#include "frame.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "symtab.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "dwarf2-frame.h"
-#include "osabi.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
#include "infcall.h"
+#include "osabi.h"
#include "prologue-value.h"
+#include "regcache.h"
+#include "symtab.h"
#include "target.h"
-
-#include "mn10300-tdep.h"
+#include "value.h"
/* The am33-2 has 64 registers. */
diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c
index 3a1737fe26b..9720637cb37 100644
--- a/gdb/moxie-tdep.c
+++ b/gdb/moxie-tdep.c
@@ -18,28 +18,33 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
+#include "moxie-tdep.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "frame-base.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcmd.h"
#include "gdbcore.h"
-#include "value.h"
+#include "gdbtypes.h"
#include "inferior.h"
-#include "symfile.h"
+#include "language.h"
#include "objfiles.h"
#include "osabi.h"
-#include "language.h"
-#include "arch-utils.h"
+#include "record-full.h"
+#include "record.h"
#include "regcache.h"
+#include "symfile.h"
+#include "symtab.h"
#include "trad-frame.h"
-#include "dis-asm.h"
-#include "record.h"
-#include "record-full.h"
-
-#include "moxie-tdep.h"
-#include <algorithm>
+#include "value.h"
/* Use an invalid address value as 'not available' marker. */
enum { REG_UNAVAIL = (CORE_ADDR) -1 };
diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c
index b5c983d3726..3d3561c89da 100644
--- a/gdb/msp430-tdep.c
+++ b/gdb/msp430-tdep.c
@@ -21,23 +21,26 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "prologue-value.h"
-#include "target.h"
-#include "regcache.h"
+
+/* Local non-gdb includes. */
#include "dis-asm.h"
-#include "gdbtypes.h"
-#include "frame.h"
-#include "frame-unwind.h"
+#include "elf-bfd.h"
+#include "elf/msp430.h"
+#include "opcode/msp430-decode.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "dwarf2-frame.h"
#include "frame-base.h"
-#include "value.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
-#include "dwarf2-frame.h"
+#include "gdbtypes.h"
+#include "prologue-value.h"
+#include "regcache.h"
#include "reggroups.h"
-
-#include "elf/msp430.h"
-#include "opcode/msp430-decode.h"
-#include "elf-bfd.h"
+#include "target.h"
+#include "value.h"
/* Register Numbers. */
diff --git a/gdb/namespace.h b/gdb/namespace.h
index 2d395804961..d0d2987bd35 100644
--- a/gdb/namespace.h
+++ b/gdb/namespace.h
@@ -19,8 +19,10 @@
#ifndef NAMESPACE_H
#define NAMESPACE_H
-#include "common/vec.h"
#include "common/gdb_vecs.h"
+#include "common/vec.h"
+
+/* Local includes. */
#include "gdb_obstack.h"
/* This struct is designed to store data from using directives. It
diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c
index 1efec9a268c..c3115f468f0 100644
--- a/gdb/nat/aarch64-linux-hw-point.c
+++ b/gdb/nat/aarch64-linux-hw-point.c
@@ -17,15 +17,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "common/break-common.h"
-#include "common/common-regcache.h"
-#include "nat/linux-nat.h"
-#include "aarch64-linux-hw-point.h"
+#include "nat/aarch64-linux-hw-point.h"
-#include <sys/uio.h>
+/* Standard C includes. */
#include <asm/ptrace.h>
-#include <sys/ptrace.h>
#include <elf.h>
+#include <sys/ptrace.h>
+#include <sys/uio.h>
+
+/* Local subdirectory includes. */
+#include "common/break-common.h"
+#include "common/common-regcache.h"
+#include "nat/linux-nat.h"
/* Number of hardware breakpoints/watchpoints the target supports.
They are initialized with values obtained via the ptrace calls
diff --git a/gdb/nat/aarch64-linux-hw-point.h b/gdb/nat/aarch64-linux-hw-point.h
index 5d9c2a1c80b..c7e8adf179f 100644
--- a/gdb/nat/aarch64-linux-hw-point.h
+++ b/gdb/nat/aarch64-linux-hw-point.h
@@ -19,7 +19,7 @@
#ifndef NAT_AARCH64_LINUX_HW_POINT_H
#define NAT_AARCH64_LINUX_HW_POINT_H
-#include "common/break-common.h" /* For enum target_hw_bp_type. */
+#include "common/break-common.h"
/* Macro definitions, data structures, and code for the hardware
breakpoint and hardware watchpoint support follow. We use the
diff --git a/gdb/nat/aarch64-linux.c b/gdb/nat/aarch64-linux.c
index 9c4c3ada719..7295d50d339 100644
--- a/gdb/nat/aarch64-linux.c
+++ b/gdb/nat/aarch64-linux.c
@@ -17,16 +17,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "common/break-common.h"
-#include "nat/linux-nat.h"
-#include "nat/aarch64-linux-hw-point.h"
#include "nat/aarch64-linux.h"
-#include "elf/common.h"
-#include "nat/gdb_ptrace.h"
+/* Standard C includes. */
#include <asm/ptrace.h>
#include <sys/uio.h>
+/* Local non-gdb includes. */
+#include "elf/common.h"
+
+/* Local subdirectory includes. */
+#include "common/break-common.h"
+#include "nat/aarch64-linux-hw-point.h"
+#include "nat/gdb_ptrace.h"
+#include "nat/linux-nat.h"
+
/* Called when resuming a thread LWP.
The hardware debug registers are updated when there is any change. */
diff --git a/gdb/nat/aarch64-sve-linux-ptrace.c b/gdb/nat/aarch64-sve-linux-ptrace.c
index 30faab22bb1..1f1ea2340de 100644
--- a/gdb/nat/aarch64-sve-linux-ptrace.c
+++ b/gdb/nat/aarch64-sve-linux-ptrace.c
@@ -17,15 +17,21 @@
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 <sys/utsname.h>
-#include <sys/uio.h>
#include "common/common-defs.h"
-#include "elf/external.h"
+#include "nat/aarch64-sve-linux-ptrace.h"
+
+/* Standard C includes. */
+#include <sys/uio.h>
+#include <sys/utsname.h>
+
+/* Local non-gdb includes. */
#include "elf/common.h"
-#include "aarch64-sve-linux-ptrace.h"
+#include "elf/external.h"
+
+/* Local subdirectory includes. */
#include "arch/aarch64.h"
-#include "common/common-regcache.h"
#include "common/byte-vector.h"
+#include "common/common-regcache.h"
static bool vq_change_warned = false;
diff --git a/gdb/nat/aarch64-sve-linux-ptrace.h b/gdb/nat/aarch64-sve-linux-ptrace.h
index 167fc8ef3cf..022d26a4231 100644
--- a/gdb/nat/aarch64-sve-linux-ptrace.h
+++ b/gdb/nat/aarch64-sve-linux-ptrace.h
@@ -20,10 +20,10 @@
#ifndef NAT_AARCH64_SVE_LINUX_PTRACE_H
#define NAT_AARCH64_SVE_LINUX_PTRACE_H
+#include <asm/ptrace.h>
#include <signal.h>
-#include <sys/utsname.h>
#include <sys/ptrace.h>
-#include <asm/ptrace.h>
+#include <sys/utsname.h>
#ifndef SVE_SIG_ZREGS_SIZE
#include "aarch64-sve-linux-sigcontext.h"
diff --git a/gdb/nat/amd64-linux-siginfo.c b/gdb/nat/amd64-linux-siginfo.c
index dab52684ad0..d4cdd1c6360 100644
--- a/gdb/nat/amd64-linux-siginfo.c
+++ b/gdb/nat/amd64-linux-siginfo.c
@@ -17,9 +17,11 @@
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 <signal.h>
#include "common/common-defs.h"
-#include "amd64-linux-siginfo.h"
+#include "nat/amd64-linux-siginfo.h"
+
+/* Standard C includes. */
+#include <signal.h>
#define GDB_SI_SIZE 128
diff --git a/gdb/nat/amd64-linux-siginfo.h b/gdb/nat/amd64-linux-siginfo.h
index 50d7fdc884f..3402138d3b0 100644
--- a/gdb/nat/amd64-linux-siginfo.h
+++ b/gdb/nat/amd64-linux-siginfo.h
@@ -20,7 +20,7 @@
#ifndef NAT_AMD64_LINUX_SIGINFO_H
#define NAT_AMD64_LINUX_SIGINFO_H
-#include <signal.h> /* For siginfo_t. */
+#include <signal.h>
/* When GDB is built as a 64-bit application on Linux, the
PTRACE_GETSIGINFO data is always presented in 64-bit layout. Since
diff --git a/gdb/nat/fork-inferior.c b/gdb/nat/fork-inferior.c
index fe9360a5039..9f4d7baffc5 100644
--- a/gdb/nat/fork-inferior.c
+++ b/gdb/nat/fork-inferior.c
@@ -18,16 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "fork-inferior.h"
-#include "target/waitstatus.h"
-#include "common/filestuff.h"
-#include "target/target.h"
-#include "common/common-inferior.h"
+#include "nat/fork-inferior.h"
+
+/* Standard C++ includes. */
+#include <vector>
+
+/* Local subdirectory includes. */
#include "common/common-gdbthread.h"
+#include "common/common-inferior.h"
+#include "common/filestuff.h"
+#include "common/gdb_tilde_expand.h"
#include "common/pathstuff.h"
#include "common/signals-state-save-restore.h"
-#include "common/gdb_tilde_expand.h"
-#include <vector>
+#include "target/target.h"
+#include "target/waitstatus.h"
extern char **environ;
diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c
index ef291ec2310..07a4d1fde3e 100644
--- a/gdb/nat/linux-btrace.c
+++ b/gdb/nat/linux-btrace.c
@@ -20,18 +20,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "linux-btrace.h"
-#include "common/common-regcache.h"
-#include "common/gdb_wait.h"
+#include "nat/linux-btrace.h"
+
+/* Standard C includes. */
+#include <inttypes.h>
+#include <sys/syscall.h>
+
+/* Local non-gdb includes. */
#include "x86-cpuid.h"
+
+/* Local subdirectory includes. */
+#include "common/common-regcache.h"
#include "common/filestuff.h"
+#include "common/gdb_wait.h"
#include "common/scoped_fd.h"
#include "common/scoped_mmap.h"
-#include <inttypes.h>
-
-#include <sys/syscall.h>
-
#if HAVE_LINUX_PERF_EVENT_H && defined(SYS_perf_event_open)
#include <unistd.h>
#include <sys/mman.h>
diff --git a/gdb/nat/linux-namespaces.c b/gdb/nat/linux-namespaces.c
index c0f326b9a1e..7138bf6e454 100644
--- a/gdb/nat/linux-namespaces.c
+++ b/gdb/nat/linux-namespaces.c
@@ -19,15 +19,19 @@
#include "common/common-defs.h"
#include "nat/linux-namespaces.h"
-#include "common/filestuff.h"
+
+/* Standard C includes. */
#include <fcntl.h>
+#include <sched.h>
+#include <signal.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
+
+/* Local subdirectory includes. */
+#include "common/filestuff.h"
#include "common/gdb_wait.h"
-#include <signal.h>
-#include <sched.h>
#include "common/scope-exit.h"
/* See nat/linux-namespaces.h. */
diff --git a/gdb/nat/linux-osdata.c b/gdb/nat/linux-osdata.c
index 3599df7cbeb..2ec4366375b 100644
--- a/gdb/nat/linux-osdata.c
+++ b/gdb/nat/linux-osdata.c
@@ -18,26 +18,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "linux-osdata.h"
+#include "nat/linux-osdata.h"
-#include <sys/types.h>
-#include <sys/sysinfo.h>
+/* Standard C includes. */
+#include <arpa/inet.h>
#include <ctype.h>
-#include <utmp.h>
-#include <time.h>
-#include <unistd.h>
-#include <pwd.h>
+#include <dirent.h>
#include <grp.h>
#include <netdb.h>
#include <netinet/in.h>
-#include <arpa/inet.h>
+#include <pwd.h>
+#include <sys/stat.h>
+#include <sys/sysinfo.h>
+#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
+#include <utmp.h>
-#include "common/xml-utils.h"
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local subdirectory includes. */
#include "common/buffer.h"
-#include <dirent.h>
-#include <sys/stat.h>
#include "common/filestuff.h"
-#include <algorithm>
+#include "common/xml-utils.h"
#define NAMELEN(dirent) strlen ((dirent)->d_name)
diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c
index 929bc137dce..c3232a78035 100644
--- a/gdb/nat/linux-procfs.c
+++ b/gdb/nat/linux-procfs.c
@@ -17,11 +17,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "linux-procfs.h"
-#include "common/filestuff.h"
+#include "nat/linux-procfs.h"
+
+/* Standard C includes. */
#include <dirent.h>
#include <sys/stat.h>
+/* Local subdirectory includes. */
+#include "common/filestuff.h"
+
/* Return the TGID of LWPID from /proc/pid/status. Returns -1 if not
found. */
diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
index 40919f77d72..0b1ad5add0e 100644
--- a/gdb/nat/linux-ptrace.c
+++ b/gdb/nat/linux-ptrace.c
@@ -17,14 +17,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "linux-ptrace.h"
-#include "linux-procfs.h"
-#include "linux-waitpid.h"
-#include "common/buffer.h"
+#include "nat/linux-ptrace.h"
+
+/* Standard C includes. */
#ifdef HAVE_SYS_PROCFS_H
#include <sys/procfs.h>
#endif
+/* Local non-gdb includes. */
+#include "linux-procfs.h"
+#include "linux-waitpid.h"
+
+/* Local subdirectory includes. */
+#include "common/buffer.h"
+
/* Stores the ptrace options supported by the running kernel.
A value of -1 means we did not check for features yet. A value
of 0 means there are no supported features. */
diff --git a/gdb/nat/linux-waitpid.c b/gdb/nat/linux-waitpid.c
index e31c088f66d..517ea363e04 100644
--- a/gdb/nat/linux-waitpid.c
+++ b/gdb/nat/linux-waitpid.c
@@ -18,6 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
+#include "nat/linux-waitpid.h"
#ifdef GDBSERVER
/* FIXME: server.h is required for the definition of debug_threads
diff --git a/gdb/nat/mips-linux-watch.c b/gdb/nat/mips-linux-watch.c
index 8add09c00fc..5999d718352 100644
--- a/gdb/nat/mips-linux-watch.c
+++ b/gdb/nat/mips-linux-watch.c
@@ -16,8 +16,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
+#include "nat/mips-linux-watch.h"
+
+/* Local subdirectory includes. */
#include "nat/gdb_ptrace.h"
-#include "mips-linux-watch.h"
/* Assuming usable watch registers REGS, return the irw_mask of
register N. */
diff --git a/gdb/nat/mips-linux-watch.h b/gdb/nat/mips-linux-watch.h
index 35e8d9d461e..4dd038a4b71 100644
--- a/gdb/nat/mips-linux-watch.h
+++ b/gdb/nat/mips-linux-watch.h
@@ -19,6 +19,8 @@
#define NAT_MIPS_LINUX_WATCH_H
#include <asm/ptrace.h>
+
+/* Local subdirectory includes. */
#include "common/break-common.h"
#define MAX_DEBUG_REGISTER 8
diff --git a/gdb/nat/ppc-linux.c b/gdb/nat/ppc-linux.c
index 27942fa2a5d..2307248c7f0 100644
--- a/gdb/nat/ppc-linux.c
+++ b/gdb/nat/ppc-linux.c
@@ -16,14 +16,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "ppc-linux.h"
-#include "nat/gdb_ptrace.h"
-#include <elf.h>
+#include "nat/ppc-linux.h"
+/* Standard C includes. */
+#include <elf.h>
#ifdef HAVE_GETAUXVAL
#include <sys/auxv.h>
#endif
+/* Local subdirectory includes. */
+#include "nat/gdb_ptrace.h"
+
#ifdef __powerpc64__
/* Get the HWCAP from the process of GDB or GDBserver. If success,
diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
index f1561b3b357..32f197f0d3d 100644
--- a/gdb/nat/ppc-linux.h
+++ b/gdb/nat/ppc-linux.h
@@ -18,8 +18,8 @@
#ifndef NAT_PPC_LINUX_H
#define NAT_PPC_LINUX_H
-#include <asm/ptrace.h>
#include <asm/cputable.h>
+#include <asm/ptrace.h>
/* This sometimes isn't defined. */
#ifndef PT_ORIG_R3
diff --git a/gdb/nat/x86-dregs.c b/gdb/nat/x86-dregs.c
index fb35178965d..ce7f8847008 100644
--- a/gdb/nat/x86-dregs.c
+++ b/gdb/nat/x86-dregs.c
@@ -18,7 +18,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "x86-dregs.h"
+#include "nat/x86-dregs.h"
+
+/* Local subdirectory includes. */
#include "common/break-common.h"
/* Support for hardware watchpoints and breakpoints using the x86
diff --git a/gdb/nat/x86-linux-dregs.c b/gdb/nat/x86-linux-dregs.c
index 29b4ee16b60..a55940bba46 100644
--- a/gdb/nat/x86-linux-dregs.c
+++ b/gdb/nat/x86-linux-dregs.c
@@ -18,12 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "nat/gdb_ptrace.h"
+#include "nat/x86-linux-dregs.h"
+
+/* Standard C includes. */
#include <sys/user.h>
-#include "target/waitstatus.h"
-#include "nat/x86-linux.h"
+
+/* Local subdirectory includes. */
+#include "nat/gdb_ptrace.h"
#include "nat/x86-dregs.h"
-#include "nat/x86-linux-dregs.h"
+#include "nat/x86-linux.h"
+#include "target/waitstatus.h"
/* Return the offset of REGNUM in the u_debugreg field of struct
user. */
diff --git a/gdb/nat/x86-linux.c b/gdb/nat/x86-linux.c
index be00a3b560a..bfeaa4d5a29 100644
--- a/gdb/nat/x86-linux.c
+++ b/gdb/nat/x86-linux.c
@@ -18,7 +18,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "x86-linux.h"
+#include "nat/x86-linux.h"
+
+/* Local non-gdb includes. */
#include "x86-linux-dregs.h"
/* Per-thread arch-specific data we want to keep. */
diff --git a/gdb/nbsd-nat.c b/gdb/nbsd-nat.c
index f832a372511..6cd596206f6 100644
--- a/gdb/nbsd-nat.c
+++ b/gdb/nbsd-nat.c
@@ -18,7 +18,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-
#include "nbsd-nat.h"
/* Return the name of a file that can be opened to get the symbols for
diff --git a/gdb/nbsd-tdep.c b/gdb/nbsd-tdep.c
index a0d512b0f1e..80a0990d36d 100644
--- a/gdb/nbsd-tdep.c
+++ b/gdb/nbsd-tdep.c
@@ -20,9 +20,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "solib-svr4.h"
#include "nbsd-tdep.h"
+/* Local includes. */
+#include "solib-svr4.h"
+
/* FIXME: kettenis/20060115: We should really eliminate the next two
functions completely. */
diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c
index 801b2dadcae..cb809088a7b 100644
--- a/gdb/nds32-tdep.c
+++ b/gdb/nds32-tdep.c
@@ -19,31 +19,37 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
+#include "nds32-tdep.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "elf-bfd.h"
+#include "elf/nds32.h"
+#include "opcode/nds32.h"
+
+/* Local subdirectory includes. */
+#include "features/nds32.c"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "dwarf2-frame.h"
#include "frame-base.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
-#include "value.h"
-#include "reggroups.h"
+#include "gdbtypes.h"
#include "inferior.h"
#include "osabi.h"
-#include "arch-utils.h"
#include "regcache.h"
-#include "dis-asm.h"
-#include "user-regs.h"
-#include "elf-bfd.h"
-#include "dwarf2-frame.h"
+#include "reggroups.h"
#include "remote.h"
+#include "symtab.h"
#include "target-descriptions.h"
-
-#include "nds32-tdep.h"
-#include "elf/nds32.h"
-#include "opcode/nds32.h"
-#include <algorithm>
-
-#include "features/nds32.c"
+#include "user-regs.h"
+#include "value.h"
/* Simple macros for instruction analysis. */
#define CHOP_BITS(insn, n) (insn & ~__MASK (n))
diff --git a/gdb/nios2-linux-tdep.c b/gdb/nios2-linux-tdep.c
index 2d38e603c06..872aa84b8d6 100644
--- a/gdb/nios2-linux-tdep.c
+++ b/gdb/nios2-linux-tdep.c
@@ -18,17 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "frame.h"
+#include "glibc-tdep.h"
+#include "linux-tdep.h"
+#include "nios2-tdep.h"
#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
#include "solib-svr4.h"
+#include "symtab.h"
#include "trad-frame.h"
#include "tramp-frame.h"
-#include "symtab.h"
-#include "regset.h"
-#include "regcache.h"
-#include "linux-tdep.h"
-#include "glibc-tdep.h"
-#include "nios2-tdep.h"
/* Core file and register set support. */
diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c
index 08664541133..add60595709 100644
--- a/gdb/nios2-tdep.c
+++ b/gdb/nios2-tdep.c
@@ -20,26 +20,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "trad-frame.h"
+#include "nios2-tdep.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "dwarf2-frame.h"
-#include "symtab.h"
-#include "inferior.h"
-#include "gdbtypes.h"
-#include "gdbcore.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "infcall.h"
+#include "inferior.h"
#include "osabi.h"
-#include "target.h"
-#include "dis-asm.h"
#include "regcache.h"
-#include "value.h"
-#include "symfile.h"
-#include "arch-utils.h"
-#include "infcall.h"
#include "regset.h"
+#include "symfile.h"
+#include "symtab.h"
#include "target-descriptions.h"
+#include "target.h"
+#include "trad-frame.h"
+#include "value.h"
/* To get entry_point_address. */
#include "objfiles.h"
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index 9dd35a4c8aa..d1eeeed5e8a 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -22,28 +22,32 @@
#include "defs.h"
+/* Standard C includes. */
+#include <dirent.h>
#include <fcntl.h>
#include <spawn.h>
+#include <sys/auxv.h>
#include <sys/debug.h>
-#include <sys/procfs.h>
+#include <sys/netmgr.h>
#include <sys/neutrino.h>
+#include <sys/procfs.h>
#include <sys/syspage.h>
-#include <dirent.h>
-#include <sys/netmgr.h>
-#include <sys/auxv.h>
+/* Local subdirectory includes. */
+#include "common/filestuff.h"
+#include "common/scoped_fd.h"
+
+/* Local includes. */
+#include "command.h"
#include "gdbcore.h"
-#include "inferior.h"
-#include "target.h"
-#include "objfiles.h"
#include "gdbthread.h"
+#include "inf-child.h"
+#include "inferior.h"
#include "nto-tdep.h"
-#include "command.h"
+#include "objfiles.h"
#include "regcache.h"
#include "solib.h"
-#include "inf-child.h"
-#include "common/filestuff.h"
-#include "common/scoped_fd.h"
+#include "target.h"
#define NULL_PID 0
#define _DEBUG_FLAG_TRACE (_DEBUG_FLAG_TRACE_EXEC|_DEBUG_FLAG_TRACE_RD|\
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index 0caa55c2493..62505cdcecc 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -20,19 +20,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include <sys/stat.h>
#include "nto-tdep.h"
-#include "top.h"
-#include "inferior.h"
-#include "infrun.h"
-#include "gdbarch.h"
+
+/* Standard C includes. */
+#include <sys/stat.h>
+
+/* Local non-gdb includes. */
#include "bfd.h"
#include "elf-bfd.h"
-#include "solib-svr4.h"
+
+/* Local subdirectory includes. */
+#include "common/pathstuff.h"
+
+/* Local includes. */
+#include "gdbarch.h"
#include "gdbcore.h"
+#include "inferior.h"
+#include "infrun.h"
#include "objfiles.h"
+#include "solib-svr4.h"
#include "source.h"
-#include "common/pathstuff.h"
+#include "top.h"
#define QNX_NOTE_NAME "QNX"
#define QNX_INFO_SECT_NAME "QNX_info"
diff --git a/gdb/nto-tdep.h b/gdb/nto-tdep.h
index 5127ab3f9ed..788f689f1f3 100644
--- a/gdb/nto-tdep.h
+++ b/gdb/nto-tdep.h
@@ -22,10 +22,10 @@
#ifndef NTO_TDEP_H
#define NTO_TDEP_H
-#include "solist.h"
+#include "gdbthread.h"
#include "osabi.h"
#include "regset.h"
-#include "gdbthread.h"
+#include "solist.h"
/* Target operations defined for Neutrino targets (<target>-nto-tdep.c). */
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index ceef482ae35..7694ad90f1a 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -21,31 +21,38 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "parser-defs.h"
-#include "language.h"
-#include "varobj.h"
-#include "c-lang.h"
#include "objc-lang.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+
+/* Local includes. */
+#include "block.h"
+#include "c-lang.h"
#include "complaints.h"
-#include "value.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "target.h" /* for target_has_execution */
-#include "gdbcore.h"
-#include "gdbcmd.h"
+#include "expression.h"
#include "frame.h"
#include "gdb_regex.h"
-#include "regcache.h"
-#include "block.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
#include "infcall.h"
+#include "language.h"
+#include "objfiles.h"
+#include "parser-defs.h"
+#include "regcache.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
#include "valprint.h"
-#include "cli/cli-utils.h"
-
-#include <ctype.h>
-#include <algorithm>
+#include "value.h"
+#include "varobj.h"
struct objc_object {
CORE_ADDR isa;
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 1c95e068842..669a667b72d 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -23,38 +23,45 @@
destroying objfile structures. */
#include "defs.h"
-#include "bfd.h" /* Binary File Description */
-#include "symtab.h"
-#include "symfile.h"
#include "objfiles.h"
-#include "gdb-stabs.h"
-#include "target.h"
-#include "bcache.h"
-#include "expression.h"
-#include "parser-defs.h"
-#include <sys/types.h>
-#include <sys/stat.h>
+/* Standard C includes. */
#include <fcntl.h>
-#include "gdb_obstack.h"
+#include <sys/stat.h>
+#include <sys/types.h>
+
+/* Standard C++ includes. */
+#include <vector>
+
+/* Local non-gdb includes. */
+#include "bfd.h"
#include "hashtab.h"
-#include "breakpoint.h"
-#include "block.h"
-#include "dictionary.h"
-#include "source.h"
+/* Local subdirectory includes. */
+#include "common/pathstuff.h"
+
+/* Local includes. */
#include "addrmap.h"
#include "arch-utils.h"
+#include "bcache.h"
+#include "block.h"
+#include "breakpoint.h"
+#include "btrace.h"
+#include "complaints.h"
+#include "dictionary.h"
#include "exec.h"
+#include "expression.h"
+#include "gdb-stabs.h"
+#include "gdb_bfd.h"
+#include "gdb_obstack.h"
#include "observable.h"
-#include "complaints.h"
+#include "parser-defs.h"
#include "psymtab.h"
#include "solist.h"
-#include "gdb_bfd.h"
-#include "btrace.h"
-#include "common/pathstuff.h"
-
-#include <vector>
+#include "source.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
/* Keep a registry of per-objfile data-pointers required by other GDB
modules. */
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index 368d9f3abe2..f204493a008 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -20,19 +20,25 @@
#if !defined (OBJFILES_H)
#define OBJFILES_H
-#include "hashtab.h"
-#include "gdb_obstack.h" /* For obstack internals. */
-#include "objfile-flags.h"
-#include "symfile.h"
-#include "progspace.h"
-#include "registry.h"
-#include "gdb_bfd.h"
-#include "psymtab.h"
#include <bitset>
#include <vector>
+
+/* Local non-gdb includes. */
+#include "hashtab.h"
+
+/* Local subdirectory includes. */
#include "common/next-iterator.h"
#include "common/safe-iterator.h"
+
+/* Local includes. */
#include "bcache.h"
+#include "gdb_bfd.h"
+#include "gdb_obstack.h"
+#include "objfile-flags.h"
+#include "progspace.h"
+#include "psymtab.h"
+#include "registry.h"
+#include "symfile.h"
struct htab;
struct objfile_data;
diff --git a/gdb/obsd-nat.c b/gdb/obsd-nat.c
index 0a99bd021df..37e8b4cb364 100644
--- a/gdb/obsd-nat.c
+++ b/gdb/obsd-nat.c
@@ -18,16 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbthread.h"
-#include "inferior.h"
-#include "target.h"
+#include "obsd-nat.h"
-#include <sys/types.h>
+/* Standard C includes. */
#include <sys/ptrace.h>
+#include <sys/types.h>
+
+/* Local subdirectory includes. */
#include "common/gdb_wait.h"
+/* Local includes. */
+#include "gdbthread.h"
#include "inf-child.h"
-#include "obsd-nat.h"
+#include "inferior.h"
+#include "target.h"
/* OpenBSD 5.2 and later include rthreads which uses a thread model
that maps userland threads directly onto kernel threads in a 1:1
diff --git a/gdb/obsd-tdep.c b/gdb/obsd-tdep.c
index 3eb03c68c2b..01b16e428f3 100644
--- a/gdb/obsd-tdep.c
+++ b/gdb/obsd-tdep.c
@@ -18,11 +18,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "obsd-tdep.h"
+
+/* Local includes. */
#include "frame.h"
-#include "symtab.h"
#include "objfiles.h"
-
-#include "obsd-tdep.h"
+#include "symtab.h"
CORE_ADDR
obsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
diff --git a/gdb/observable.c b/gdb/observable.c
index c077b025932..d02eb71acd7 100644
--- a/gdb/observable.c
+++ b/gdb/observable.c
@@ -19,6 +19,8 @@
#include "defs.h"
#include "observable.h"
+
+/* Local includes. */
#include "command.h"
#include "gdbcmd.h"
diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c
index 03699b14251..433863782b5 100644
--- a/gdb/opencl-lang.c
+++ b/gdb/opencl-lang.c
@@ -19,13 +19,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbtypes.h"
-#include "symtab.h"
+
+/* Local includes. */
+#include "c-lang.h"
#include "expression.h"
-#include "parser-defs.h"
+#include "gdbtypes.h"
#include "language.h"
+#include "parser-defs.h"
+#include "symtab.h"
#include "varobj.h"
-#include "c-lang.h"
/* This macro generates enum values from a given type. */
diff --git a/gdb/or1k-linux-tdep.c b/gdb/or1k-linux-tdep.c
index f75a17b2c53..057537ba9a9 100644
--- a/gdb/or1k-linux-tdep.c
+++ b/gdb/or1k-linux-tdep.c
@@ -17,14 +17,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "or1k-tdep.h"
-#include "osabi.h"
+
+/* Local includes. */
#include "glibc-tdep.h"
#include "linux-tdep.h"
-#include "solib-svr4.h"
+#include "or1k-tdep.h"
+#include "osabi.h"
#include "regset.h"
-#include "tramp-frame.h"
+#include "solib-svr4.h"
#include "trad-frame.h"
+#include "tramp-frame.h"
/* Define the general register mapping. The kernel puts the PC at offset 0,
gdb puts it at offset 32. Register x0 is always 0 and can be ignored.
diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c
index 13e130c6fd3..08cf92ac653 100644
--- a/gdb/or1k-tdep.c
+++ b/gdb/or1k-tdep.c
@@ -17,31 +17,38 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "or1k-tdep.h"
+
+/* Standard C includes. */
+#include <inttypes.h>
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "safe-ctype.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "block.h"
+#include "dwarf2-frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-#include "value.h"
#include "gdbcmd.h"
-#include "language.h"
#include "gdbcore.h"
-#include "symfile.h"
-#include "objfiles.h"
#include "gdbtypes.h"
-#include "target.h"
+#include "inferior.h"
+#include "language.h"
+#include "objfiles.h"
#include "regcache.h"
-#include "safe-ctype.h"
-#include "block.h"
#include "reggroups.h"
-#include "arch-utils.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "dwarf2-frame.h"
-#include "trad-frame.h"
#include "regset.h"
#include "remote.h"
+#include "symfile.h"
+#include "symtab.h"
#include "target-descriptions.h"
-#include <inttypes.h>
-#include "dis-asm.h"
+#include "target.h"
+#include "trad-frame.h"
+#include "value.h"
/* OpenRISC specific includes. */
#include "or1k-tdep.h"
diff --git a/gdb/osabi.c b/gdb/osabi.c
index 5d4bbcdff84..6a57ef281cd 100644
--- a/gdb/osabi.c
+++ b/gdb/osabi.c
@@ -18,14 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-
#include "osabi.h"
-#include "arch-utils.h"
-#include "gdbcmd.h"
-#include "command.h"
+/* Local non-gdb includes. */
#include "elf-bfd.h"
+/* Local includes. */
+#include "arch-utils.h"
+#include "command.h"
+#include "gdbcmd.h"
+
#ifndef GDB_OSABI_DEFAULT
#define GDB_OSABI_DEFAULT GDB_OSABI_UNKNOWN
#endif
diff --git a/gdb/osdata.c b/gdb/osdata.c
index 0ee13d8ffa5..b79a9c006c4 100644
--- a/gdb/osdata.c
+++ b/gdb/osdata.c
@@ -18,12 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
-#include "common/vec.h"
-#include "xml-support.h"
#include "osdata.h"
-#include "ui-out.h"
+
+/* Local subdirectory includes. */
+#include "common/vec.h"
+
+/* Local includes. */
#include "gdbcmd.h"
+#include "target.h"
+#include "ui-out.h"
+#include "xml-support.h"
#if !defined(HAVE_LIBEXPAT)
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index b61273f356b..f6fb8b1d897 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -20,17 +20,21 @@
/* This file is derived from c-lang.c */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+#include "p-lang.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local includes. */
+#include "c-lang.h"
#include "expression.h"
-#include "parser-defs.h"
+#include "gdbtypes.h"
#include "language.h"
-#include "varobj.h"
-#include "p-lang.h"
+#include "parser-defs.h"
+#include "symtab.h"
#include "valprint.h"
#include "value.h"
-#include <ctype.h>
-#include "c-lang.h"
+#include "varobj.h"
/* All GPC versions until now (2007-09-27) also define a symbol called
'_p_initialize'. Check for the presence of this symbol first. */
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c
index d90b8ceb6ea..c5e472b8105 100644
--- a/gdb/p-typeprint.c
+++ b/gdb/p-typeprint.c
@@ -19,19 +19,25 @@
/* This file is derived from p-typeprint.c */
#include "defs.h"
-#include "gdb_obstack.h"
-#include "bfd.h" /* Binary File Description */
-#include "symtab.h"
-#include "gdbtypes.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
+#include "bfd.h"
+
+/* Local includes. */
#include "expression.h"
-#include "value.h"
+#include "gdb-demangle.h"
+#include "gdb_obstack.h"
#include "gdbcore.h"
-#include "target.h"
+#include "gdbtypes.h"
#include "language.h"
#include "p-lang.h"
+#include "symtab.h"
+#include "target.h"
#include "typeprint.h"
-#include "gdb-demangle.h"
-#include <ctype.h>
+#include "value.h"
static void pascal_type_print_varspec_suffix (struct type *, struct ui_file *,
int, int, int,
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index b11292a86bc..07d3ef96df9 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -20,25 +20,32 @@
/* This file is derived from c-valprint.c */
#include "defs.h"
-#include "gdb_obstack.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "value.h"
-#include "command.h"
-#include "gdbcmd.h"
-#include "gdbcore.h"
+
+/* Local non-gdb includes. */
#include "demangle.h"
-#include "valprint.h"
-#include "typeprint.h"
-#include "language.h"
-#include "target.h"
+
+/* Local subdirectory includes. */
+#include "common/byte-vector.h"
+
+/* Local includes. */
#include "annotate.h"
-#include "p-lang.h"
+#include "command.h"
#include "cp-abi.h"
#include "cp-support.h"
+#include "expression.h"
+#include "gdb_obstack.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "language.h"
#include "objfiles.h"
-#include "common/byte-vector.h"
+#include "p-lang.h"
+#include "symtab.h"
+#include "target.h"
+#include "typeprint.h"
+#include "valprint.h"
+#include "value.h"
+
/* Decorations for Pascal. */
diff --git a/gdb/parse.c b/gdb/parse.c
index 63cbc746aaa..b4aa0bf2c06 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -30,27 +30,35 @@
come first in the result. */
#include "defs.h"
+
+/* Standard C includes. */
#include <ctype.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local subdirectory includes. */
+#include "common/gdb_optional.h"
+
+/* Local includes. */
#include "arch-utils.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "frame.h"
-#include "expression.h"
-#include "value.h"
+#include "block.h"
#include "command.h"
-#include "language.h"
+#include "expression.h"
#include "f-lang.h"
-#include "parser-defs.h"
+#include "frame.h"
#include "gdbcmd.h"
-#include "symfile.h" /* for overlay functions */
+#include "gdbtypes.h"
#include "inferior.h"
-#include "target-float.h"
-#include "block.h"
-#include "source.h"
+#include "language.h"
#include "objfiles.h"
+#include "parser-defs.h"
+#include "source.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target-float.h"
#include "user-regs.h"
-#include <algorithm>
-#include "common/gdb_optional.h"
+#include "value.h"
/* Standard set of definitions for printing, dumping, prefixifying,
* and evaluating expressions. */
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index 26e0a836c11..5b6f4fc6263 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -24,6 +24,8 @@
#define PARSER_DEFS_H 1
#include "common/vec.h"
+
+/* Local includes. */
#include "expression.h"
struct block;
diff --git a/gdb/posix-hdep.c b/gdb/posix-hdep.c
index d0f467e1fcc..a57e49a8a27 100644
--- a/gdb/posix-hdep.c
+++ b/gdb/posix-hdep.c
@@ -18,8 +18,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "event-loop.h"
+/* Local includes. */
+#include "event-loop.h"
#include "gdb_select.h"
/* Wrapper for select. Nothing special needed on POSIX platforms. */
diff --git a/gdb/ppc-fbsd-nat.c b/gdb/ppc-fbsd-nat.c
index 648f628cf7e..4c60bc8e5aa 100644
--- a/gdb/ppc-fbsd-nat.c
+++ b/gdb/ppc-fbsd-nat.c
@@ -18,24 +18,26 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
-#include "inferior.h"
-#include "regcache.h"
-#include <sys/types.h>
-#include <sys/procfs.h>
-#include <sys/ptrace.h>
-#include <sys/signal.h>
+/* Standard C includes. */
#include <machine/frame.h>
#include <machine/pcb.h>
#include <machine/reg.h>
+#include <sys/procfs.h>
+#include <sys/ptrace.h>
+#include <sys/signal.h>
+#include <sys/types.h>
+/* Local includes. */
+#include "bsd-kvm.h"
#include "fbsd-nat.h"
+#include "gdbcore.h"
#include "gregset.h"
-#include "ppc-tdep.h"
-#include "ppc-fbsd-tdep.h"
#include "inf-ptrace.h"
-#include "bsd-kvm.h"
+#include "inferior.h"
+#include "ppc-fbsd-tdep.h"
+#include "ppc-tdep.h"
+#include "regcache.h"
struct ppc_fbsd_nat_target final : public fbsd_nat_target
{
diff --git a/gdb/ppc-fbsd-tdep.c b/gdb/ppc-fbsd-tdep.c
index 290bd1fd882..a6654b10a43 100644
--- a/gdb/ppc-fbsd-tdep.c
+++ b/gdb/ppc-fbsd-tdep.c
@@ -18,24 +18,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "ppc-fbsd-tdep.h"
+
+/* Local includes. */
#include "arch-utils.h"
+#include "fbsd-tdep.h"
+#include "frame-unwind.h"
#include "frame.h"
#include "gdbcore.h"
-#include "frame-unwind.h"
#include "gdbtypes.h"
#include "osabi.h"
+#include "ppc-tdep.h"
+#include "ppc64-tdep.h"
#include "regcache.h"
#include "regset.h"
+#include "solib-svr4.h"
#include "symtab.h"
#include "target.h"
#include "trad-frame.h"
-#include "ppc-tdep.h"
-#include "ppc64-tdep.h"
-#include "ppc-fbsd-tdep.h"
-#include "fbsd-tdep.h"
-#include "solib-svr4.h"
-
/* 32-bit regset descriptions. */
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 628e3d5e8f6..daf4fb53103 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -18,26 +18,32 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "observable.h"
-#include "frame.h"
-#include "inferior.h"
-#include "gdbthread.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "regset.h"
-#include "target.h"
-#include "linux-nat.h"
-#include <sys/types.h>
+
+/* Standard C includes. */
+#include <fcntl.h>
#include <signal.h>
-#include <sys/user.h>
#include <sys/ioctl.h>
+#include <sys/procfs.h>
+#include <sys/types.h>
#include <sys/uio.h>
+#include <sys/user.h>
+
+/* Local subdirectory includes. */
#include "common/gdb_wait.h"
-#include <fcntl.h>
-#include <sys/procfs.h>
#include "nat/gdb_ptrace.h"
#include "nat/linux-ptrace.h"
+
+/* Local includes. */
+#include "frame.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
#include "inf-ptrace.h"
+#include "inferior.h"
+#include "linux-nat.h"
+#include "observable.h"
+#include "regcache.h"
+#include "regset.h"
+#include "target.h"
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 19435602b5a..3715e762765 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -18,73 +18,79 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "regcache.h"
-#include "value.h"
-#include "osabi.h"
-#include "regset.h"
-#include "solib-svr4.h"
-#include "solib-spu.h"
-#include "solib.h"
-#include "solist.h"
-#include "ppc-tdep.h"
-#include "ppc64-tdep.h"
#include "ppc-linux-tdep.h"
-#include "arch/ppc-linux-common.h"
-#include "arch/ppc-linux-tdesc.h"
-#include "glibc-tdep.h"
-#include "trad-frame.h"
-#include "frame-unwind.h"
-#include "tramp-frame.h"
-#include "observable.h"
-#include "auxv.h"
-#include "elf/common.h"
-#include "elf/ppc64.h"
-#include "arch-utils.h"
-#include "spu-tdep.h"
-#include "xml-syscall.h"
-#include "linux-tdep.h"
-#include "linux-record.h"
-#include "record-full.h"
-#include "infrun.h"
-#include "stap-probe.h"
-#include "ax.h"
-#include "ax-gdb.h"
-#include "cli/cli-utils.h"
-#include "parser-defs.h"
-#include "user-regs.h"
+/* Standard C includes. */
#include <ctype.h>
+
+/* Local non-gdb includes. */
#include "elf-bfd.h"
+#include "elf/common.h"
+#include "elf/ppc64.h"
+/* Local subdirectory includes. */
+#include "arch/ppc-linux-common.h"
+#include "arch/ppc-linux-tdesc.h"
+#include "cli/cli-utils.h"
#include "features/rs6000/powerpc-32l.c"
-#include "features/rs6000/powerpc-altivec32l.c"
-#include "features/rs6000/powerpc-cell32l.c"
-#include "features/rs6000/powerpc-vsx32l.c"
-#include "features/rs6000/powerpc-isa205-32l.c"
-#include "features/rs6000/powerpc-isa205-altivec32l.c"
-#include "features/rs6000/powerpc-isa205-vsx32l.c"
-#include "features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.c"
-#include "features/rs6000/powerpc-isa207-vsx32l.c"
-#include "features/rs6000/powerpc-isa207-htm-vsx32l.c"
#include "features/rs6000/powerpc-64l.c"
+#include "features/rs6000/powerpc-altivec32l.c"
#include "features/rs6000/powerpc-altivec64l.c"
+#include "features/rs6000/powerpc-cell32l.c"
#include "features/rs6000/powerpc-cell64l.c"
-#include "features/rs6000/powerpc-vsx64l.c"
+#include "features/rs6000/powerpc-e500l.c"
+#include "features/rs6000/powerpc-isa205-32l.c"
#include "features/rs6000/powerpc-isa205-64l.c"
+#include "features/rs6000/powerpc-isa205-altivec32l.c"
#include "features/rs6000/powerpc-isa205-altivec64l.c"
-#include "features/rs6000/powerpc-isa205-vsx64l.c"
+#include "features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.c"
#include "features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.c"
-#include "features/rs6000/powerpc-isa207-vsx64l.c"
+#include "features/rs6000/powerpc-isa205-vsx32l.c"
+#include "features/rs6000/powerpc-isa205-vsx64l.c"
+#include "features/rs6000/powerpc-isa207-htm-vsx32l.c"
#include "features/rs6000/powerpc-isa207-htm-vsx64l.c"
-#include "features/rs6000/powerpc-e500l.c"
+#include "features/rs6000/powerpc-isa207-vsx32l.c"
+#include "features/rs6000/powerpc-isa207-vsx64l.c"
+#include "features/rs6000/powerpc-vsx32l.c"
+#include "features/rs6000/powerpc-vsx64l.c"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "auxv.h"
+#include "ax-gdb.h"
+#include "ax.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "glibc-tdep.h"
+#include "inferior.h"
+#include "infrun.h"
+#include "linux-record.h"
+#include "linux-tdep.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "osabi.h"
+#include "parser-defs.h"
+#include "ppc-tdep.h"
+#include "ppc64-tdep.h"
+#include "record-full.h"
+#include "regcache.h"
+#include "regset.h"
+#include "solib-spu.h"
+#include "solib-svr4.h"
+#include "solib.h"
+#include "solist.h"
+#include "spu-tdep.h"
+#include "stap-probe.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
+#include "trad-frame.h"
+#include "tramp-frame.h"
+#include "user-regs.h"
+#include "value.h"
+#include "xml-syscall.h"
/* Shared library operations for PowerPC-Linux. */
static struct target_so_ops powerpc_so_ops;
diff --git a/gdb/ppc-linux-tdep.h b/gdb/ppc-linux-tdep.h
index 369422de7f4..67792df0251 100644
--- a/gdb/ppc-linux-tdep.h
+++ b/gdb/ppc-linux-tdep.h
@@ -20,7 +20,7 @@
#ifndef PPC_LINUX_TDEP_H
#define PPC_LINUX_TDEP_H
-#include "ppc-tdep.h" /* For PPC_NUM_REGS. */
+#include "ppc-tdep.h"
struct regset;
diff --git a/gdb/ppc-nbsd-nat.c b/gdb/ppc-nbsd-nat.c
index 22e8915c8a4..c50f591094d 100644
--- a/gdb/ppc-nbsd-nat.c
+++ b/gdb/ppc-nbsd-nat.c
@@ -21,20 +21,21 @@
#include "defs.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
-#include <machine/reg.h>
+/* Standard C includes. */
#include <machine/frame.h>
#include <machine/pcb.h>
+#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
+/* Local includes. */
+#include "bsd-kvm.h"
#include "gdbcore.h"
+#include "inf-ptrace.h"
#include "inferior.h"
-#include "regcache.h"
-
-#include "ppc-tdep.h"
#include "ppc-nbsd-tdep.h"
-#include "bsd-kvm.h"
-#include "inf-ptrace.h"
+#include "ppc-tdep.h"
+#include "regcache.h"
struct ppc_nbsd_nat_target final : public inf_ptrace_target
{
diff --git a/gdb/ppc-nbsd-tdep.c b/gdb/ppc-nbsd-tdep.c
index 7959046bfcb..85b28867514 100644
--- a/gdb/ppc-nbsd-tdep.c
+++ b/gdb/ppc-nbsd-tdep.c
@@ -20,17 +20,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "ppc-nbsd-tdep.h"
+
+/* Local includes. */
#include "gdbtypes.h"
#include "osabi.h"
+#include "ppc-tdep.h"
#include "regcache.h"
#include "regset.h"
+#include "solib-svr4.h"
#include "trad-frame.h"
#include "tramp-frame.h"
-#include "ppc-tdep.h"
-#include "ppc-nbsd-tdep.h"
-#include "solib-svr4.h"
-
/* Register offsets from <machine/reg.h>. */
struct ppc_reg_offsets ppcnbsd_reg_offsets;
diff --git a/gdb/ppc-obsd-nat.c b/gdb/ppc-obsd-nat.c
index 4d3f8b2de7f..b0b8acb103b 100644
--- a/gdb/ppc-obsd-nat.c
+++ b/gdb/ppc-obsd-nat.c
@@ -18,22 +18,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
-#include "inferior.h"
-#include "regcache.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
-#include <sys/signal.h>
+/* Standard C includes. */
#include <machine/frame.h>
#include <machine/pcb.h>
#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/signal.h>
+#include <sys/types.h>
-#include "ppc-tdep.h"
-#include "ppc-obsd-tdep.h"
+/* Local includes. */
+#include "bsd-kvm.h"
+#include "gdbcore.h"
#include "inf-ptrace.h"
+#include "inferior.h"
#include "obsd-nat.h"
-#include "bsd-kvm.h"
+#include "ppc-obsd-tdep.h"
+#include "ppc-tdep.h"
+#include "regcache.h"
struct ppc_obsd_nat_target final : public obsd_nat_target
{
diff --git a/gdb/ppc-obsd-tdep.c b/gdb/ppc-obsd-tdep.c
index e404e8c9a59..8d8b715040d 100644
--- a/gdb/ppc-obsd-tdep.c
+++ b/gdb/ppc-obsd-tdep.c
@@ -18,20 +18,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "ppc-obsd-tdep.h"
+
+/* Local includes. */
#include "arch-utils.h"
-#include "frame.h"
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbtypes.h"
#include "osabi.h"
+#include "ppc-tdep.h"
#include "regcache.h"
#include "regset.h"
+#include "solib-svr4.h"
#include "symtab.h"
#include "trad-frame.h"
-#include "ppc-tdep.h"
-#include "ppc-obsd-tdep.h"
-#include "solib-svr4.h"
-
/* Register offsets from <machine/reg.h>. */
struct ppc_reg_offsets ppcobsd_reg_offsets;
struct ppc_reg_offsets ppcobsd_fpreg_offsets;
diff --git a/gdb/ppc-ravenscar-thread.c b/gdb/ppc-ravenscar-thread.c
index fca826bc846..5ee53bf9757 100644
--- a/gdb/ppc-ravenscar-thread.c
+++ b/gdb/ppc-ravenscar-thread.c
@@ -18,12 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "ppc-ravenscar-thread.h"
+
+/* Local includes. */
#include "gdbcore.h"
-#include "regcache.h"
-#include "ppc-tdep.h"
#include "inferior.h"
+#include "ppc-tdep.h"
#include "ravenscar-thread.h"
-#include "ppc-ravenscar-thread.h"
+#include "regcache.h"
#define NO_OFFSET -1
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index 22757c2472a..4b165b67762 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -19,17 +19,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "dwarf2.h"
+
+/* Local includes. */
#include "gdbcore.h"
+#include "infcall.h"
#include "inferior.h"
-#include "regcache.h"
-#include "value.h"
-#include "ppc-tdep.h"
-#include "target.h"
#include "objfiles.h"
-#include "infcall.h"
-#include "dwarf2.h"
+#include "ppc-tdep.h"
+#include "regcache.h"
#include "target-float.h"
-#include <algorithm>
+#include "target.h"
+#include "value.h"
/* Check whether FTPYE is a (pointer to) function type that should use
diff --git a/gdb/ppc64-tdep.c b/gdb/ppc64-tdep.c
index b29d04c1354..154a490c9f3 100644
--- a/gdb/ppc64-tdep.c
+++ b/gdb/ppc64-tdep.c
@@ -18,12 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "ppc64-tdep.h"
+
+/* Local non-gdb includes. */
+#include "elf-bfd.h"
+
+/* Local includes. */
#include "frame.h"
#include "gdbcore.h"
#include "infrun.h"
#include "ppc-tdep.h"
-#include "ppc64-tdep.h"
-#include "elf-bfd.h"
/* Macros for matching instructions. Note that, since all the
operands are masked off before they're or-ed into the instruction,
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index bdaaec81495..1129f51e8a7 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -18,38 +18,44 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "value.h"
-#include "language.h"
-#include "expression.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
-#include "target.h"
-#include "breakpoint.h"
+
+/* Local non-gdb includes. */
#include "demangle.h"
-#include "gdb-demangle.h"
-#include "valprint.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-script.h"
+#include "cli/cli-style.h"
+#include "cli/cli-utils.h"
+#include "common/byte-vector.h"
+#include "common/format.h"
+
+/* Local includes. */
#include "annotate.h"
-#include "symfile.h" /* for overlay functions */
-#include "objfiles.h" /* ditto */
-#include "completer.h" /* for completion functions */
-#include "ui-out.h"
+#include "arch-utils.h"
#include "block.h"
+#include "breakpoint.h"
+#include "charset.h"
+#include "completer.h"
#include "disasm.h"
-#include "target-float.h"
+#include "expression.h"
+#include "frame.h"
+#include "gdb-demangle.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "language.h"
+#include "objfiles.h"
#include "observable.h"
-#include "solist.h"
#include "parser-defs.h"
-#include "charset.h"
-#include "arch-utils.h"
-#include "cli/cli-utils.h"
-#include "cli/cli-script.h"
-#include "cli/cli-style.h"
-#include "common/format.h"
+#include "solist.h"
#include "source.h"
-#include "common/byte-vector.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target-float.h"
+#include "target.h"
+#include "ui-out.h"
+#include "valprint.h"
+#include "value.h"
/* Last specified output format. */
diff --git a/gdb/probe.c b/gdb/probe.c
index b9337a9d19f..a3cf79c4c94 100644
--- a/gdb/probe.c
+++ b/gdb/probe.c
@@ -19,24 +19,34 @@
#include "defs.h"
#include "probe.h"
-#include "command.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "filenames.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-cmds.h"
#include "cli/cli-utils.h"
-#include "objfiles.h"
-#include "symtab.h"
-#include "progspace.h"
-#include "filenames.h"
-#include "linespec.h"
-#include "gdb_regex.h"
-#include "frame.h"
+#include "common/gdb_optional.h"
+
+/* Local includes. */
#include "arch-utils.h"
-#include "value.h"
-#include "ax.h"
#include "ax-gdb.h"
+#include "ax.h"
+#include "command.h"
+#include "frame.h"
+#include "gdb_regex.h"
+#include "linespec.h"
#include "location.h"
-#include <ctype.h>
-#include <algorithm>
-#include "common/gdb_optional.h"
+#include "objfiles.h"
+#include "progspace.h"
+#include "symtab.h"
+#include "value.h"
/* Class that implements the static probe methods for "any" probe. */
diff --git a/gdb/proc-api.c b/gdb/proc-api.c
index c7ce82d23af..20c4272c2f0 100644
--- a/gdb/proc-api.c
+++ b/gdb/proc-api.c
@@ -25,8 +25,10 @@
*/
#include "defs.h"
-#include "gdbcmd.h"
+
+/* Local includes. */
#include "completer.h"
+#include "gdbcmd.h"
#define _STRUCTURED_PROC 1
diff --git a/gdb/proc-service.c b/gdb/proc-service.c
index b0741318adc..2ad9d9584d4 100644
--- a/gdb/proc-service.c
+++ b/gdb/proc-service.c
@@ -19,17 +19,18 @@
#include "defs.h"
+/* Standard C includes. */
+#include <sys/procfs.h>
+
+/* Local includes. */
+#include "gdb_proc_service.h"
#include "gdbcore.h"
-#include "inferior.h"
#include "gdbthread.h"
+#include "inferior.h"
+#include "objfiles.h"
+#include "regcache.h"
#include "symtab.h"
#include "target.h"
-#include "regcache.h"
-#include "objfiles.h"
-
-#include "gdb_proc_service.h"
-
-#include <sys/procfs.h>
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
diff --git a/gdb/process-stratum-target.c b/gdb/process-stratum-target.c
index 2c4b812f863..27e57b3df83 100644
--- a/gdb/process-stratum-target.c
+++ b/gdb/process-stratum-target.c
@@ -19,6 +19,8 @@
#include "defs.h"
#include "process-stratum-target.h"
+
+/* Local includes. */
#include "inferior.h"
process_stratum_target::~process_stratum_target ()
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 020336e5ba4..2b272a8f2f4 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -21,17 +21,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "infrun.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "elf-bfd.h" /* for elfcore_write_* */
+#include "procfs.h"
+
+/* Local non-gdb includes. */
+#include "elf-bfd.h"
+
+/* Local subdirectory includes. */
+#include "common/filestuff.h"
+#include "nat/fork-inferior.h"
+
+/* Local includes. */
#include "gdbcmd.h"
+#include "gdbcore.h"
#include "gdbthread.h"
-#include "regcache.h"
#include "inf-child.h"
-#include "nat/fork-inferior.h"
-#include "common/filestuff.h"
+#include "inferior.h"
+#include "infrun.h"
+#include "regcache.h"
+#include "target.h"
#define _STRUCTURED_PROC 1 /* Should be done by configure script. */
diff --git a/gdb/producer.c b/gdb/producer.c
index 362c5ef8b4f..77d0ff976b4 100644
--- a/gdb/producer.c
+++ b/gdb/producer.c
@@ -19,6 +19,8 @@
#include "defs.h"
#include "producer.h"
+
+/* Local subdirectory includes. */
#include "common/selftest.h"
/* See producer.h. */
diff --git a/gdb/progspace-and-thread.c b/gdb/progspace-and-thread.c
index 3c92b5c8e04..c86122c4a6b 100644
--- a/gdb/progspace-and-thread.c
+++ b/gdb/progspace-and-thread.c
@@ -17,6 +17,8 @@
#include "defs.h"
#include "progspace-and-thread.h"
+
+/* Local includes. */
#include "inferior.h"
/* See progspace-and-thread.h */
diff --git a/gdb/progspace-and-thread.h b/gdb/progspace-and-thread.h
index e3f7d87f6f8..efa82026eb7 100644
--- a/gdb/progspace-and-thread.h
+++ b/gdb/progspace-and-thread.h
@@ -19,8 +19,8 @@
#ifndef PROGSPACE_AND_THREAD_H
#define PROGSPACE_AND_THREAD_H
-#include "progspace.h"
#include "gdbthread.h"
+#include "progspace.h"
/* Save/restore the current program space, thread, inferior and frame.
Use this when you need to call
diff --git a/gdb/progspace.c b/gdb/progspace.c
index 1c749621ad6..cff0cbe4ef8 100644
--- a/gdb/progspace.c
+++ b/gdb/progspace.c
@@ -18,13 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcmd.h"
-#include "objfiles.h"
+#include "progspace.h"
+
+/* Local includes. */
#include "arch-utils.h"
+#include "gdbcmd.h"
#include "gdbcore.h"
-#include "solib.h"
#include "gdbthread.h"
#include "inferior.h"
+#include "objfiles.h"
+#include "solib.h"
/* The last program space number assigned. */
int last_program_space_num = 0;
diff --git a/gdb/progspace.h b/gdb/progspace.h
index 039f5551730..42ff987860e 100644
--- a/gdb/progspace.h
+++ b/gdb/progspace.h
@@ -21,13 +21,15 @@
#ifndef PROGSPACE_H
#define PROGSPACE_H
-#include "target.h"
-#include "common/vec.h"
-#include "gdb_bfd.h"
#include "common/gdb_vecs.h"
-#include "registry.h"
#include "common/next-iterator.h"
#include "common/safe-iterator.h"
+#include "common/vec.h"
+
+/* Local includes. */
+#include "gdb_bfd.h"
+#include "registry.h"
+#include "target.h"
struct target_ops;
struct bfd;
diff --git a/gdb/prologue-value.c b/gdb/prologue-value.c
index a305c3cf30e..95b4f4e6a57 100644
--- a/gdb/prologue-value.c
+++ b/gdb/prologue-value.c
@@ -18,6 +18,8 @@
#include "defs.h"
#include "prologue-value.h"
+
+/* Local includes. */
#include "regcache.h"
diff --git a/gdb/psympriv.h b/gdb/psympriv.h
index 7d2ce30f2e6..a97fcf408e4 100644
--- a/gdb/psympriv.h
+++ b/gdb/psympriv.h
@@ -20,8 +20,8 @@
#ifndef PSYMPRIV_H
#define PSYMPRIV_H
-#include "psymtab.h"
#include "objfiles.h"
+#include "psymtab.h"
/* A partial_symbol records the name, domain, and address class of
symbols whose types we have not parsed yet. For functions, it also
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 584a5e97fd8..0e5e1f754e6 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -18,24 +18,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "objfiles.h"
-#include "psympriv.h"
-#include "block.h"
+#include "psymtab.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+#include <set>
+
+/* Local non-gdb includes. */
#include "filenames.h"
-#include "source.h"
+#include "readline/readline.h"
+
+/* Local includes. */
#include "addrmap.h"
-#include "gdbtypes.h"
-#include "ui-out.h"
+#include "block.h"
#include "command.h"
-#include "readline/readline.h"
-#include "gdb_regex.h"
-#include "dictionary.h"
-#include "language.h"
#include "cp-support.h"
+#include "dictionary.h"
+#include "gdb_regex.h"
#include "gdbcmd.h"
-#include <algorithm>
-#include <set>
+#include "gdbtypes.h"
+#include "language.h"
+#include "objfiles.h"
+#include "psympriv.h"
+#include "source.h"
+#include "symtab.h"
+#include "ui-out.h"
static struct partial_symbol *match_partial_symbol (struct objfile *,
struct partial_symtab *,
diff --git a/gdb/psymtab.h b/gdb/psymtab.h
index c761fa72222..b064c94bbe0 100644
--- a/gdb/psymtab.h
+++ b/gdb/psymtab.h
@@ -20,10 +20,12 @@
#ifndef PSYMTAB_H
#define PSYMTAB_H
-#include "gdb_obstack.h"
-#include "symfile.h"
#include "common/next-iterator.h"
+
+/* Local includes. */
#include "bcache.h"
+#include "gdb_obstack.h"
+#include "symfile.h"
struct partial_symbol;
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";
diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index 6636a89554b..ba4523e23be 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -18,18 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "ravenscar-thread.h"
+
+/* Local includes. */
+#include "ada-lang.h"
+#include "command.h"
+#include "gdbcmd.h"
#include "gdbcore.h"
#include "gdbthread.h"
-#include "ada-lang.h"
-#include "target.h"
#include "inferior.h"
-#include "command.h"
-#include "ravenscar-thread.h"
+#include "objfiles.h"
#include "observable.h"
-#include "gdbcmd.h"
-#include "top.h"
#include "regcache.h"
-#include "objfiles.h"
+#include "target.h"
+#include "top.h"
/* This module provides support for "Ravenscar" tasks (Ada) when
debugging on bare-metal targets.
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 4c896944d7a..20e0b65db0d 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -20,27 +20,35 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "record.h"
#include "record-btrace.h"
-#include "gdbthread.h"
-#include "target.h"
-#include "gdbcmd.h"
-#include "disasm.h"
-#include "observable.h"
-#include "cli/cli-utils.h"
-#include "source.h"
-#include "ui-out.h"
-#include "symtab.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "filenames.h"
-#include "regcache.h"
-#include "frame-unwind.h"
#include "hashtab.h"
-#include "infrun.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+#include "common/vec.h"
+
+/* Local includes. */
+#include "disasm.h"
#include "event-loop.h"
+#include "frame-unwind.h"
+#include "gdbcmd.h"
+#include "gdbthread.h"
#include "inf-loop.h"
-#include "common/vec.h"
#include "inferior.h"
-#include <algorithm>
+#include "infrun.h"
+#include "observable.h"
+#include "record.h"
+#include "regcache.h"
+#include "source.h"
+#include "symtab.h"
+#include "target.h"
+#include "ui-out.h"
static const target_info record_btrace_target_info = {
"record-btrace",
diff --git a/gdb/record-full.c b/gdb/record-full.c
index ea0eddb536d..976cb95eb12 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -18,28 +18,35 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcmd.h"
-#include "regcache.h"
-#include "gdbthread.h"
-#include "inferior.h"
-#include "event-top.h"
-#include "completer.h"
-#include "arch-utils.h"
-#include "gdbcore.h"
-#include "exec.h"
-#include "record.h"
#include "record-full.h"
+
+/* Standard C includes. */
+#include <signal.h>
+
+/* Local non-gdb includes. */
#include "elf-bfd.h"
-#include "gcore.h"
+
+/* Local subdirectory includes. */
+#include "common/byte-vector.h"
+#include "common/gdb_unlinker.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "completer.h"
#include "event-loop.h"
-#include "inf-loop.h"
+#include "event-top.h"
+#include "exec.h"
+#include "gcore.h"
#include "gdb_bfd.h"
-#include "observable.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "inf-loop.h"
+#include "inferior.h"
#include "infrun.h"
-#include "common/gdb_unlinker.h"
-#include "common/byte-vector.h"
-
-#include <signal.h>
+#include "observable.h"
+#include "record.h"
+#include "regcache.h"
/* This module implements "target record-full", also known as "process
record and replay". This target sits on top of a "normal" target
diff --git a/gdb/record.c b/gdb/record.c
index 9c703646a7c..3599e7f05f7 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -18,17 +18,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcmd.h"
-#include "completer.h"
#include "record.h"
-#include "observable.h"
-#include "inferior.h"
-#include "common/common-utils.h"
-#include "cli/cli-utils.h"
-#include "disasm.h"
+/* Standard C includes. */
#include <ctype.h>
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+#include "common/common-utils.h"
+
+/* Local includes. */
+#include "completer.h"
+#include "disasm.h"
+#include "gdbcmd.h"
+#include "inferior.h"
+#include "observable.h"
+
/* This is the debug switch for process record. */
unsigned int record_debug = 0;
diff --git a/gdb/record.h b/gdb/record.h
index 03f96e8ab78..17bb03e40cb 100644
--- a/gdb/record.h
+++ b/gdb/record.h
@@ -20,8 +20,8 @@
#ifndef RECORD_H
#define RECORD_H
-#include "target/waitstatus.h" /* For enum target_stop_reason. */
#include "common/enum-flags.h"
+#include "target/waitstatus.h"
struct cmd_list_element;
struct inferior;
diff --git a/gdb/regcache-dump.c b/gdb/regcache-dump.c
index 1bcf9c3d17a..05baa1609c2 100644
--- a/gdb/regcache-dump.c
+++ b/gdb/regcache-dump.c
@@ -16,13 +16,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
+#include "common/def-vector.h"
+
+/* Local includes. */
#include "gdbcmd.h"
#include "regcache.h"
-#include "common/def-vector.h"
-#include "valprint.h"
-#include "remote.h"
#include "reggroups.h"
+#include "remote.h"
#include "target.h"
+#include "valprint.h"
/* Dump registers from regcache, used for dumping raw registers and
cooked registers. */
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 6e3eee96631..d7ec4136763 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -18,17 +18,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "gdbthread.h"
-#include "target.h"
-#include "test-target.h"
+#include "regcache.h"
+
+/* Standard C++ includes. */
+#include <forward_list>
+
+/* Local includes. */
#include "gdbarch.h"
#include "gdbcmd.h"
-#include "regcache.h"
-#include "reggroups.h"
+#include "gdbthread.h"
+#include "inferior.h"
#include "observable.h"
+#include "reggroups.h"
#include "regset.h"
-#include <forward_list>
+#include "target.h"
+#include "test-target.h"
/*
* DATA STRUCTURE
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 2b703ea4a4b..a3826810d3a 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -20,9 +20,11 @@
#ifndef REGCACHE_H
#define REGCACHE_H
-#include "common/common-regcache.h"
#include <forward_list>
+/* Local subdirectory includes. */
+#include "common/common-regcache.h"
+
struct regcache;
struct regset;
struct gdbarch;
diff --git a/gdb/reggroups.c b/gdb/reggroups.c
index 5608bcc3568..adad1ee50a5 100644
--- a/gdb/reggroups.c
+++ b/gdb/reggroups.c
@@ -20,13 +20,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
#include "reggroups.h"
-#include "gdbtypes.h"
-#include "regcache.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "command.h"
-#include "gdbcmd.h" /* For maintenanceprintlist. */
#include "gdb_obstack.h"
+#include "gdbcmd.h"
+#include "gdbtypes.h"
+#include "regcache.h"
/* Individual register groups. */
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c
index 91caa2b0726..73c9ee722b5 100644
--- a/gdb/remote-fileio.c
+++ b/gdb/remote-fileio.c
@@ -20,18 +20,26 @@
/* See the GDB User Guide for details of the GDB remote protocol. */
#include "defs.h"
-#include "gdbcmd.h"
-#include "remote.h"
-#include "common/gdb_wait.h"
-#include <sys/stat.h>
#include "remote-fileio.h"
-#include "event-loop.h"
-#include "target.h"
-#include "filenames.h"
-#include "common/filestuff.h"
+/* Standard C includes. */
#include <fcntl.h>
+#include <sys/stat.h>
+
+/* Local non-gdb includes. */
+#include "filenames.h"
+
+/* Local subdirectory includes. */
+#include "common/filestuff.h"
#include "common/gdb_sys_time.h"
+#include "common/gdb_wait.h"
+
+/* Local includes. */
+#include "event-loop.h"
+#include "gdbcmd.h"
+#include "remote.h"
+#include "target.h"
+
#ifdef __CYGWIN__
#include <sys/cygwin.h> /* For cygwin_conv_path. */
#endif
diff --git a/gdb/remote-notif.c b/gdb/remote-notif.c
index eece9470061..417a2012008 100644
--- a/gdb/remote-notif.c
+++ b/gdb/remote-notif.c
@@ -32,14 +32,16 @@
they are processed in remote_resume. */
#include "defs.h"
-#include "remote.h"
#include "remote-notif.h"
-#include "observable.h"
+
+/* Local includes. */
#include "event-loop.h"
-#include "target.h"
+#include "gdbcmd.h"
#include "inferior.h"
#include "infrun.h"
-#include "gdbcmd.h"
+#include "observable.h"
+#include "remote.h"
+#include "target.h"
int notif_debug = 0;
diff --git a/gdb/remote-notif.h b/gdb/remote-notif.h
index 87b52a18f9e..de3e39ea5ca 100644
--- a/gdb/remote-notif.h
+++ b/gdb/remote-notif.h
@@ -21,6 +21,8 @@
#define REMOTE_NOTIF_H
#include <memory>
+
+/* Local subdirectory includes. */
#include "common/queue.h"
/* An event of a type of async remote notification. */
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 8a6cb6b18e3..e633494c47a 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -21,27 +21,35 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdb_bfd.h"
-#include "inferior.h"
-#include "infrun.h"
-#include "value.h"
+
+/* Standard C includes. */
#include <ctype.h>
#include <fcntl.h>
-#include <signal.h>
#include <setjmp.h>
-#include "terminal.h"
-#include "target.h"
-#include "process-stratum-target.h"
-#include "gdbcore.h"
+#include <signal.h>
+
+/* Local non-gdb includes. */
#include "gdb/callback.h"
#include "gdb/remote-sim.h"
+#include "readline/readline.h"
+
+/* Local subdirectory includes. */
+#include "common/byte-vector.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "command.h"
+#include "gdb_bfd.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "inferior.h"
+#include "infrun.h"
+#include "process-stratum-target.h"
#include "regcache.h"
#include "sim-regno.h"
-#include "arch-utils.h"
-#include "readline/readline.h"
-#include "gdbthread.h"
-#include "common/byte-vector.h"
+#include "target.h"
+#include "terminal.h"
+#include "value.h"
/* Prototypes */
diff --git a/gdb/remote.c b/gdb/remote.c
index 657a4a25cac..0d9d7528aca 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -20,62 +20,65 @@
/* See the GDB User Guide for details of the GDB remote protocol. */
#include "defs.h"
+#include "remote.h"
+
+/* Standard C includes. */
#include <ctype.h>
#include <fcntl.h>
-#include "inferior.h"
-#include "infrun.h"
+#include <signal.h>
+#include <sys/stat.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+#include <unordered_map>
+
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "symfile.h"
-#include "target.h"
-#include "process-stratum-target.h"
-#include "gdbcmd.h"
-#include "objfiles.h"
-#include "gdb-stabs.h"
-#include "gdbthread.h"
-#include "remote.h"
-#include "remote-notif.h"
-#include "regcache.h"
-#include "value.h"
-#include "observable.h"
-#include "solib.h"
+#include "gdb/fileio.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-decode.h"
#include "cli/cli-setshow.h"
-#include "target-descriptions.h"
-#include "gdb_bfd.h"
+#include "common/agent.h"
+#include "common/byte-vector.h"
+#include "common/environ.h"
#include "common/filestuff.h"
-#include "common/rsp-low.h"
-#include "disasm.h"
-#include "location.h"
-
#include "common/gdb_sys_time.h"
+#include "common/rsp-low.h"
+#include "common/scoped_restore.h"
+/* Local includes. */
+#include "ax-gdb.h"
+#include "ax.h"
+#include "btrace.h"
+#include "disasm.h"
#include "event-loop.h"
#include "event-top.h"
+#include "gdb-stabs.h"
+#include "gdb_bfd.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
#include "inf-loop.h"
-
-#include <signal.h>
-#include "serial.h"
-
-#include "gdbcore.h" /* for exec_bfd */
-
-#include "remote-fileio.h"
-#include "gdb/fileio.h"
-#include <sys/stat.h>
-#include "xml-support.h"
-
+#include "inferior.h"
+#include "infrun.h"
+#include "location.h"
#include "memory-map.h"
-
-#include "tracepoint.h"
-#include "ax.h"
-#include "ax-gdb.h"
-#include "common/agent.h"
-#include "btrace.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "process-stratum-target.h"
#include "record-btrace.h"
-#include <algorithm>
-#include "common/scoped_restore.h"
-#include "common/environ.h"
-#include "common/byte-vector.h"
-#include <unordered_map>
+#include "regcache.h"
+#include "remote-fileio.h"
+#include "remote-notif.h"
+#include "serial.h"
+#include "solib.h"
+#include "symfile.h"
+#include "target-descriptions.h"
+#include "target.h"
+#include "tracepoint.h"
+#include "value.h"
+#include "xml-support.h"
/* The remote target. */
diff --git a/gdb/reverse.c b/gdb/reverse.c
index 7add7d6815f..c12d0b4cf4d 100644
--- a/gdb/reverse.c
+++ b/gdb/reverse.c
@@ -18,14 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
-#include "top.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-cmds.h"
#include "cli/cli-decode.h"
#include "cli/cli-utils.h"
+
+/* Local includes. */
#include "inferior.h"
#include "infrun.h"
#include "regcache.h"
+#include "target.h"
+#include "top.h"
/* User interface:
reverse-step, reverse-next etc. */
diff --git a/gdb/riscv-fbsd-nat.c b/gdb/riscv-fbsd-nat.c
index f4850842a17..d77ea472fea 100644
--- a/gdb/riscv-fbsd-nat.c
+++ b/gdb/riscv-fbsd-nat.c
@@ -18,16 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
+/* Standard C includes. */
#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
+/* Local includes. */
#include "fbsd-nat.h"
-#include "riscv-tdep.h"
-#include "riscv-fbsd-tdep.h"
#include "inf-ptrace.h"
+#include "riscv-fbsd-tdep.h"
+#include "riscv-tdep.h"
+#include "target.h"
struct riscv_fbsd_nat_target final : public fbsd_nat_target
{
diff --git a/gdb/riscv-fbsd-tdep.c b/gdb/riscv-fbsd-tdep.c
index 3125a2285e1..1c7ac4059d7 100644
--- a/gdb/riscv-fbsd-tdep.c
+++ b/gdb/riscv-fbsd-tdep.c
@@ -17,10 +17,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "riscv-fbsd-tdep.h"
+
+/* Local includes. */
#include "fbsd-tdep.h"
#include "osabi.h"
#include "riscv-tdep.h"
-#include "riscv-fbsd-tdep.h"
#include "solib-svr4.h"
#include "target.h"
#include "trad-frame.h"
diff --git a/gdb/riscv-linux-nat.c b/gdb/riscv-linux-nat.c
index 1a9919fef21..f504a997b10 100644
--- a/gdb/riscv-linux-nat.c
+++ b/gdb/riscv-linux-nat.c
@@ -17,17 +17,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "regcache.h"
+
+/* Standard C includes. */
+#include <sys/ptrace.h>
+
+/* Local non-gdb includes. */
+#include "elf/common.h"
+
+/* Local includes. */
#include "gregset.h"
+#include "inferior.h"
#include "linux-nat.h"
+#include "regcache.h"
#include "riscv-tdep.h"
-#include "inferior.h"
#include "target-descriptions.h"
-#include "elf/common.h"
-
-#include <sys/ptrace.h>
-
/* RISC-V Linux native additions to the default linux support. */
class riscv_linux_nat_target final : public linux_nat_target
diff --git a/gdb/riscv-linux-tdep.c b/gdb/riscv-linux-tdep.c
index 91061c5b3e9..b75d4b75e69 100644
--- a/gdb/riscv-linux-tdep.c
+++ b/gdb/riscv-linux-tdep.c
@@ -17,14 +17,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "riscv-tdep.h"
-#include "osabi.h"
+
+/* Local includes. */
#include "glibc-tdep.h"
#include "linux-tdep.h"
-#include "solib-svr4.h"
+#include "osabi.h"
#include "regset.h"
-#include "tramp-frame.h"
+#include "riscv-tdep.h"
+#include "solib-svr4.h"
#include "trad-frame.h"
+#include "tramp-frame.h"
/* Define the general register mapping. The kernel puts the PC at offset 0,
gdb puts it at offset 32. Register x0 is always 0 and can be ignored.
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index ff5f36e7621..564983111a3 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -18,44 +18,50 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "riscv-tdep.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "elf-bfd.h"
+#include "elf/riscv.h"
+#include "floatformat.h"
+#include "opcode/riscv-opc.h"
+#include "opcode/riscv.h"
+#include "symcat.h"
+
+/* Local subdirectory includes. */
+#include "arch/riscv.h"
+#include "cli/cli-decode.h"
+#include "common/common-defs.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "block.h"
+#include "dwarf2-frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
#include "frame.h"
-#include "inferior.h"
-#include "symtab.h"
-#include "value.h"
#include "gdbcmd.h"
-#include "language.h"
#include "gdbcore.h"
-#include "symfile.h"
-#include "objfiles.h"
#include "gdbtypes.h"
-#include "target.h"
-#include "arch-utils.h"
-#include "regcache.h"
+#include "infcall.h"
+#include "inferior.h"
+#include "language.h"
+#include "objfiles.h"
+#include "observable.h"
#include "osabi.h"
-#include "riscv-tdep.h"
-#include "block.h"
+#include "prologue-value.h"
+#include "regcache.h"
#include "reggroups.h"
-#include "opcode/riscv.h"
-#include "elf/riscv.h"
-#include "elf-bfd.h"
-#include "symcat.h"
-#include "dis-asm.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "trad-frame.h"
-#include "infcall.h"
-#include "floatformat.h"
#include "remote.h"
+#include "symfile.h"
+#include "symtab.h"
#include "target-descriptions.h"
-#include "dwarf2-frame.h"
+#include "target.h"
+#include "trad-frame.h"
#include "user-regs.h"
#include "valprint.h"
-#include "common/common-defs.h"
-#include "opcode/riscv-opc.h"
-#include "cli/cli-decode.h"
-#include "observable.h"
-#include "prologue-value.h"
-#include "arch/riscv.h"
+#include "value.h"
/* The stack must be 16-byte aligned. */
#define SP_ALIGNMENT 16
diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c
index 52e52a40b9f..60c39e05340 100644
--- a/gdb/rl78-tdep.c
+++ b/gdb/rl78-tdep.c
@@ -20,23 +20,26 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "prologue-value.h"
-#include "target.h"
-#include "regcache.h"
-#include "opcode/rl78.h"
+
+/* Local non-gdb includes. */
#include "dis-asm.h"
-#include "gdbtypes.h"
-#include "frame.h"
-#include "frame-unwind.h"
+#include "elf-bfd.h"
+#include "elf/rl78.h"
+#include "opcode/rl78.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "dwarf2-frame.h"
#include "frame-base.h"
-#include "value.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
-#include "dwarf2-frame.h"
+#include "gdbtypes.h"
+#include "prologue-value.h"
+#include "regcache.h"
#include "reggroups.h"
-
-#include "elf/rl78.h"
-#include "elf-bfd.h"
+#include "target.h"
+#include "value.h"
/* Register Banks. */
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c
index 2a5271cd530..d95901c277d 100644
--- a/gdb/rs6000-aix-tdep.c
+++ b/gdb/rs6000-aix-tdep.c
@@ -20,26 +20,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
-#include "regcache.h"
-#include "regset.h"
-#include "gdbtypes.h"
+#include "rs6000-aix-tdep.h"
+
+/* Local subdirectory includes. */
+#include "common/xml-utils.h"
+
+/* Local includes. */
+#include "breakpoint.h"
+#include "frame-unwind.h"
#include "gdbcore.h"
-#include "target.h"
-#include "value.h"
+#include "gdbtypes.h"
#include "infcall.h"
#include "objfiles.h"
-#include "breakpoint.h"
-#include "rs6000-tdep.h"
+#include "osabi.h"
#include "ppc-tdep.h"
-#include "rs6000-aix-tdep.h"
-#include "xcoffread.h"
-#include "solib.h"
+#include "regcache.h"
+#include "regset.h"
+#include "rs6000-tdep.h"
#include "solib-aix.h"
+#include "solib.h"
#include "target-float.h"
-#include "common/xml-utils.h"
+#include "target.h"
#include "trad-frame.h"
-#include "frame-unwind.h"
+#include "value.h"
+#include "xcoffread.h"
/* If the kernel has to deliver a signal, it pushes a sigcontext
structure on the stack and then calls the signal handler, passing
diff --git a/gdb/rs6000-lynx178-tdep.c b/gdb/rs6000-lynx178-tdep.c
index 249416857c8..6be9fda7c1c 100644
--- a/gdb/rs6000-lynx178-tdep.c
+++ b/gdb/rs6000-lynx178-tdep.c
@@ -16,12 +16,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
-#include "regcache.h"
+
+/* Local includes. */
#include "gdbcore.h"
#include "gdbtypes.h"
#include "infcall.h"
+#include "osabi.h"
#include "ppc-tdep.h"
+#include "regcache.h"
#include "target-float.h"
#include "value.h"
#include "xcoffread.h"
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 3fa6fb1e6cb..444f99753b7 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -18,38 +18,42 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "symfile.h"
-#include "objfiles.h"
+
+/* Standard C includes. */
+#include <a.out.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/core.h>
+#include <sys/dir.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sys/ptrace.h>
+#include <sys/reg.h>
+#include <sys/stat.h>
+#include <sys/user.h>
+
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "gdb-stabs.h"
-#include "regcache.h"
+
+/* Local includes. */
#include "arch-utils.h"
+#include "exec.h"
+#include "gdb-stabs.h"
+#include "gdb_bfd.h"
+#include "gdbcore.h"
#include "inf-child.h"
#include "inf-ptrace.h"
+#include "inferior.h"
+#include "objfiles.h"
+#include "observable.h"
#include "ppc-tdep.h"
-#include "rs6000-tdep.h"
+#include "regcache.h"
#include "rs6000-aix-tdep.h"
-#include "exec.h"
-#include "observable.h"
+#include "rs6000-tdep.h"
+#include "symfile.h"
+#include "target.h"
#include "xcoffread.h"
-#include <sys/ptrace.h>
-#include <sys/reg.h>
-
-#include <sys/dir.h>
-#include <sys/user.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <a.out.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include "gdb_bfd.h"
-#include <sys/core.h>
#define __LDINFO_PTRACE32__ /* for __ld_info32 */
#define __LDINFO_PTRACE64__ /* for __ld_info64 */
#include <sys/ldr.h>
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index e875ad95366..a1ec6338ceb 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -18,57 +18,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "infrun.h"
-#include "symtab.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
-#include "objfiles.h"
-#include "arch-utils.h"
-#include "regcache.h"
-#include "regset.h"
-#include "target-float.h"
-#include "value.h"
-#include "parser-defs.h"
-#include "osabi.h"
-#include "infcall.h"
-#include "sim-regno.h"
-#include "gdb/sim-ppc.h"
-#include "reggroups.h"
-#include "dwarf2-frame.h"
-#include "target-descriptions.h"
-#include "user-regs.h"
-#include "record-full.h"
-#include "auxv.h"
+#include "rs6000-tdep.h"
-#include "coff/internal.h" /* for libcoff.h */
-#include "libcoff.h" /* for xcoff_data */
-#include "coff/xcoff.h"
-#include "libxcoff.h"
+/* Standard C++ includes. */
+#include <algorithm>
+/* Local non-gdb includes. */
+#include "coff/internal.h"
+#include "coff/xcoff.h"
+#include "dis-asm.h"
#include "elf-bfd.h"
#include "elf/ppc.h"
#include "elf/ppc64.h"
+#include "gdb/sim-ppc.h"
+#include "libcoff.h"
+#include "libxcoff.h"
-#include "solib-svr4.h"
-#include "ppc-tdep.h"
-#include "ppc-ravenscar-thread.h"
-
-#include "dis-asm.h"
-
-#include "trad-frame.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-
-#include "ax.h"
-#include "ax-gdb.h"
-#include <algorithm>
-
+/* Local subdirectory includes. */
#include "features/rs6000/powerpc-32.c"
-#include "features/rs6000/powerpc-altivec32.c"
-#include "features/rs6000/powerpc-vsx32.c"
#include "features/rs6000/powerpc-403.c"
#include "features/rs6000/powerpc-403gc.c"
#include "features/rs6000/powerpc-405.c"
@@ -78,14 +45,49 @@
#include "features/rs6000/powerpc-603.c"
#include "features/rs6000/powerpc-604.c"
#include "features/rs6000/powerpc-64.c"
-#include "features/rs6000/powerpc-altivec64.c"
-#include "features/rs6000/powerpc-vsx64.c"
#include "features/rs6000/powerpc-7400.c"
#include "features/rs6000/powerpc-750.c"
#include "features/rs6000/powerpc-860.c"
+#include "features/rs6000/powerpc-altivec32.c"
+#include "features/rs6000/powerpc-altivec64.c"
#include "features/rs6000/powerpc-e500.c"
+#include "features/rs6000/powerpc-vsx32.c"
+#include "features/rs6000/powerpc-vsx64.c"
#include "features/rs6000/rs6000.c"
+/* Local includes. */
+#include "arch-utils.h"
+#include "auxv.h"
+#include "ax-gdb.h"
+#include "ax.h"
+#include "dwarf2-frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "infcall.h"
+#include "inferior.h"
+#include "infrun.h"
+#include "objfiles.h"
+#include "osabi.h"
+#include "parser-defs.h"
+#include "ppc-ravenscar-thread.h"
+#include "ppc-tdep.h"
+#include "record-full.h"
+#include "regcache.h"
+#include "reggroups.h"
+#include "regset.h"
+#include "sim-regno.h"
+#include "solib-svr4.h"
+#include "symtab.h"
+#include "target-descriptions.h"
+#include "target-float.h"
+#include "target.h"
+#include "trad-frame.h"
+#include "user-regs.h"
+#include "value.h"
+
/* Determine if regnum is an SPE pseudo-register. */
#define IS_SPE_PSEUDOREG(tdep, regnum) ((tdep)->ppc_ev0_regnum >= 0 \
&& (regnum) >= (tdep)->ppc_ev0_regnum \
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
index 0c6c13d738e..e1cb95e6499 100644
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -18,25 +18,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "rust-lang.h"
+/* Standard C includes. */
#include <ctype.h>
+/* Standard C++ includes. */
+#include <algorithm>
+#include <string>
+#include <vector>
+
+/* Local non-gdb includes. */
+#include "demangle.h"
+
+/* Local includes. */
#include "block.h"
#include "c-lang.h"
#include "charset.h"
#include "cp-support.h"
-#include "demangle.h"
#include "gdbarch.h"
#include "infcall.h"
#include "objfiles.h"
#include "psymtab.h"
-#include "rust-lang.h"
#include "typeprint.h"
#include "valprint.h"
#include "varobj.h"
-#include <algorithm>
-#include <string>
-#include <vector>
/* See rust-lang.h. */
diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c
index 2825c799ad8..138779221cf 100644
--- a/gdb/rx-tdep.c
+++ b/gdb/rx-tdep.c
@@ -20,23 +20,28 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "elf-bfd.h"
+#include "elf/rx.h"
+#include "opcode/rx.h"
+
+/* Local includes. */
#include "arch-utils.h"
+#include "dwarf2-frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
#include "prologue-value.h"
-#include "target.h"
#include "regcache.h"
-#include "opcode/rx.h"
-#include "dis-asm.h"
-#include "gdbtypes.h"
-#include "frame.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
+#include "target.h"
#include "value.h"
-#include "gdbcore.h"
-#include "dwarf2-frame.h"
-
-#include "elf/rx.h"
-#include "elf-bfd.h"
-#include <algorithm>
/* Certain important register numbers. */
enum
diff --git a/gdb/s12z-tdep.c b/gdb/s12z-tdep.c
index ea14992b1c6..99ab98e8a89 100644
--- a/gdb/s12z-tdep.c
+++ b/gdb/s12z-tdep.c
@@ -20,16 +20,21 @@
#include "defs.h"
+/* Local non-gdb includes. */
+#include "opcode/s12z.h"
+
+/* Local subdirectory includes. */
+#include "common/errors.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "dwarf2-frame.h"
-#include "common/errors.h"
#include "frame-unwind.h"
-#include "gdbcore.h"
#include "gdbcmd.h"
+#include "gdbcore.h"
#include "inferior.h"
-#include "opcode/s12z.h"
-#include "trad-frame.h"
#include "remote.h"
+#include "trad-frame.h"
/* Two of the registers included in S12Z_N_REGISTERS are
the CCH and CCL "registers" which are just views into
diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
index e2f13def9de..85537656e78 100644
--- a/gdb/s390-linux-nat.c
+++ b/gdb/s390-linux-nat.c
@@ -20,29 +20,37 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "regcache.h"
-#include "inferior.h"
-#include "target.h"
-#include "linux-nat.h"
-#include "auxv.h"
-#include "gregset.h"
-#include "regset.h"
-#include "nat/linux-ptrace.h"
-#include "gdbcmd.h"
-
-#include "s390-tdep.h"
-#include "s390-linux-tdep.h"
-#include "elf/common.h"
+/* Standard C includes. */
#include <asm/ptrace.h>
-#include "nat/gdb_ptrace.h"
#include <asm/types.h>
+#include <elf.h>
#include <sys/procfs.h>
#include <sys/ucontext.h>
-#include <elf.h>
+
+/* Standard C++ includes. */
#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "elf/common.h"
+
+/* Local subdirectory includes. */
+#include "nat/gdb_ptrace.h"
+#include "nat/linux-ptrace.h"
+
+/* Local includes. */
+#include "auxv.h"
+#include "gdbcmd.h"
+#include "gregset.h"
#include "inf-ptrace.h"
+#include "inferior.h"
+#include "linux-nat.h"
#include "linux-tdep.h"
+#include "regcache.h"
+#include "regset.h"
+#include "s390-linux-tdep.h"
+#include "s390-tdep.h"
+#include "target.h"
/* Per-thread arch-specific data. */
diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index 02ae28b4ea7..27fced557a4 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -21,9 +21,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "s390-linux-tdep.h"
-#include "auxv.h"
+/* Local non-gdb includes. */
#include "elf/common.h"
+
+/* Local subdirectory includes. */
+#include "features/s390-gs-linux64.c"
+#include "features/s390-linux32v1.c"
+#include "features/s390-linux32v2.c"
+#include "features/s390-linux64.c"
+#include "features/s390-linux64v1.c"
+#include "features/s390-linux64v2.c"
+#include "features/s390-te-linux64.c"
+#include "features/s390-tevx-linux64.c"
+#include "features/s390-vx-linux64.c"
+#include "features/s390x-gs-linux64.c"
+#include "features/s390x-linux64v1.c"
+#include "features/s390x-linux64v2.c"
+#include "features/s390x-te-linux64.c"
+#include "features/s390x-tevx-linux64.c"
+#include "features/s390x-vx-linux64.c"
+
+/* Local includes. */
+#include "auxv.h"
#include "frame-base.h"
#include "frame-unwind.h"
#include "gdbarch.h"
@@ -32,32 +53,15 @@
#include "linux-tdep.h"
#include "objfiles.h"
#include "osabi.h"
-#include "regcache.h"
#include "record-full.h"
+#include "regcache.h"
#include "regset.h"
#include "s390-tdep.h"
-#include "s390-linux-tdep.h"
#include "solib-svr4.h"
#include "target.h"
#include "trad-frame.h"
#include "xml-syscall.h"
-#include "features/s390-linux32v1.c"
-#include "features/s390-linux32v2.c"
-#include "features/s390-linux64.c"
-#include "features/s390-linux64v1.c"
-#include "features/s390-linux64v2.c"
-#include "features/s390-te-linux64.c"
-#include "features/s390-vx-linux64.c"
-#include "features/s390-tevx-linux64.c"
-#include "features/s390-gs-linux64.c"
-#include "features/s390x-linux64v1.c"
-#include "features/s390x-linux64v2.c"
-#include "features/s390x-te-linux64.c"
-#include "features/s390x-vx-linux64.c"
-#include "features/s390x-tevx-linux64.c"
-#include "features/s390x-gs-linux64.c"
-
#define XML_SYSCALL_FILENAME_S390 "syscalls/s390-linux.xml"
#define XML_SYSCALL_FILENAME_S390X "syscalls/s390x-linux.xml"
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 90aba995036..68b0b85b4eb 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -18,12 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "s390-tdep.h"
+
+/* Local non-gdb includes. */
+#include "elf-bfd.h"
+#include "elf/s390.h"
+
+/* Local subdirectory includes. */
+#include "features/s390-linux32.c"
+#include "features/s390x-linux64.c"
+/* Local includes. */
#include "arch-utils.h"
#include "ax-gdb.h"
#include "dwarf2-frame.h"
-#include "elf/s390.h"
-#include "elf-bfd.h"
#include "frame-base.h"
#include "frame-unwind.h"
#include "gdbarch.h"
@@ -35,14 +43,10 @@
#include "record-full.h"
#include "regcache.h"
#include "reggroups.h"
-#include "s390-tdep.h"
#include "target-descriptions.h"
#include "trad-frame.h"
#include "value.h"
-#include "features/s390-linux32.c"
-#include "features/s390x-linux64.c"
-
/* Holds the current set of options to be passed to the disassembler. */
static char *s390_disassembler_options;
diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c
index 02f4ed4a12b..39df2aa2dfc 100644
--- a/gdb/score-tdep.c
+++ b/gdb/score-tdep.c
@@ -22,20 +22,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "score-tdep.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "dwarf2-frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "gdbcore.h"
#include "inferior.h"
-#include "symtab.h"
#include "objfiles.h"
-#include "gdbcore.h"
-#include "target.h"
-#include "arch-utils.h"
#include "regcache.h"
#include "regset.h"
-#include "dis-asm.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
+#include "symtab.h"
+#include "target.h"
#include "trad-frame.h"
-#include "dwarf2-frame.h"
-#include "score-tdep.h"
#define G_FLD(_i,_ms,_ls) \
((unsigned)((_i) << (31 - (_ms))) >> (31 - (_ms) + (_ls)))
diff --git a/gdb/selftest-arch.c b/gdb/selftest-arch.c
index 7a64295efa8..eb73a34a13e 100644
--- a/gdb/selftest-arch.c
+++ b/gdb/selftest-arch.c
@@ -17,6 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "selftest-arch.h"
#if GDB_SELF_TEST
#include "common/selftest.h"
diff --git a/gdb/sentinel-frame.c b/gdb/sentinel-frame.c
index e307d437c14..5fd350aec30 100644
--- a/gdb/sentinel-frame.c
+++ b/gdb/sentinel-frame.c
@@ -19,10 +19,12 @@
#include "defs.h"
-#include "regcache.h"
#include "sentinel-frame.h"
-#include "inferior.h"
+
+/* Local includes. */
#include "frame-unwind.h"
+#include "inferior.h"
+#include "regcache.h"
struct frame_unwind_cache
{
diff --git a/gdb/ser-base.c b/gdb/ser-base.c
index 683d3f42528..d66a22a8f15 100644
--- a/gdb/ser-base.c
+++ b/gdb/ser-base.c
@@ -18,12 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "serial.h"
#include "ser-base.h"
-#include "event-loop.h"
-#include "gdb_select.h"
+/* Local subdirectory includes. */
#include "common/gdb_sys_time.h"
+
+/* Local includes. */
+#include "event-loop.h"
+#include "gdb_select.h"
+#include "serial.h"
+
#ifdef USE_WIN32API
#include <winsock2.h>
#endif
diff --git a/gdb/ser-base.h b/gdb/ser-base.h
index 2a30ba191fc..ee3fe056b86 100644
--- a/gdb/ser-base.h
+++ b/gdb/ser-base.h
@@ -20,7 +20,7 @@
#ifndef SER_BASE_H
#define SER_BASE_H
-#include "serial.h" /* For serial_ttystate. */
+#include "serial.h"
struct serial;
struct ui_file;
diff --git a/gdb/ser-event.c b/gdb/ser-event.c
index d3956346246..72fc626f3db 100644
--- a/gdb/ser-event.c
+++ b/gdb/ser-event.c
@@ -18,9 +18,13 @@
#include "defs.h"
#include "ser-event.h"
-#include "serial.h"
+
+/* Local subdirectory includes. */
#include "common/filestuff.h"
+/* Local includes. */
+#include "serial.h"
+
/* On POSIX hosts, a serial_event is basically an abstraction for the
classical self-pipe trick.
diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c
index bf7bffbe584..e26b1887923 100644
--- a/gdb/ser-go32.c
+++ b/gdb/ser-go32.c
@@ -22,8 +22,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "gdbcmd.h"
#include "serial.h"
+
/*
* NS16550 UART registers
*/
diff --git a/gdb/ser-mingw.c b/gdb/ser-mingw.c
index 0bf791bb3ec..a9e20aa4834 100644
--- a/gdb/ser-mingw.c
+++ b/gdb/ser-mingw.c
@@ -18,18 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "serial.h"
-#include "ser-base.h"
-#include "ser-tcp.h"
-#include <windows.h>
+/* Standard C includes. */
#include <conio.h>
-
#include <fcntl.h>
-#include <unistd.h>
#include <sys/types.h>
+#include <unistd.h>
+#include <windows.h>
+/* Local includes. */
#include "command.h"
+#include "ser-base.h"
+#include "ser-tcp.h"
+#include "serial.h"
struct ser_windows_state
{
diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c
index 702d97c5513..eb040791d4d 100644
--- a/gdb/ser-pipe.c
+++ b/gdb/ser-pipe.c
@@ -19,19 +19,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "serial.h"
-#include "ser-base.h"
-#include "ser-unix.h"
-
-#include "gdb_vfork.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-#include "common/gdb_sys_time.h"
+/* Standard C includes. */
#include <fcntl.h>
+#include <signal.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+
+/* Local subdirectory includes. */
#include "common/filestuff.h"
+#include "common/gdb_sys_time.h"
-#include <signal.h>
+/* Local includes. */
+#include "gdb_vfork.h"
+#include "ser-base.h"
+#include "ser-unix.h"
+#include "serial.h"
static int pipe_open (struct serial *scb, const char *name);
static void pipe_close (struct serial *scb);
diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index 039b0432231..c3c3ebca73c 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -18,25 +18,28 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "serial.h"
-#include "ser-base.h"
#include "ser-tcp.h"
-#include "gdbcmd.h"
-#include "cli/cli-decode.h"
-#include "cli/cli-setshow.h"
-#include "common/filestuff.h"
-#include "common/netstuff.h"
-
-#include <sys/types.h>
+/* Standard C includes. */
#ifdef HAVE_SYS_FILIO_H
#include <sys/filio.h> /* For FIONBIO. */
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h> /* For FIONBIO. */
#endif
+#include <sys/types.h>
+/* Local subdirectory includes. */
+#include "cli/cli-decode.h"
+#include "cli/cli-setshow.h"
+#include "common/filestuff.h"
#include "common/gdb_sys_time.h"
+#include "common/netstuff.h"
+
+/* Local includes. */
+#include "gdbcmd.h"
+#include "ser-base.h"
+#include "serial.h"
#ifdef USE_WIN32API
#if _WIN32_WINNT < 0x0501
diff --git a/gdb/ser-uds.c b/gdb/ser-uds.c
index 264f2170cb6..4869d394d03 100644
--- a/gdb/ser-uds.c
+++ b/gdb/ser-uds.c
@@ -18,12 +18,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "serial.h"
-#include "ser-base.h"
+/* Standard C includes. */
#include <sys/socket.h>
#include <sys/un.h>
+/* Local includes. */
+#include "ser-base.h"
+#include "serial.h"
+
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) NULL)->sun_path)
#endif
diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c
index 5a9965bf744..ea286fbae6e 100644
--- a/gdb/ser-unix.c
+++ b/gdb/ser-unix.c
@@ -18,20 +18,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "serial.h"
-#include "ser-base.h"
#include "ser-unix.h"
+/* Standard C includes. */
#include <fcntl.h>
-#include <sys/types.h>
-#include "terminal.h"
#include <sys/socket.h>
+#include <sys/types.h>
+#include <termios.h>
+
+/* Local subdirectory includes. */
+#include "common/filestuff.h"
#include "common/gdb_sys_time.h"
+/* Local includes. */
#include "gdb_select.h"
#include "gdbcmd.h"
-#include "common/filestuff.h"
-#include <termios.h>
+#include "ser-base.h"
+#include "serial.h"
+#include "terminal.h"
struct hardwire_ttystate
{
diff --git a/gdb/serial.c b/gdb/serial.c
index bc8d910a5a5..31ece805189 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -18,11 +18,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include <ctype.h>
#include "serial.h"
-#include "gdbcmd.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local subdirectory includes. */
#include "cli/cli-utils.h"
+/* Local includes. */
+#include "gdbcmd.h"
+
/* Is serial being debugged? */
static unsigned int global_serial_debug_p;
diff --git a/gdb/sh-linux-tdep.c b/gdb/sh-linux-tdep.c
index 8aa60170a9c..e168843a0d1 100644
--- a/gdb/sh-linux-tdep.c
+++ b/gdb/sh-linux-tdep.c
@@ -18,18 +18,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
+/* Local includes. */
+#include "glibc-tdep.h"
+#include "linux-tdep.h"
+#include "osabi.h"
+#include "sh-tdep.h"
#include "solib-svr4.h"
#include "symtab.h"
-
#include "trad-frame.h"
#include "tramp-frame.h"
-#include "glibc-tdep.h"
-#include "sh-tdep.h"
-#include "linux-tdep.h"
-
#define REGSx16(base) \
{(base), 0}, \
{(base) + 1, 4}, \
diff --git a/gdb/sh-nbsd-nat.c b/gdb/sh-nbsd-nat.c
index 1717ff93f55..31bf0537f31 100644
--- a/gdb/sh-nbsd-nat.c
+++ b/gdb/sh-nbsd-nat.c
@@ -20,15 +20,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
+/* Standard C includes. */
#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
-#include "sh-tdep.h"
+/* Local includes. */
#include "inf-ptrace.h"
+#include "inferior.h"
#include "regcache.h"
+#include "sh-tdep.h"
struct sh_nbsd_nat_target final : public inf_ptrace_target
{
diff --git a/gdb/sh-nbsd-tdep.c b/gdb/sh-nbsd-tdep.c
index 4ae989a3926..987c591246d 100644
--- a/gdb/sh-nbsd-tdep.c
+++ b/gdb/sh-nbsd-tdep.c
@@ -20,13 +20,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "gdbcore.h"
-#include "regset.h"
-#include "value.h"
#include "osabi.h"
-
+#include "regset.h"
#include "sh-tdep.h"
#include "solib-svr4.h"
+#include "value.h"
/* Convert a register number into an offset into a ptrace
register structure. */
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index de53dcd8285..e3da6b755cf 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -21,29 +21,31 @@
sac@cygnus.com. */
#include "defs.h"
-#include "frame.h"
+#include "sh-tdep.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "elf-bfd.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "dwarf2-frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
-#include "dwarf2-frame.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+#include "frame.h"
#include "gdbcmd.h"
#include "gdbcore.h"
-#include "value.h"
-#include "dis-asm.h"
+#include "gdbtypes.h"
#include "inferior.h"
-#include "arch-utils.h"
-#include "regcache.h"
-#include "target-float.h"
+#include "objfiles.h"
#include "osabi.h"
+#include "regcache.h"
#include "reggroups.h"
#include "regset.h"
-#include "objfiles.h"
-
-#include "sh-tdep.h"
-
-#include "elf-bfd.h"
#include "solib-svr4.h"
+#include "symtab.h"
+#include "target-float.h"
+#include "value.h"
/* sh flags */
#include "elf/sh.h"
diff --git a/gdb/skip.c b/gdb/skip.c
index 127b11dc443..61dabb04451 100644
--- a/gdb/skip.c
+++ b/gdb/skip.c
@@ -17,25 +17,33 @@
#include "defs.h"
#include "skip.h"
-#include "value.h"
-#include "valprint.h"
-#include "ui-out.h"
-#include "symtab.h"
-#include "gdbcmd.h"
-#include "command.h"
-#include "completer.h"
-#include "stack.h"
+
+/* Standard C++ includes. */
+#include <list>
+
+/* Local non-gdb includes. */
+#include "filenames.h"
+#include "fnmatch.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-utils.h"
+#include "common/gdb_optional.h"
+
+/* Local includes. */
#include "arch-utils.h"
+#include "breakpoint.h"
+#include "command.h"
+#include "completer.h"
+#include "gdb_regex.h"
+#include "gdbcmd.h"
#include "linespec.h"
#include "objfiles.h"
-#include "breakpoint.h" /* for get_sal_arch () */
#include "source.h"
-#include "filenames.h"
-#include "fnmatch.h"
-#include "gdb_regex.h"
-#include "common/gdb_optional.h"
-#include <list>
+#include "stack.h"
+#include "symtab.h"
+#include "ui-out.h"
+#include "valprint.h"
+#include "value.h"
/* True if we want to print debug printouts related to file/function
skipping. */
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 68fa85130a1..88301a6eaf2 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -49,25 +49,29 @@
by calling functions in procfs.c. */
#include "defs.h"
-#include <thread.h>
-#include <proc_service.h>
-#include <thread_db.h>
-#include "gdbthread.h"
-#include "target.h"
-#include "inferior.h"
+
+/* Standard C includes. */
+#include <dlfcn.h>
#include <fcntl.h>
+#include <proc_service.h>
#include <sys/stat.h>
-#include <dlfcn.h>
+#include <thread.h>
+#include <thread_db.h>
+
+/* Local includes. */
#include "gdbcmd.h"
#include "gdbcore.h"
+#include "gdbthread.h"
+#include "inferior.h"
+#include "minsyms.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "procfs.h"
#include "regcache.h"
#include "solib.h"
#include "symfile.h"
-#include "observable.h"
-#include "procfs.h"
#include "symtab.h"
-#include "minsyms.h"
-#include "objfiles.h"
+#include "target.h"
static const target_info thread_db_target_info = {
"solaris-threads",
diff --git a/gdb/sol2-tdep.c b/gdb/sol2-tdep.c
index 014b7d79a73..6231b371b9f 100644
--- a/gdb/sol2-tdep.c
+++ b/gdb/sol2-tdep.c
@@ -18,12 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "sol2-tdep.h"
+
+/* Local includes. */
#include "frame.h"
-#include "symtab.h"
#include "inferior.h"
#include "objfiles.h"
-
-#include "sol2-tdep.h"
+#include "symtab.h"
CORE_ADDR
sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c
index ab4f3626290..0936b012cb9 100644
--- a/gdb/solib-aix.c
+++ b/gdb/solib-aix.c
@@ -17,16 +17,20 @@
#include "defs.h"
#include "solib-aix.h"
-#include "solist.h"
-#include "inferior.h"
+
+/* Local subdirectory includes. */
+#include "common/scope-exit.h"
+
+/* Local includes. */
#include "gdb_bfd.h"
+#include "gdbcmd.h"
#include "gdbcore.h"
+#include "inferior.h"
#include "objfiles.h"
+#include "observable.h"
+#include "solist.h"
#include "symtab.h"
#include "xcoffread.h"
-#include "observable.h"
-#include "gdbcmd.h"
-#include "common/scope-exit.h"
/* Variable controlling the output of the debugging traces for
this module. */
diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c
index 65a5b9afca0..3739c47a98e 100644
--- a/gdb/solib-darwin.c
+++ b/gdb/solib-darwin.c
@@ -18,28 +18,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "solib-darwin.h"
-#include "symtab.h"
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "symfile.h"
-#include "objfiles.h"
+#include "elf-bfd.h"
+#include "mach-o.h"
+#include "mach-o/external.h"
+
+/* Local includes. */
+#include "auxv.h"
+#include "bfd-target.h"
+#include "exec.h"
+#include "gdb_bfd.h"
#include "gdbcore.h"
-#include "target.h"
+#include "gdbthread.h"
#include "inferior.h"
+#include "objfiles.h"
#include "regcache.h"
-#include "gdbthread.h"
-#include "gdb_bfd.h"
-
-#include "solist.h"
-#include "solib.h"
#include "solib-svr4.h"
-
-#include "bfd-target.h"
-#include "elf-bfd.h"
-#include "exec.h"
-#include "auxv.h"
-#include "mach-o.h"
-#include "mach-o/external.h"
+#include "solib.h"
+#include "solist.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
struct gdb_dyld_image_info
{
diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c
index 20310144f32..b37fb3495dc 100644
--- a/gdb/solib-dsbt.c
+++ b/gdb/solib-dsbt.c
@@ -18,17 +18,21 @@
#include "defs.h"
-#include "inferior.h"
+
+/* Local non-gdb includes. */
+#include "elf-bfd.h"
+
+/* Local includes. */
+#include "command.h"
+#include "gdb_bfd.h"
+#include "gdbcmd.h"
#include "gdbcore.h"
+#include "inferior.h"
+#include "language.h"
+#include "objfiles.h"
#include "solib.h"
#include "solist.h"
-#include "objfiles.h"
#include "symtab.h"
-#include "language.h"
-#include "command.h"
-#include "gdbcmd.h"
-#include "elf-bfd.h"
-#include "gdb_bfd.h"
#define GOT_MODULE_OFFSET 4
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
index 1b330b8f97f..df359b6fb6b 100644
--- a/gdb/solib-frv.c
+++ b/gdb/solib-frv.c
@@ -18,18 +18,22 @@
#include "defs.h"
-#include "inferior.h"
+
+/* Local non-gdb includes. */
+#include "elf/frv.h"
+
+/* Local includes. */
+#include "command.h"
+#include "frv-tdep.h"
+#include "gdb_bfd.h"
+#include "gdbcmd.h"
#include "gdbcore.h"
+#include "inferior.h"
+#include "language.h"
+#include "objfiles.h"
#include "solib.h"
#include "solist.h"
-#include "frv-tdep.h"
-#include "objfiles.h"
#include "symtab.h"
-#include "language.h"
-#include "command.h"
-#include "gdbcmd.h"
-#include "elf/frv.h"
-#include "gdb_bfd.h"
/* Flag which indicates whether internal debug messages should be printed. */
static unsigned int solib_frv_debug;
diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c
index 0cce0c953a1..13832a7e1a4 100644
--- a/gdb/solib-spu.c
+++ b/gdb/solib-spu.c
@@ -20,22 +20,27 @@
#include "defs.h"
#include "solib-spu.h"
-#include "gdbcore.h"
+
+/* Standard C includes. */
#include <sys/stat.h>
-#include "arch-utils.h"
+
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "symtab.h"
-#include "solib.h"
-#include "solib-svr4.h"
-#include "solist.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "breakpoint.h"
+#include "gdb_bfd.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
#include "inferior.h"
#include "objfiles.h"
#include "observable.h"
-#include "breakpoint.h"
-#include "gdbthread.h"
-#include "gdb_bfd.h"
-
+#include "solib-svr4.h"
+#include "solib.h"
+#include "solist.h"
#include "spu-tdep.h"
+#include "symtab.h"
/* Highest SPE id (file handle) the inferior may have. */
#define MAX_SPE_FD 1024
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 0b8cadb2dc7..b9d6d0f5178 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -18,33 +18,33 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "solib-svr4.h"
-#include "elf/external.h"
+/* Local non-gdb includes. */
+#include "bfd.h"
+#include "elf-bfd.h"
#include "elf/common.h"
+#include "elf/external.h"
#include "elf/mips.h"
-#include "symtab.h"
-#include "bfd.h"
-#include "symfile.h"
-#include "objfiles.h"
+/* Local includes. */
+#include "auxv.h"
+#include "bfd-target.h"
+#include "exec.h"
+#include "gdb_bfd.h"
#include "gdbcore.h"
-#include "target.h"
+#include "gdbthread.h"
#include "inferior.h"
#include "infrun.h"
-#include "regcache.h"
-#include "gdbthread.h"
+#include "objfiles.h"
#include "observable.h"
-
-#include "solist.h"
-#include "solib.h"
-#include "solib-svr4.h"
-
-#include "bfd-target.h"
-#include "elf-bfd.h"
-#include "exec.h"
-#include "auxv.h"
-#include "gdb_bfd.h"
#include "probe.h"
+#include "regcache.h"
+#include "solib.h"
+#include "solist.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
diff --git a/gdb/solib-target.c b/gdb/solib-target.c
index a1cf94c42e6..71adb8485ff 100644
--- a/gdb/solib-target.c
+++ b/gdb/solib-target.c
@@ -18,14 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "solib-target.h"
+
+/* Standard C++ includes. */
+#include <vector>
+
+/* Local subdirectory includes. */
+#include "common/vec.h"
+
+/* Local includes. */
#include "objfiles.h"
#include "solist.h"
-#include "symtab.h"
#include "symfile.h"
+#include "symtab.h"
#include "target.h"
-#include "common/vec.h"
-#include "solib-target.h"
-#include <vector>
/* Private data for each loaded library. */
struct lm_info_target : public lm_info_base
diff --git a/gdb/solib.c b/gdb/solib.c
index 8cef5a042b4..fff2e77c5b1 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -18,35 +18,42 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "solib.h"
-#include <sys/types.h>
+/* Standard C includes. */
#include <fcntl.h>
-#include "symtab.h"
+#include <sys/types.h>
+
+/* Local non-gdb includes. */
#include "bfd.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "gdbcore.h"
+#include "filenames.h"
+#include "readline/readline.h"
+
+/* Local subdirectory includes. */
+#include "common/environ.h"
+#include "common/filestuff.h"
+
+/* Local includes. */
#include "command.h"
-#include "target.h"
+#include "completer.h"
+#include "exec.h"
+#include "filesystem.h"
#include "frame.h"
+#include "gdb_bfd.h"
#include "gdb_regex.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
#include "inferior.h"
-#include "common/environ.h"
+#include "interps.h"
#include "language.h"
-#include "gdbcmd.h"
-#include "completer.h"
-#include "filenames.h" /* for DOSish file names */
-#include "exec.h"
-#include "solist.h"
+#include "objfiles.h"
#include "observable.h"
-#include "readline/readline.h"
#include "remote.h"
-#include "solib.h"
-#include "interps.h"
-#include "filesystem.h"
-#include "gdb_bfd.h"
-#include "common/filestuff.h"
+#include "solist.h"
#include "source.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
/* Architecture-specific operations. */
diff --git a/gdb/source-cache.c b/gdb/source-cache.c
index 5eae02082df..a1051ef06f5 100644
--- a/gdb/source-cache.c
+++ b/gdb/source-cache.c
@@ -18,9 +18,13 @@
#include "defs.h"
#include "source-cache.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-style.h"
#include "common/scoped_fd.h"
+
+/* Local includes. */
#include "source.h"
-#include "cli/cli-style.h"
#ifdef HAVE_SOURCE_HIGHLIGHT
/* If Gnulib redirects 'open' and 'close' to its replacements
diff --git a/gdb/source.c b/gdb/source.c
index f99215f9810..1e187489909 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -17,35 +17,44 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "symtab.h"
-#include "expression.h"
-#include "language.h"
-#include "command.h"
#include "source.h"
-#include "gdbcmd.h"
-#include "frame.h"
-#include "value.h"
-#include "common/filestuff.h"
-#include <sys/types.h>
+/* Standard C includes. */
#include <fcntl.h>
-#include "gdbcore.h"
-#include "gdb_regex.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "annotate.h"
-#include "gdbtypes.h"
-#include "linespec.h"
-#include "filenames.h" /* for DOSish file names */
-#include "completer.h"
-#include "ui-out.h"
+#include <sys/types.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "filenames.h"
#include "readline/readline.h"
+
+/* Local subdirectory includes. */
#include "common/enum-flags.h"
-#include "common/scoped_fd.h"
-#include <algorithm>
+#include "common/filestuff.h"
#include "common/pathstuff.h"
+#include "common/scoped_fd.h"
+
+/* Local includes. */
+#include "annotate.h"
+#include "arch-utils.h"
+#include "command.h"
+#include "completer.h"
+#include "expression.h"
+#include "frame.h"
+#include "gdb_regex.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "language.h"
+#include "linespec.h"
+#include "objfiles.h"
#include "source-cache.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "ui-out.h"
+#include "value.h"
#define OPEN_MODE (O_RDONLY | O_BINARY)
#define FDOPEN_MODE FOPEN_RB
diff --git a/gdb/sparc-linux-nat.c b/gdb/sparc-linux-nat.c
index 048171fde2b..d85500e0f4f 100644
--- a/gdb/sparc-linux-nat.c
+++ b/gdb/sparc-linux-nat.c
@@ -17,16 +17,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "regcache.h"
+/* Standard C includes. */
#include <sys/procfs.h>
-#include "gregset.h"
-#include "sparc-tdep.h"
-#include "sparc-nat.h"
+/* Local includes. */
+#include "gregset.h"
#include "inferior.h"
-#include "target.h"
#include "linux-nat.h"
+#include "regcache.h"
+#include "sparc-nat.h"
+#include "sparc-tdep.h"
+#include "target.h"
class sparc_linux_nat_target final : public linux_nat_target
{
diff --git a/gdb/sparc-linux-tdep.c b/gdb/sparc-linux-tdep.c
index 35bffdd772e..4b555083a22 100644
--- a/gdb/sparc-linux-tdep.c
+++ b/gdb/sparc-linux-tdep.c
@@ -18,21 +18,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "dwarf2-frame.h"
-#include "frame.h"
#include "frame-unwind.h"
-#include "gdbtypes.h"
-#include "regset.h"
+#include "frame.h"
#include "gdbarch.h"
#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "linux-tdep.h"
#include "osabi.h"
#include "regcache.h"
+#include "regset.h"
#include "solib-svr4.h"
#include "symtab.h"
#include "trad-frame.h"
#include "tramp-frame.h"
#include "xml-syscall.h"
-#include "linux-tdep.h"
/* The syscall's XML filename for sparc 32-bit. */
#define XML_SYSCALL_FILENAME_SPARC32 "syscalls/sparc-linux.xml"
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index 173fd0b6397..57d668dd7e7 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -18,20 +18,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "target.h"
+#include "sparc-nat.h"
-#include <signal.h>
-#include <sys/ptrace.h>
-#include "common/gdb_wait.h"
+/* Standard C includes. */
#ifdef HAVE_MACHINE_REG_H
#include <machine/reg.h>
#endif
+#include <signal.h>
+#include <sys/ptrace.h>
-#include "sparc-tdep.h"
-#include "sparc-nat.h"
+/* Local subdirectory includes. */
+#include "common/gdb_wait.h"
+
+/* Local includes. */
#include "inf-ptrace.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "sparc-tdep.h"
+#include "target.h"
/* With some trickery we can use the code in this file for most (if
not all) ptrace(2) based SPARC systems, which includes SunOS 4,
diff --git a/gdb/sparc-nbsd-nat.c b/gdb/sparc-nbsd-nat.c
index 1405f120fa7..d913aa17c47 100644
--- a/gdb/sparc-nbsd-nat.c
+++ b/gdb/sparc-nbsd-nat.c
@@ -18,11 +18,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "regcache.h"
-#include "target.h"
-#include "sparc-tdep.h"
+/* Local includes. */
+#include "regcache.h"
#include "sparc-nat.h"
+#include "sparc-tdep.h"
+#include "target.h"
/* Support for debugging kernel virtual memory images. */
diff --git a/gdb/sparc-nbsd-tdep.c b/gdb/sparc-nbsd-tdep.c
index 486d9abadc1..a90888840de 100644
--- a/gdb/sparc-nbsd-tdep.c
+++ b/gdb/sparc-nbsd-tdep.c
@@ -19,20 +19,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
+
+/* Local includes. */
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
#include "gdbtypes.h"
+#include "nbsd-tdep.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
#include "solib-svr4.h"
+#include "sparc-tdep.h"
#include "symtab.h"
#include "trad-frame.h"
-#include "sparc-tdep.h"
-#include "nbsd-tdep.h"
-
/* Macros to extract fields from SPARC instructions. */
#define X_RS1(i) (((i) >> 14) & 0x1f)
#define X_RS2(i) ((i) & 0x1f)
diff --git a/gdb/sparc-obsd-tdep.c b/gdb/sparc-obsd-tdep.c
index 6149db9419b..063f66cbdc2 100644
--- a/gdb/sparc-obsd-tdep.c
+++ b/gdb/sparc-obsd-tdep.c
@@ -18,19 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
+
+/* Local includes. */
+#include "bsd-uthread.h"
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
+#include "obsd-tdep.h"
#include "osabi.h"
#include "regcache.h"
+#include "solib-svr4.h"
+#include "sparc-tdep.h"
#include "symtab.h"
#include "trad-frame.h"
-#include "obsd-tdep.h"
-#include "sparc-tdep.h"
-#include "solib-svr4.h"
-#include "bsd-uthread.h"
-
/* Signal trampolines. */
/* The OpenBSD kernel maps the signal trampoline at some random
diff --git a/gdb/sparc-ravenscar-thread.c b/gdb/sparc-ravenscar-thread.c
index c619f6e3c10..4e206afd527 100644
--- a/gdb/sparc-ravenscar-thread.c
+++ b/gdb/sparc-ravenscar-thread.c
@@ -18,12 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "sparc-ravenscar-thread.h"
+
+/* Local includes. */
#include "gdbcore.h"
-#include "regcache.h"
-#include "sparc-tdep.h"
#include "inferior.h"
#include "ravenscar-thread.h"
-#include "sparc-ravenscar-thread.h"
+#include "regcache.h"
+#include "sparc-tdep.h"
struct sparc_ravenscar_ops : public ravenscar_arch_ops
{
diff --git a/gdb/sparc-sol2-nat.c b/gdb/sparc-sol2-nat.c
index 21543815494..60e4baeb0c8 100644
--- a/gdb/sparc-sol2-nat.c
+++ b/gdb/sparc-sol2-nat.c
@@ -18,14 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "regcache.h"
+/* Standard C includes. */
#include <sys/procfs.h>
-#include "gregset.h"
+/* Local includes. */
+#include "gregset.h"
+#include "procfs.h"
+#include "regcache.h"
#include "sparc-tdep.h"
#include "target.h"
-#include "procfs.h"
/* This file provids the (temporary) glue between the Solaris SPARC
target dependent code and the machine independent SVR4 /proc
diff --git a/gdb/sparc-sol2-tdep.c b/gdb/sparc-sol2-tdep.c
index 10245235b3e..c10ed8607ae 100644
--- a/gdb/sparc-sol2-tdep.c
+++ b/gdb/sparc-sol2-tdep.c
@@ -18,20 +18,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
+
+/* Local includes. */
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
-#include "symtab.h"
#include "objfiles.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
-#include "target.h"
-#include "trad-frame.h"
-
#include "sol2-tdep.h"
-#include "sparc-tdep.h"
#include "solib-svr4.h"
+#include "sparc-tdep.h"
+#include "symtab.h"
+#include "target.h"
+#include "trad-frame.h"
/* From <sys/regset.h>. */
const struct sparc_gregmap sparc32_sol2_gregmap =
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index a155cfa7384..50365912a60 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -18,28 +18,33 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
+#include "sparc-tdep.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "dis-asm.h"
#include "dwarf2.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "dwarf2-frame.h"
-#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
#include "gdbtypes.h"
#include "inferior.h"
-#include "symtab.h"
#include "objfiles.h"
#include "osabi.h"
#include "regcache.h"
-#include "target.h"
+#include "sparc-ravenscar-thread.h"
+#include "symtab.h"
#include "target-descriptions.h"
+#include "target.h"
#include "value.h"
-#include "sparc-tdep.h"
-#include "sparc-ravenscar-thread.h"
-#include <algorithm>
-
struct regset;
/* This file implements the SPARC 32-bit ABI as defined by the section
diff --git a/gdb/sparc64-fbsd-nat.c b/gdb/sparc64-fbsd-nat.c
index 02ee174668e..1e9b8a4c0d9 100644
--- a/gdb/sparc64-fbsd-nat.c
+++ b/gdb/sparc64-fbsd-nat.c
@@ -18,12 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "regcache.h"
-#include "target.h"
+/* Local includes. */
#include "fbsd-nat.h"
-#include "sparc64-tdep.h"
+#include "regcache.h"
#include "sparc-nat.h"
+#include "sparc64-tdep.h"
+#include "target.h"
+
/* Support for debugging kernel virtual memory images. */
diff --git a/gdb/sparc64-fbsd-tdep.c b/gdb/sparc64-fbsd-tdep.c
index 4016006bd35..345d1b22e6b 100644
--- a/gdb/sparc64-fbsd-tdep.c
+++ b/gdb/sparc64-fbsd-tdep.c
@@ -18,19 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
+
+/* Local includes. */
+#include "fbsd-tdep.h"
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
+#include "solib-svr4.h"
+#include "sparc64-tdep.h"
#include "target.h"
#include "trad-frame.h"
-#include "sparc64-tdep.h"
-#include "fbsd-tdep.h"
-#include "solib-svr4.h"
-
/* From <machine/reg.h>. */
const struct sparc_gregmap sparc64fbsd_gregmap =
{
diff --git a/gdb/sparc64-linux-nat.c b/gdb/sparc64-linux-nat.c
index 96cd163d2be..8184a7dce78 100644
--- a/gdb/sparc64-linux-nat.c
+++ b/gdb/sparc64-linux-nat.c
@@ -18,17 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "regcache.h"
+/* Standard C includes. */
#include <sys/procfs.h>
-#include "gregset.h"
-#include "sparc64-tdep.h"
-#include "sparc-tdep.h"
-#include "sparc-nat.h"
+/* Local includes. */
+#include "gregset.h"
#include "inferior.h"
-#include "target.h"
#include "linux-nat.h"
+#include "regcache.h"
+#include "sparc-nat.h"
+#include "sparc-tdep.h"
+#include "sparc64-tdep.h"
+#include "target.h"
class sparc64_linux_nat_target final : public linux_nat_target
{
diff --git a/gdb/sparc64-linux-tdep.c b/gdb/sparc64-linux-tdep.c
index 33170f23675..280e755bb67 100644
--- a/gdb/sparc64-linux-tdep.c
+++ b/gdb/sparc64-linux-tdep.c
@@ -18,20 +18,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
+
+/* Local includes. */
#include "dwarf2-frame.h"
-#include "regset.h"
-#include "regcache.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbarch.h"
#include "gdbcore.h"
+#include "linux-tdep.h"
#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
#include "solib-svr4.h"
#include "symtab.h"
#include "trad-frame.h"
#include "tramp-frame.h"
#include "xml-syscall.h"
-#include "linux-tdep.h"
/* ADI specific si_code */
#ifndef SEGV_ACCADI
diff --git a/gdb/sparc64-nat.c b/gdb/sparc64-nat.c
index 77b5141aee1..c7cc5fc1c00 100644
--- a/gdb/sparc64-nat.c
+++ b/gdb/sparc64-nat.c
@@ -18,10 +18,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbarch.h"
-#include "sparc64-tdep.h"
+/* Local includes. */
+#include "gdbarch.h"
#include "sparc-nat.h"
+#include "sparc64-tdep.h"
/* Determine whether `gregset_t' contains register REGNUM. */
diff --git a/gdb/sparc64-nbsd-nat.c b/gdb/sparc64-nbsd-nat.c
index fb0203ba91b..061884b1080 100644
--- a/gdb/sparc64-nbsd-nat.c
+++ b/gdb/sparc64-nbsd-nat.c
@@ -18,12 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "gdbcore.h"
#include "regcache.h"
-#include "target.h"
-
-#include "sparc64-tdep.h"
#include "sparc-nat.h"
+#include "sparc64-tdep.h"
+#include "target.h"
/* NetBSD is different from the other OSes that support both SPARC and
UltraSPARC in that the result of ptrace(2) depends on whether the
diff --git a/gdb/sparc64-nbsd-tdep.c b/gdb/sparc64-nbsd-tdep.c
index b43efe0e3f8..ce4aa95d0f7 100644
--- a/gdb/sparc64-nbsd-tdep.c
+++ b/gdb/sparc64-nbsd-tdep.c
@@ -19,19 +19,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
+
+/* Local includes. */
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
+#include "nbsd-tdep.h"
+#include "objfiles.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
-#include "symtab.h"
-#include "objfiles.h"
#include "solib-svr4.h"
-#include "trad-frame.h"
-
#include "sparc64-tdep.h"
-#include "nbsd-tdep.h"
+#include "symtab.h"
+#include "trad-frame.h"
/* From <machine/reg.h>. */
const struct sparc_gregmap sparc64nbsd_gregmap =
diff --git a/gdb/sparc64-obsd-nat.c b/gdb/sparc64-obsd-nat.c
index ee0cfe4b080..c7f715769eb 100644
--- a/gdb/sparc64-obsd-nat.c
+++ b/gdb/sparc64-obsd-nat.c
@@ -18,13 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "gdbcore.h"
+#include "obsd-nat.h"
#include "regcache.h"
-#include "target.h"
-
-#include "sparc64-tdep.h"
#include "sparc-nat.h"
-#include "obsd-nat.h"
+#include "sparc64-tdep.h"
+#include "target.h"
/* Determine whether `gregset_t' contains register REGNUM. */
diff --git a/gdb/sparc64-obsd-tdep.c b/gdb/sparc64-obsd-tdep.c
index 42ddbf6e927..b1714e1c253 100644
--- a/gdb/sparc64-obsd-tdep.c
+++ b/gdb/sparc64-obsd-tdep.c
@@ -18,21 +18,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
+
+/* Local includes. */
+#include "bsd-uthread.h"
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
+#include "objfiles.h"
+#include "obsd-tdep.h"
#include "osabi.h"
#include "regcache.h"
#include "regset.h"
+#include "solib-svr4.h"
+#include "sparc64-tdep.h"
#include "symtab.h"
-#include "objfiles.h"
#include "trad-frame.h"
-#include "obsd-tdep.h"
-#include "sparc64-tdep.h"
-#include "solib-svr4.h"
-#include "bsd-uthread.h"
-
/* Older OpenBSD versions used the traditional NetBSD core file
format, even for ports that use ELF. These core files don't use
multiple register sets. Instead, the general-purpose and
diff --git a/gdb/sparc64-sol2-tdep.c b/gdb/sparc64-sol2-tdep.c
index 829f2799915..17579b9b48c 100644
--- a/gdb/sparc64-sol2-tdep.c
+++ b/gdb/sparc64-sol2-tdep.c
@@ -18,18 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
+
+/* Local includes. */
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbarch.h"
-#include "symtab.h"
#include "objfiles.h"
#include "osabi.h"
-#include "trad-frame.h"
#include "regset.h"
-
#include "sol2-tdep.h"
-#include "sparc64-tdep.h"
#include "solib-svr4.h"
+#include "sparc64-tdep.h"
+#include "symtab.h"
+#include "trad-frame.h"
/* From <sys/regset.h>. */
const struct sparc_gregmap sparc64_sol2_gregmap =
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index 5b7d57a2163..e6607aaa9f2 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -18,24 +18,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "sparc64-tdep.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "dwarf2-frame.h"
-#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
#include "gdbtypes.h"
#include "inferior.h"
-#include "symtab.h"
#include "objfiles.h"
#include "osabi.h"
#include "regcache.h"
+#include "symtab.h"
#include "target-descriptions.h"
#include "target.h"
#include "value.h"
-#include "sparc64-tdep.h"
-
/* This file implements the SPARC 64-bit ABI as defined by the
section "Low-Level System Information" of the SPARC Compliance
Definition (SCD) 2.4.1, which is the 64-bit System V psABI for
diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c
index 90a9f002848..1b111d55aac 100644
--- a/gdb/spu-linux-nat.c
+++ b/gdb/spu-linux-nat.c
@@ -19,22 +19,26 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
-#include "target.h"
-#include "inferior.h"
-#include "inf-child.h"
-#include "inf-ptrace.h"
-#include "regcache.h"
-#include "symfile.h"
-#include "common/gdb_wait.h"
-#include "gdbthread.h"
-#include "gdb_bfd.h"
-#include "nat/gdb_ptrace.h"
+/* Standard C includes. */
#include <asm/ptrace.h>
#include <sys/types.h>
+/* Local subdirectory includes. */
+#include "common/gdb_wait.h"
+#include "nat/gdb_ptrace.h"
+
+/* Local includes. */
+#include "gdb_bfd.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "inf-child.h"
+#include "inf-ptrace.h"
+#include "inferior.h"
+#include "regcache.h"
#include "spu-tdep.h"
+#include "symfile.h"
+#include "target.h"
/* PPU side system calls. */
#define INSTR_SC 0x44000002
diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c
index 88ad291dbd6..f46c3391818 100644
--- a/gdb/spu-multiarch.c
+++ b/gdb/spu-multiarch.c
@@ -19,20 +19,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
+
+/* Local includes. */
#include "arch-utils.h"
-#include "observable.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
#include "inferior.h"
-#include "regcache.h"
-#include "symfile.h"
#include "objfiles.h"
+#include "observable.h"
+#include "ppc-linux-tdep.h"
+#include "ppc-tdep.h"
+#include "regcache.h"
#include "solib.h"
#include "solist.h"
-
-#include "ppc-tdep.h"
-#include "ppc-linux-tdep.h"
#include "spu-tdep.h"
+#include "symfile.h"
/* The SPU multi-architecture support target. */
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index c3f5d4e6a78..993cf3ee6a9 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -20,32 +20,36 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "spu-tdep.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "dwarf2.h"
+
+/* Local includes. */
#include "arch-utils.h"
-#include "gdbtypes.h"
+#include "ax.h"
+#include "block.h"
+#include "disasm.h"
+#include "dwarf2-frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcmd.h"
#include "gdbcore.h"
-#include "frame.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "trad-frame.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "value.h"
+#include "gdbtypes.h"
+#include "infcall.h"
#include "inferior.h"
-#include "dis-asm.h"
-#include "disasm.h"
-#include "objfiles.h"
#include "language.h"
+#include "location.h"
+#include "objfiles.h"
+#include "observable.h"
#include "regcache.h"
#include "reggroups.h"
-#include "block.h"
-#include "observable.h"
-#include "infcall.h"
-#include "dwarf2.h"
-#include "dwarf2-frame.h"
-#include "ax.h"
-#include "spu-tdep.h"
-#include "location.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "trad-frame.h"
+#include "value.h"
/* The list of available "set spu " and "show spu " commands. */
static struct cmd_list_element *setspucmdlist = NULL;
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 3f340dbf20d..d430c7c4988 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -25,28 +25,33 @@
this file. */
#include "defs.h"
+#include "stabsread.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
+#include "aout/aout64.h"
+#include "aout/stab_gnu.h"
#include "bfd.h"
-#include "gdb_obstack.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "aout/stab_gnu.h" /* We always use GNU stabs, not native. */
+#include "demangle.h"
#include "libaout.h"
-#include "aout/aout64.h"
-#include "gdb-stabs.h"
+
+/* Local includes. */
#include "buildsym-legacy.h"
#include "complaints.h"
-#include "demangle.h"
+#include "cp-abi.h"
+#include "cp-support.h"
+#include "expression.h"
#include "gdb-demangle.h"
+#include "gdb-stabs.h"
+#include "gdb_obstack.h"
+#include "gdbtypes.h"
#include "language.h"
+#include "objfiles.h"
+#include "symfile.h"
+#include "symtab.h"
#include "target-float.h"
-#include "cp-abi.h"
-#include "cp-support.h"
-#include <ctype.h>
-
-#include "stabsread.h"
/* See stabsread.h for these globals. */
unsigned int symnum;
diff --git a/gdb/stack.c b/gdb/stack.c
index bce8d58f543..7722824fd42 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -18,40 +18,45 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "value.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "language.h"
-#include "frame.h"
-#include "gdbcmd.h"
-#include "gdbcore.h"
-#include "target.h"
-#include "source.h"
-#include "breakpoint.h"
+#include "stack.h"
+
+/* Local non-gdb includes. */
#include "demangle.h"
-#include "inferior.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+#include "common/def-vector.h"
+
+/* Local includes. */
#include "annotate.h"
-#include "ui-out.h"
#include "block.h"
-#include "stack.h"
-#include "dictionary.h"
-#include "reggroups.h"
-#include "regcache.h"
-#include "solib.h"
-#include "valprint.h"
-#include "gdbthread.h"
+#include "breakpoint.h"
#include "cp-support.h"
+#include "dictionary.h"
#include "disasm.h"
+#include "expression.h"
+#include "extension.h"
+#include "frame.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "gdbtypes.h"
+#include "inferior.h"
#include "inline-frame.h"
+#include "language.h"
#include "linespec.h"
-#include "cli/cli-utils.h"
#include "objfiles.h"
-
-#include "symfile.h"
-#include "extension.h"
#include "observable.h"
-#include "common/def-vector.h"
+#include "regcache.h"
+#include "reggroups.h"
+#include "solib.h"
+#include "source.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
+#include "ui-out.h"
+#include "valprint.h"
+#include "value.h"
/* The possible choices of "set print frame-arguments", and the value
of this setting. */
diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c
index a53c04d94b1..7bc7e80910b 100644
--- a/gdb/stap-probe.c
+++ b/gdb/stap-probe.c
@@ -19,26 +19,33 @@
#include "defs.h"
#include "stap-probe.h"
-#include "probe.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Local non-gdb includes. */
+#include "elf-bfd.h"
+#include "filenames.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
#include "common/vec.h"
-#include "ui-out.h"
-#include "objfiles.h"
+
+/* Local includes. */
#include "arch-utils.h"
-#include "command.h"
-#include "gdbcmd.h"
-#include "filenames.h"
-#include "value.h"
-#include "ax.h"
#include "ax-gdb.h"
+#include "ax.h"
+#include "command.h"
#include "complaints.h"
-#include "cli/cli-utils.h"
+#include "gdbcmd.h"
+#include "language.h"
#include "linespec.h"
-#include "user-regs.h"
+#include "objfiles.h"
#include "parser-defs.h"
-#include "language.h"
-#include "elf-bfd.h"
-
-#include <ctype.h>
+#include "probe.h"
+#include "ui-out.h"
+#include "user-regs.h"
+#include "value.h"
/* The name of the SystemTap section where we will find information about
the probes. */
diff --git a/gdb/std-regs.c b/gdb/std-regs.c
index 26e6d0bf419..4dfad0dd909 100644
--- a/gdb/std-regs.c
+++ b/gdb/std-regs.c
@@ -20,10 +20,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "user-regs.h"
+
+/* Local includes. */
#include "frame.h"
#include "gdbtypes.h"
+#include "user-regs.h"
#include "value.h"
+
static struct value *
value_of_builtin_frame_fp_reg (struct frame_info *frame, const void *baton)
{
diff --git a/gdb/stubs/ChangeLog b/gdb/stubs/ChangeLog
index 3626f75c88e..662e90ffa69 100644
--- a/gdb/stubs/ChangeLog
+++ b/gdb/stubs/ChangeLog
@@ -1,3 +1,10 @@
+2019-03-30 Tom Tromey <tom@tromey.com>
+
+ * sparc-stub.c: Sort headers.
+ * sh-stub.c: Sort headers.
+ * m68k-stub.c: Sort headers.
+ * i386-stub.c: Sort headers.
+
2019-01-21 Tom Tromey <tom@tromey.com>
* ia64vms-stub.c: Fix includes.
diff --git a/gdb/stubs/i386-stub.c b/gdb/stubs/i386-stub.c
index 04996b75cf6..ffdf92c2ed0 100644
--- a/gdb/stubs/i386-stub.c
+++ b/gdb/stubs/i386-stub.c
@@ -89,6 +89,9 @@
*
****************************************************************************/
+#include "defs.h"
+
+/* Standard C includes. */
#include <stdio.h>
#include <string.h>
diff --git a/gdb/stubs/m68k-stub.c b/gdb/stubs/m68k-stub.c
index 4ef4069bc3d..e277afb343e 100644
--- a/gdb/stubs/m68k-stub.c
+++ b/gdb/stubs/m68k-stub.c
@@ -105,9 +105,12 @@
*
****************************************************************************/
+#include "defs.h"
+
+/* Standard C includes. */
+#include <setjmp.h>
#include <stdio.h>
#include <string.h>
-#include <setjmp.h>
/************************************************************************
*
diff --git a/gdb/stubs/sh-stub.c b/gdb/stubs/sh-stub.c
index 76c98a5e8ad..acead0302ea 100644
--- a/gdb/stubs/sh-stub.c
+++ b/gdb/stubs/sh-stub.c
@@ -144,8 +144,11 @@
So
"0* " means the same as "0000". */
-#include <string.h>
+#include "defs.h"
+
+/* Standard C includes. */
#include <setjmp.h>
+#include <string.h>
/* Renesas SH architecture instruction encoding masks */
diff --git a/gdb/stubs/sparc-stub.c b/gdb/stubs/sparc-stub.c
index c12d4360a4b..4c467db5fad 100644
--- a/gdb/stubs/sparc-stub.c
+++ b/gdb/stubs/sparc-stub.c
@@ -81,8 +81,11 @@
*
****************************************************************************/
-#include <string.h>
+#include "defs.h"
+
+/* Standard C includes. */
#include <signal.h>
+#include <string.h>
/************************************************************************
*
diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c
index 5b3ae926504..960716e7423 100644
--- a/gdb/symfile-debug.c
+++ b/gdb/symfile-debug.c
@@ -26,12 +26,14 @@
returns. */
#include "defs.h"
+
+/* Local includes. */
#include "gdbcmd.h"
#include "objfiles.h"
#include "observable.h"
#include "source.h"
-#include "symtab.h"
#include "symfile.h"
+#include "symtab.h"
/* We need to save a pointer to the real symbol functions.
Plus, the debug versions are malloc'd because we have to NULL out the
diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c
index 1029c012438..c4e3141adbb 100644
--- a/gdb/symfile-mem.c
+++ b/gdb/symfile-mem.c
@@ -42,17 +42,21 @@
#include "defs.h"
-#include "symtab.h"
+
+/* Local non-gdb includes. */
+#include "elf/common.h"
+
+/* Local includes. */
+#include "auxv.h"
+#include "gdb_bfd.h"
+#include "gdbcmd.h"
#include "gdbcore.h"
#include "objfiles.h"
-#include "gdbcmd.h"
+#include "observable.h"
+#include "symfile.h"
+#include "symtab.h"
#include "target.h"
#include "value.h"
-#include "symfile.h"
-#include "observable.h"
-#include "auxv.h"
-#include "elf/common.h"
-#include "gdb_bfd.h"
/* Verify parameters of target_read_memory_bfd and target_read_memory are
compatible. */
diff --git a/gdb/symfile.c b/gdb/symfile.c
index dbfc306c521..5b70cab0ad9 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -20,56 +20,64 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "bfdlink.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "gdbcore.h"
-#include "frame.h"
-#include "target.h"
-#include "value.h"
#include "symfile.h"
-#include "objfiles.h"
-#include "source.h"
-#include "gdbcmd.h"
-#include "breakpoint.h"
-#include "language.h"
-#include "complaints.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+#include <chrono>
+
+/* Local non-gdb includes. */
+#include "bfdlink.h"
#include "demangle.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "filenames.h" /* for DOSish file names */
-#include "gdb-stabs.h"
-#include "gdb_obstack.h"
-#include "completer.h"
-#include "bcache.h"
+#include "elf-bfd.h"
+#include "filenames.h"
#include "hashtab.h"
#include "readline/readline.h"
-#include "block.h"
-#include "observable.h"
-#include "exec.h"
-#include "parser-defs.h"
-#include "varobj.h"
-#include "elf-bfd.h"
-#include "solib.h"
-#include "remote.h"
-#include "stack.h"
-#include "gdb_bfd.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-style.h"
#include "cli/cli-utils.h"
#include "common/byte-vector.h"
+#include "common/forward-scope-exit.h"
#include "common/pathstuff.h"
#include "common/selftest.h"
-#include "cli/cli-style.h"
-#include "common/forward-scope-exit.h"
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <chrono>
-#include <algorithm>
+/* Local includes. */
+#include "arch-utils.h"
+#include "bcache.h"
+#include "block.h"
+#include "breakpoint.h"
+#include "complaints.h"
+#include "completer.h"
+#include "exec.h"
+#include "frame.h"
+#include "gdb-stabs.h"
+#include "gdb_bfd.h"
+#include "gdb_obstack.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "inferior.h"
+#include "language.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "parser-defs.h"
#include "psymtab.h"
+#include "regcache.h"
+#include "remote.h"
+#include "solib.h"
+#include "source.h"
+#include "stack.h"
+#include "symtab.h"
+#include "target.h"
+#include "value.h"
+#include "varobj.h"
int (*deprecated_ui_load_progress_hook) (const char *section,
unsigned long num);
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 0220b42749e..988d2afa60e 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -18,27 +18,32 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+
+/* Standard C includes. */
+#include <sys/stat.h>
+
+/* Local non-gdb includes. */
#include "bfd.h"
#include "filenames.h"
-#include "symfile.h"
-#include "objfiles.h"
+#include "readline/readline.h"
+
+/* Local includes. */
+#include "bcache.h"
+#include "block.h"
#include "breakpoint.h"
#include "command.h"
+#include "dictionary.h"
#include "gdb_obstack.h"
-#include "language.h"
-#include "bcache.h"
-#include "block.h"
#include "gdb_regex.h"
-#include <sys/stat.h>
-#include "dictionary.h"
-#include "typeprint.h"
#include "gdbcmd.h"
-#include "source.h"
-#include "readline/readline.h"
-
+#include "gdbtypes.h"
+#include "language.h"
+#include "objfiles.h"
#include "psymtab.h"
+#include "source.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "typeprint.h"
/* Unfortunately for debugging, stderr is usually a macro. This is painful
when calling functions that take FILE *'s from the debugger.
diff --git a/gdb/symtab.c b/gdb/symtab.c
index d25f560f084..363ce4a4e48 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -19,56 +19,63 @@
#include "defs.h"
#include "symtab.h"
-#include "gdbtypes.h"
-#include "gdbcore.h"
-#include "frame.h"
-#include "target.h"
-#include "value.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "gdbcmd.h"
-#include "gdb_regex.h"
-#include "expression.h"
-#include "language.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "demangle.h"
-#include "inferior.h"
-#include "source.h"
-#include "filenames.h" /* for FILENAME_CMP */
-#include "objc-lang.h"
-#include "d-lang.h"
-#include "ada-lang.h"
-#include "go-lang.h"
-#include "p-lang.h"
-#include "addrmap.h"
-#include "cli/cli-utils.h"
-#include "cli/cli-style.h"
+#include "filenames.h"
#include "fnmatch.h"
#include "hashtab.h"
-#include "typeprint.h"
-#include "gdb_obstack.h"
-#include "block.h"
-#include "dictionary.h"
+/* Local subdirectory includes. */
+#include "cli/cli-style.h"
+#include "cli/cli-utils.h"
+#include "common/gdb_optional.h"
+#include "common/pathstuff.h"
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <ctype.h>
+/* Local includes. */
+#include "ada-lang.h"
+#include "addrmap.h"
+#include "arch-utils.h"
+#include "block.h"
+#include "completer.h"
#include "cp-abi.h"
#include "cp-support.h"
-#include "observable.h"
-#include "solist.h"
-#include "macrotab.h"
+#include "d-lang.h"
+#include "dictionary.h"
+#include "expression.h"
+#include "filename-seen-cache.h"
+#include "frame.h"
+#include "gdb_obstack.h"
+#include "gdb_regex.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "go-lang.h"
+#include "inferior.h"
+#include "language.h"
#include "macroscope.h"
-
+#include "macrotab.h"
+#include "objc-lang.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "p-lang.h"
#include "parser-defs.h"
-#include "completer.h"
#include "progspace-and-thread.h"
-#include "common/gdb_optional.h"
-#include "filename-seen-cache.h"
-#include "arch-utils.h"
-#include <algorithm>
-#include "common/pathstuff.h"
+#include "solist.h"
+#include "source.h"
+#include "symfile.h"
+#include "target.h"
+#include "typeprint.h"
+#include "value.h"
/* Forward declarations for local functions. */
diff --git a/gdb/symtab.h b/gdb/symtab.h
index e4ee7271a15..5dbfa6d75a6 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -21,16 +21,20 @@
#define SYMTAB_H 1
#include <array>
-#include <vector>
#include <string>
-#include "common/gdb_vecs.h"
-#include "gdbtypes.h"
-#include "gdb_regex.h"
+#include <vector>
+
+/* Local subdirectory includes. */
#include "common/enum-flags.h"
#include "common/function-view.h"
#include "common/gdb_optional.h"
+#include "common/gdb_vecs.h"
#include "common/next-iterator.h"
+
+/* Local includes. */
#include "completer.h"
+#include "gdb_regex.h"
+#include "gdbtypes.h"
/* Opaque declarations. */
struct ui_file;
diff --git a/gdb/target-dcache.c b/gdb/target-dcache.c
index 3fab9845bc3..d444fd420de 100644
--- a/gdb/target-dcache.c
+++ b/gdb/target-dcache.c
@@ -17,6 +17,8 @@
#include "defs.h"
#include "target-dcache.h"
+
+/* Local includes. */
#include "gdbcmd.h"
#include "progspace.h"
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index 96d453527cd..8119a14d023 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -20,23 +20,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "target-descriptions.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "hashtab.h"
+#include "readline/tilde.h"
+
+/* Local subdirectory includes. */
+#include "common/vec.h"
+
+/* Local includes. */
#include "arch-utils.h"
+#include "completer.h"
+#include "gdb_obstack.h"
#include "gdbcmd.h"
#include "gdbtypes.h"
+#include "inferior.h"
+#include "osabi.h"
#include "reggroups.h"
#include "target.h"
-#include "target-descriptions.h"
-#include "common/vec.h"
#include "xml-support.h"
#include "xml-tdesc.h"
-#include "osabi.h"
-
-#include "gdb_obstack.h"
-#include "hashtab.h"
-#include "inferior.h"
-#include <algorithm>
-#include "completer.h"
-#include "readline/tilde.h" /* tilde_expand */
/* Types. */
diff --git a/gdb/target-float.c b/gdb/target-float.c
index 68c55f4dc7d..273dbaed0f0 100644
--- a/gdb/target-float.c
+++ b/gdb/target-float.c
@@ -18,10 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbtypes.h"
-#include "floatformat.h"
#include "target-float.h"
+/* Local non-gdb includes. */
+#include "floatformat.h"
+
+/* Local includes. */
+#include "gdbtypes.h"
+
/* Target floating-point operations.
diff --git a/gdb/target-memory.c b/gdb/target-memory.c
index d04363c2a56..8b7c9478958 100644
--- a/gdb/target-memory.c
+++ b/gdb/target-memory.c
@@ -19,13 +19,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/vec.h"
-#include "target.h"
-#include "memory-map.h"
-#include "common/gdb_sys_time.h"
+/* Standard C++ includes. */
#include <algorithm>
+/* Local subdirectory includes. */
+#include "common/gdb_sys_time.h"
+#include "common/vec.h"
+
+/* Local includes. */
+#include "memory-map.h"
+#include "target.h"
+
static bool
compare_block_starting_address (const memory_write_request &a_req,
const memory_write_request &b_req)
diff --git a/gdb/target.c b/gdb/target.c
index 6c05b6b83ef..34a77ac5cfe 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -21,34 +21,44 @@
#include "defs.h"
#include "target.h"
-#include "target-dcache.h"
+
+/* Standard C includes. */
+#include <signal.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+#include <unordered_map>
+
+/* Local non-gdb includes. */
+#include "bfd.h"
+#include "gdb/fileio.h"
+
+/* Local subdirectory includes. */
+#include "common/agent.h"
+#include "common/byte-vector.h"
+
+/* Local includes. */
+#include "auxv.h"
+#include "dcache.h"
+#include "event-top.h"
+#include "exec.h"
#include "gdbcmd.h"
-#include "symtab.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
#include "inferior.h"
#include "infrun.h"
-#include "bfd.h"
-#include "symfile.h"
+#include "inline-frame.h"
#include "objfiles.h"
-#include "dcache.h"
-#include <signal.h>
#include "regcache.h"
-#include "gdbcore.h"
-#include "target-descriptions.h"
-#include "gdbthread.h"
#include "solib.h"
-#include "exec.h"
-#include "inline-frame.h"
-#include "tracepoint.h"
-#include "gdb/fileio.h"
-#include "common/agent.h"
-#include "auxv.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target-dcache.h"
#include "target-debug.h"
-#include "top.h"
-#include "event-top.h"
-#include <algorithm>
-#include "common/byte-vector.h"
+#include "target-descriptions.h"
#include "terminal.h"
-#include <unordered_map>
+#include "top.h"
+#include "tracepoint.h"
static void generic_tls_error (void) ATTRIBUTE_NORETURN;
diff --git a/gdb/target/waitstatus.c b/gdb/target/waitstatus.c
index 4ac98e50f4f..23b322f7510 100644
--- a/gdb/target/waitstatus.c
+++ b/gdb/target/waitstatus.c
@@ -18,7 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "common/common-defs.h"
-#include "waitstatus.h"
+#include "target/waitstatus.h"
/* Return a pretty printed form of target_waitstatus.
Space for the result is malloc'd, caller must free. */
diff --git a/gdb/thread-fsm.h b/gdb/thread-fsm.h
index 57837bfdfb1..127930f2dc2 100644
--- a/gdb/thread-fsm.h
+++ b/gdb/thread-fsm.h
@@ -19,7 +19,7 @@
#ifndef THREAD_FSM_H
#define THREAD_FSM_H
-#include "mi/mi-common.h" /* For enum async_reply_reason. */
+#include "mi/mi-common.h"
struct return_value_info;
struct thread_fsm_ops;
diff --git a/gdb/thread-iter.c b/gdb/thread-iter.c
index 9a41a46aa66..bd1a66d3cc4 100644
--- a/gdb/thread-iter.c
+++ b/gdb/thread-iter.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "gdbthread.h"
#include "inferior.h"
diff --git a/gdb/thread.c b/gdb/thread.c
index 91741c76f0d..1c68f260aae 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -20,32 +20,39 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "frame.h"
-#include "inferior.h"
-#include "common/environ.h"
-#include "value.h"
-#include "target.h"
-#include "gdbthread.h"
-#include "command.h"
-#include "gdbcmd.h"
-#include "regcache.h"
-#include "btrace.h"
+/* Standard C includes. */
#include <ctype.h>
-#include <sys/types.h>
#include <signal.h>
-#include "ui-out.h"
-#include "observable.h"
-#include "annotate.h"
+#include <sys/types.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local subdirectory includes. */
#include "cli/cli-decode.h"
-#include "gdb_regex.h"
#include "cli/cli-utils.h"
-#include "thread-fsm.h"
-#include "tid-parse.h"
-#include <algorithm>
+#include "common/environ.h"
#include "common/gdb_optional.h"
+
+/* Local includes. */
+#include "annotate.h"
+#include "btrace.h"
+#include "command.h"
+#include "frame.h"
+#include "gdb_regex.h"
+#include "gdbcmd.h"
+#include "gdbthread.h"
+#include "inferior.h"
#include "inline-frame.h"
+#include "observable.h"
+#include "regcache.h"
+#include "symtab.h"
+#include "target.h"
+#include "thread-fsm.h"
+#include "tid-parse.h"
+#include "ui-out.h"
+#include "value.h"
/* Definition of struct thread_info exported to gdbthread.h. */
diff --git a/gdb/tic6x-linux-tdep.c b/gdb/tic6x-linux-tdep.c
index 2b8bc93fd1d..6db5041a7e5 100644
--- a/gdb/tic6x-linux-tdep.c
+++ b/gdb/tic6x-linux-tdep.c
@@ -18,14 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "solib.h"
-#include "osabi.h"
+
+/* Local non-gdb includes. */
+#include "elf-bfd.h"
+#include "elf/tic6x.h"
+
+/* Local includes. */
#include "linux-tdep.h"
+#include "osabi.h"
+#include "solib.h"
#include "tic6x-tdep.h"
#include "trad-frame.h"
#include "tramp-frame.h"
-#include "elf-bfd.h"
-#include "elf/tic6x.h"
/* The offset from rt_sigframe pointer to SP register. */
#define TIC6X_SP_RT_SIGFRAME 8
diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c
index 61dc676de3b..d81012a449a 100644
--- a/gdb/tic6x-tdep.c
+++ b/gdb/tic6x-tdep.c
@@ -20,34 +20,40 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "frame-unwind.h"
-#include "frame-base.h"
-#include "trad-frame.h"
-#include "dwarf2-frame.h"
-#include "symtab.h"
-#include "inferior.h"
-#include "gdbtypes.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
-#include "target.h"
+#include "tic6x-tdep.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "dis-asm.h"
-#include "regcache.h"
-#include "value.h"
-#include "symfile.h"
+
+/* Local includes. */
#include "arch-utils.h"
+#include "dwarf2-frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "frame.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
#include "glibc-tdep.h"
#include "infcall.h"
-#include "regset.h"
-#include "tramp-frame.h"
+#include "inferior.h"
+#include "language.h"
#include "linux-tdep.h"
-#include "solib.h"
#include "objfiles.h"
#include "osabi.h"
-#include "tic6x-tdep.h"
-#include "language.h"
+#include "regcache.h"
+#include "regset.h"
+#include "solib.h"
+#include "symfile.h"
+#include "symtab.h"
#include "target-descriptions.h"
-#include <algorithm>
+#include "target.h"
+#include "trad-frame.h"
+#include "tramp-frame.h"
+#include "value.h"
#define TIC6X_OPCODE_SIZE 4
#define TIC6X_FETCH_PACKET_SIZE 32
diff --git a/gdb/tid-parse.c b/gdb/tid-parse.c
index 828362ea94b..34371f03388 100644
--- a/gdb/tid-parse.c
+++ b/gdb/tid-parse.c
@@ -19,10 +19,14 @@
#include "defs.h"
#include "tid-parse.h"
-#include "inferior.h"
-#include "gdbthread.h"
+
+/* Standard C includes. */
#include <ctype.h>
+/* Local includes. */
+#include "gdbthread.h"
+#include "inferior.h"
+
/* See tid-parse.h. */
void ATTRIBUTE_NORETURN
diff --git a/gdb/tilegx-linux-nat.c b/gdb/tilegx-linux-nat.c
index 9ddf74b7b16..40ba1e1a633 100644
--- a/gdb/tilegx-linux-nat.c
+++ b/gdb/tilegx-linux-nat.c
@@ -18,15 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "linux-nat.h"
-#include "inf-ptrace.h"
+/* Standard C includes. */
+#include <sys/procfs.h>
+
+/* Local subdirectory includes. */
#include "nat/gdb_ptrace.h"
-#include <sys/procfs.h>
+/* Local includes. */
+#include "gdbcore.h"
+#include "inf-ptrace.h"
+#include "inferior.h"
+#include "linux-nat.h"
+#include "regcache.h"
/* Defines ps_err_e, struct ps_prochandle. */
#include "gdb_proc_service.h"
diff --git a/gdb/tilegx-linux-tdep.c b/gdb/tilegx-linux-tdep.c
index 5f02199da29..5bec3ee76e5 100644
--- a/gdb/tilegx-linux-tdep.c
+++ b/gdb/tilegx-linux-tdep.c
@@ -18,16 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "osabi.h"
-#include "linux-tdep.h"
+
+/* Local includes. */
#include "glibc-tdep.h"
-#include "solib-svr4.h"
-#include "symtab.h"
+#include "linux-tdep.h"
+#include "osabi.h"
#include "regcache.h"
#include "regset.h"
-#include "tramp-frame.h"
-#include "trad-frame.h"
+#include "solib-svr4.h"
+#include "symtab.h"
#include "tilegx-tdep.h"
+#include "trad-frame.h"
+#include "tramp-frame.h"
/* Signal trampoline support. */
diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c
index 3b1954fe419..2cffc082c3e 100644
--- a/gdb/tilegx-tdep.c
+++ b/gdb/tilegx-tdep.c
@@ -18,29 +18,37 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
+#include "tilegx-tdep.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "opcode/tilegx.h"
+
+/* Local subdirectory includes. */
+#include "common/byte-vector.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "dwarf2-frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
-#include "dwarf2-frame.h"
-#include "trad-frame.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+#include "frame.h"
#include "gdbcmd.h"
#include "gdbcore.h"
-#include "value.h"
-#include "dis-asm.h"
+#include "gdbtypes.h"
#include "inferior.h"
-#include "arch-utils.h"
-#include "regcache.h"
-#include "regset.h"
-#include "osabi.h"
#include "linux-tdep.h"
#include "objfiles.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
#include "solib-svr4.h"
-#include "tilegx-tdep.h"
-#include "opcode/tilegx.h"
-#include <algorithm>
-#include "common/byte-vector.h"
+#include "symtab.h"
+#include "trad-frame.h"
+#include "value.h"
struct tilegx_frame_cache
{
diff --git a/gdb/top.c b/gdb/top.c
index afb77c0ec95..bd32b3e59f3 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -18,41 +18,49 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcmd.h"
+#include "top.h"
+
+/* Standard C includes. */
+#include <signal.h>
+
+/* Local non-gdb includes. */
+#include "filenames.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-cmds.h"
+#include "cli/cli-decode.h"
#include "cli/cli-script.h"
#include "cli/cli-setshow.h"
-#include "cli/cli-decode.h"
-#include "symtab.h"
-#include "inferior.h"
-#include "infrun.h"
-#include <signal.h>
-#include "target.h"
-#include "target-dcache.h"
-#include "breakpoint.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "value.h"
-#include "language.h"
-#include "terminal.h" /* For job_control. */
+#include "common/buffer.h"
#include "common/job-control.h"
+#include "common/scope-exit.h"
+#include "common/version.h"
+
+/* Local includes. */
#include "annotate.h"
+#include "breakpoint.h"
#include "completer.h"
-#include "top.h"
-#include "common/version.h"
-#include "serial.h"
-#include "main.h"
#include "event-loop.h"
-#include "gdbthread.h"
+#include "expression.h"
#include "extension.h"
-#include "interps.h"
-#include "observable.h"
-#include "maint.h"
-#include "filenames.h"
#include "frame.h"
-#include "common/buffer.h"
#include "gdb_select.h"
-#include "common/scope-exit.h"
+#include "gdbcmd.h"
+#include "gdbthread.h"
+#include "gdbtypes.h"
+#include "inferior.h"
+#include "infrun.h"
+#include "interps.h"
+#include "language.h"
+#include "main.h"
+#include "maint.h"
+#include "observable.h"
+#include "serial.h"
+#include "symtab.h"
+#include "target-dcache.h"
+#include "target.h"
+#include "terminal.h"
+#include "value.h"
/* readline include files. */
#include "readline/readline.h"
diff --git a/gdb/top.h b/gdb/top.h
index 025d9389d60..42fb9586a8f 100644
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -21,6 +21,8 @@
#define TOP_H
#include "common/buffer.h"
+
+/* Local includes. */
#include "event-loop.h"
#include "value.h"
diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c
index 020a6be69b5..5f29bfbffc6 100644
--- a/gdb/tracefile-tfile.c
+++ b/gdb/tracefile-tfile.c
@@ -18,21 +18,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "tracefile.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "filenames.h"
#include "readline/tilde.h"
+
+/* Local subdirectory includes. */
+#include "common/buffer.h"
#include "common/filestuff.h"
-#include "common/rsp-low.h" /* bin2hex */
-#include "regcache.h"
-#include "inferior.h"
-#include "gdbthread.h"
-#include "exec.h" /* exec_bfd */
+#include "common/rsp-low.h"
+
+/* Local includes. */
#include "completer.h"
-#include "filenames.h"
+#include "exec.h"
+#include "gdbthread.h"
+#include "inferior.h"
+#include "regcache.h"
#include "remote.h"
-#include "xml-tdesc.h"
#include "target-descriptions.h"
-#include "common/buffer.h"
-#include <algorithm>
+#include "tracefile.h"
+#include "xml-tdesc.h"
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
diff --git a/gdb/tracefile.c b/gdb/tracefile.c
index bf886e06521..45499ee3ed5 100644
--- a/gdb/tracefile.c
+++ b/gdb/tracefile.c
@@ -19,10 +19,14 @@
#include "defs.h"
#include "tracefile.h"
+
+/* Local subdirectory includes. */
+#include "common/byte-vector.h"
+
+/* Local includes. */
#include "ctf.h"
#include "exec.h"
#include "regcache.h"
-#include "common/byte-vector.h"
/* Helper macros. */
diff --git a/gdb/tracefile.h b/gdb/tracefile.h
index 8f9dc0e06d7..a5aebbda91f 100644
--- a/gdb/tracefile.h
+++ b/gdb/tracefile.h
@@ -1,9 +1,9 @@
#ifndef TRACEFILE_H
#define TRACEFILE_H 1
-#include "tracepoint.h"
-#include "target.h"
#include "process-stratum-target.h"
+#include "target.h"
+#include "tracepoint.h"
struct trace_file_writer;
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index c7585c67839..081e341c1a7 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -18,45 +18,53 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "tracepoint.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "filenames.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-utils.h"
+#include "common/filestuff.h"
+#include "common/rsp-low.h"
+
+/* Local includes. */
#include "arch-utils.h"
-#include "symtab.h"
-#include "frame.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "gdbcmd.h"
-#include "value.h"
-#include "target.h"
-#include "target-dcache.h"
-#include "language.h"
-#include "inferior.h"
+#include "ax-gdb.h"
+#include "ax.h"
+#include "block.h"
#include "breakpoint.h"
-#include "tracepoint.h"
-#include "linespec.h"
-#include "regcache.h"
#include "completer.h"
-#include "block.h"
+#include "ctf.h"
#include "dictionary.h"
-#include "observable.h"
-#include "user-regs.h"
-#include "valprint.h"
+#include "expression.h"
+#include "frame.h"
+#include "gdbcmd.h"
#include "gdbcore.h"
-#include "objfiles.h"
-#include "filenames.h"
#include "gdbthread.h"
-#include "stack.h"
-#include "remote.h"
-#include "source.h"
-#include "ax.h"
-#include "ax-gdb.h"
+#include "gdbtypes.h"
+#include "inferior.h"
+#include "language.h"
+#include "linespec.h"
+#include "location.h"
#include "memrange.h"
-#include "cli/cli-utils.h"
+#include "objfiles.h"
+#include "observable.h"
#include "probe.h"
-#include "ctf.h"
-#include "common/filestuff.h"
-#include "common/rsp-low.h"
+#include "regcache.h"
+#include "remote.h"
+#include "source.h"
+#include "stack.h"
+#include "symtab.h"
+#include "target-dcache.h"
+#include "target.h"
#include "tracefile.h"
-#include "location.h"
-#include <algorithm>
+#include "user-regs.h"
+#include "valprint.h"
+#include "value.h"
/* readline include files */
#include "readline/readline.h"
diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h
index ca9d2a77943..dadb7367282 100644
--- a/gdb/tracepoint.h
+++ b/gdb/tracepoint.h
@@ -19,12 +19,15 @@
#if !defined (TRACEPOINT_H)
#define TRACEPOINT_H 1
-#include "breakpoint.h"
-#include "memrange.h"
+#include <string>
+#include <vector>
+
+/* Local subdirectory includes. */
#include "common/gdb_vecs.h"
-#include <vector>
-#include <string>
+/* Local includes. */
+#include "breakpoint.h"
+#include "memrange.h"
/* An object describing the contents of a traceframe. */
diff --git a/gdb/trad-frame.c b/gdb/trad-frame.c
index 3cb295309c5..cb033f41d24 100644
--- a/gdb/trad-frame.c
+++ b/gdb/trad-frame.c
@@ -18,10 +18,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
#include "trad-frame.h"
-#include "regcache.h"
+
+/* Local includes. */
#include "frame-unwind.h"
+#include "frame.h"
+#include "regcache.h"
#include "target.h"
#include "value.h"
diff --git a/gdb/trad-frame.h b/gdb/trad-frame.h
index dd80d1b83c4..4ecd0eba4a3 100644
--- a/gdb/trad-frame.h
+++ b/gdb/trad-frame.h
@@ -20,7 +20,7 @@
#ifndef TRAD_FRAME_H
#define TRAD_FRAME_H
-#include "frame.h" /* For "struct frame_id". */
+#include "frame.h"
struct frame_info;
struct regcache_map_entry;
diff --git a/gdb/tramp-frame.c b/gdb/tramp-frame.c
index f6a97635651..13076989f64 100644
--- a/gdb/tramp-frame.c
+++ b/gdb/tramp-frame.c
@@ -19,13 +19,15 @@
#include "defs.h"
#include "tramp-frame.h"
+
+/* Local includes. */
+#include "frame-base.h"
#include "frame-unwind.h"
#include "gdbcore.h"
-#include "symtab.h"
#include "objfiles.h"
+#include "symtab.h"
#include "target.h"
#include "trad-frame.h"
-#include "frame-base.h"
struct frame_data
{
diff --git a/gdb/tramp-frame.h b/gdb/tramp-frame.h
index 254c7a911a0..f739b4276b9 100644
--- a/gdb/tramp-frame.h
+++ b/gdb/tramp-frame.h
@@ -20,7 +20,7 @@
#ifndef TRAMP_FRAME_H
#define TRAMP_FRAME_H
-#include "frame.h" /* For "enum frame_type". */
+#include "frame.h"
struct trad_frame;
struct frame_info;
diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c
index 76fe9dad814..14d592aa3f4 100644
--- a/gdb/tui/tui-command.c
+++ b/gdb/tui/tui-command.c
@@ -20,13 +20,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "tui/tui.h"
+#include "tui/tui-command.h"
+
+/* Local subdirectory includes. */
#include "tui/tui-data.h"
-#include "tui/tui-win.h"
#include "tui/tui-io.h"
-#include "tui/tui-command.h"
+#include "tui/tui-win.h"
+#include "tui/tui.h"
+/* Local includes. */
#include "gdb_curses.h"
+
/*****************************************
** STATIC LOCAL FUNCTIONS FORWARD DECLS **
******************************************/
diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c
index d5f7c733353..59793af9821 100644
--- a/gdb/tui/tui-data.c
+++ b/gdb/tui/tui-data.c
@@ -20,11 +20,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "tui/tui.h"
#include "tui/tui-data.h"
+
+/* Local subdirectory includes. */
#include "tui/tui-wingeneral.h"
+#include "tui/tui.h"
+
+/* Local includes. */
#include "gdb_curses.h"
+#include "symtab.h"
/****************************
** GLOBAL DECLARATIONS
diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index acefb23bb6d..9f2cf74b8aa 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -22,8 +22,10 @@
#ifndef TUI_TUI_DATA_H
#define TUI_TUI_DATA_H
-#include "tui/tui.h" /* For enum tui_win_type. */
-#include "gdb_curses.h" /* For WINDOW. */
+#include "tui/tui.h"
+
+/* Local includes. */
+#include "gdb_curses.h"
/* This is a point definition. */
struct tui_point
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index 003462c2244..c639c632966 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -20,25 +20,28 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "symtab.h"
-#include "breakpoint.h"
-#include "frame.h"
-#include "value.h"
-#include "source.h"
-#include "disasm.h"
-#include "tui/tui.h"
+#include "tui/tui-disasm.h"
+
+/* Local subdirectory includes. */
#include "tui/tui-data.h"
-#include "tui/tui-win.h"
+#include "tui/tui-file.h"
#include "tui/tui-layout.h"
-#include "tui/tui-winsource.h"
#include "tui/tui-stack.h"
-#include "tui/tui-file.h"
-#include "tui/tui-disasm.h"
-#include "progspace.h"
-#include "objfiles.h"
+#include "tui/tui-win.h"
+#include "tui/tui-winsource.h"
+#include "tui/tui.h"
+/* Local includes. */
+#include "arch-utils.h"
+#include "breakpoint.h"
+#include "disasm.h"
+#include "frame.h"
#include "gdb_curses.h"
+#include "objfiles.h"
+#include "progspace.h"
+#include "source.h"
+#include "symtab.h"
+#include "value.h"
struct tui_asm_line
{
diff --git a/gdb/tui/tui-disasm.h b/gdb/tui/tui-disasm.h
index b7325917435..062ac9023ae 100644
--- a/gdb/tui/tui-disasm.h
+++ b/gdb/tui/tui-disasm.h
@@ -22,8 +22,8 @@
#ifndef TUI_TUI_DISASM_H
#define TUI_TUI_DISASM_H
-#include "tui/tui.h" /* For enum tui_status. */
-#include "tui/tui-data.h" /* For enum tui_scroll_direction. */
+#include "tui/tui-data.h"
+#include "tui/tui.h"
extern enum tui_status tui_set_disassem_content (struct gdbarch *, CORE_ADDR);
extern void tui_show_disassem (struct gdbarch *, CORE_ADDR);
diff --git a/gdb/tui/tui-file.c b/gdb/tui/tui-file.c
index 679a41759aa..2699c402cb5 100644
--- a/gdb/tui/tui-file.c
+++ b/gdb/tui/tui-file.c
@@ -18,10 +18,14 @@
#include "defs.h"
#include "tui/tui-file.h"
-#include "tui/tui-io.h"
-#include "tui/tui-command.h"
+
+/* Local non-gdb includes. */
#include "tui.h"
+/* Local subdirectory includes. */
+#include "tui/tui-command.h"
+#include "tui/tui-io.h"
+
tui_file::tui_file (FILE *stream)
: stdio_file (stream)
{}
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index 4a1d79e0ad0..ca5c7615c2a 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -18,37 +18,43 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "inferior.h"
-#include "command.h"
-#include "bfd.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "event-loop.h"
-#include "event-top.h"
-#include "frame.h"
-#include "breakpoint.h"
-#include "ui-out.h"
-#include "top.h"
-#include "observable.h"
-#include "source.h"
-#include <unistd.h>
+#include "tui/tui-hooks.h"
+
+/* Standard C includes. */
#include <fcntl.h>
+#include <unistd.h>
-#include "tui/tui.h"
-#include "tui/tui-hooks.h"
+/* Local non-gdb includes. */
+#include "bfd.h"
+
+/* Local subdirectory includes. */
#include "tui/tui-data.h"
-#include "tui/tui-layout.h"
#include "tui/tui-io.h"
+#include "tui/tui-layout.h"
#include "tui/tui-regs.h"
-#include "tui/tui-win.h"
#include "tui/tui-stack.h"
+#include "tui/tui-win.h"
#include "tui/tui-windata.h"
#include "tui/tui-winsource.h"
+#include "tui/tui.h"
+/* Local includes. */
+#include "breakpoint.h"
+#include "command.h"
+#include "event-loop.h"
+#include "event-top.h"
+#include "frame.h"
#include "gdb_curses.h"
+#include "gdbcore.h"
+#include "inferior.h"
+#include "objfiles.h"
+#include "observable.h"
+#include "source.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "target.h"
+#include "top.h"
+#include "ui-out.h"
/* This redefines CTRL if it is not already defined, so it must come
after terminal state releated include files like <term.h> and
diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c
index 14215b83dea..b17daed6f40 100644
--- a/gdb/tui/tui-interp.c
+++ b/gdb/tui/tui-interp.c
@@ -18,22 +18,28 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local non-gdb includes. */
+#include "readline/readline.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-interp.h"
-#include "interps.h"
-#include "top.h"
-#include "event-top.h"
-#include "event-loop.h"
-#include "ui-out.h"
-#include "cli-out.h"
#include "tui/tui-data.h"
-#include "readline/readline.h"
+#include "tui/tui-io.h"
#include "tui/tui-win.h"
#include "tui/tui.h"
-#include "tui/tui-io.h"
-#include "infrun.h"
-#include "observable.h"
+
+/* Local includes. */
+#include "cli-out.h"
+#include "event-loop.h"
+#include "event-top.h"
#include "gdbthread.h"
#include "inferior.h"
+#include "infrun.h"
+#include "interps.h"
+#include "observable.h"
+#include "top.h"
+#include "ui-out.h"
/* Set to 1 when the TUI mode must be activated when we first start
gdb. */
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index ad47c8205f3..e0c8d6c34bd 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -20,23 +20,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
-#include "event-loop.h"
-#include "event-top.h"
-#include "command.h"
-#include "top.h"
-#include "tui/tui.h"
-#include "tui/tui-data.h"
#include "tui/tui-io.h"
+
+/* Standard C includes. */
+#include <fcntl.h>
+#include <signal.h>
+
+/* Local subdirectory includes. */
#include "tui/tui-command.h"
-#include "tui/tui-win.h"
-#include "tui/tui-wingeneral.h"
+#include "tui/tui-data.h"
#include "tui/tui-file.h"
#include "tui/tui-out.h"
-#include "ui-out.h"
+#include "tui/tui-win.h"
+#include "tui/tui-wingeneral.h"
+#include "tui/tui.h"
+
+/* Local includes. */
#include "cli-out.h"
-#include <fcntl.h>
-#include <signal.h>
+#include "command.h"
+#include "event-loop.h"
+#include "event-top.h"
+#include "target.h"
+#include "top.h"
+#include "ui-out.h"
+
#ifdef __MINGW32__
#include <windows.h>
#endif
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index f4e926e7061..cd9d71cd702 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -20,24 +20,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "command.h"
-#include "symtab.h"
-#include "frame.h"
-#include "source.h"
+#include "tui/tui-layout.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "tui/tui.h"
+/* Local subdirectory includes. */
#include "tui/tui-data.h"
-#include "tui/tui-windata.h"
-#include "tui/tui-wingeneral.h"
-#include "tui/tui-stack.h"
+#include "tui/tui-disasm.h"
#include "tui/tui-regs.h"
+#include "tui/tui-stack.h"
#include "tui/tui-win.h"
+#include "tui/tui-windata.h"
+#include "tui/tui-wingeneral.h"
#include "tui/tui-winsource.h"
-#include "tui/tui-disasm.h"
-#include "tui/tui-layout.h"
+#include "tui/tui.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "command.h"
+#include "frame.h"
#include "gdb_curses.h"
+#include "source.h"
+#include "symtab.h"
/*******************************
** Static Local Decls
diff --git a/gdb/tui/tui-layout.h b/gdb/tui/tui-layout.h
index bc21d2999e4..c7308a4d426 100644
--- a/gdb/tui/tui-layout.h
+++ b/gdb/tui/tui-layout.h
@@ -22,8 +22,8 @@
#ifndef TUI_TUI_LAYOUT_H
#define TUI_TUI_LAYOUT_H
-#include "tui/tui.h"
#include "tui/tui-data.h"
+#include "tui/tui.h"
extern void tui_add_win_to_layout (enum tui_win_type);
extern int tui_default_win_height (enum tui_win_type,
diff --git a/gdb/tui/tui-out.c b/gdb/tui/tui-out.c
index 5fabff2cf1c..263b1317d80 100644
--- a/gdb/tui/tui-out.c
+++ b/gdb/tui/tui-out.c
@@ -21,10 +21,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "ui-out.h"
-#include "tui-out.h"
+#include "tui/tui-out.h"
+
+/* Local non-gdb includes. */
#include "tui.h"
+/* Local includes. */
+#include "ui-out.h"
+
/* Output an int field. */
void
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 91b40f5d072..083726c9dfa 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -20,28 +20,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "tui/tui.h"
+#include "tui/tui-regs.h"
+
+/* Local subdirectory includes. */
#include "tui/tui-data.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "gdbcmd.h"
-#include "frame.h"
-#include "regcache.h"
-#include "inferior.h"
-#include "target.h"
+#include "tui/tui-file.h"
+#include "tui/tui-io.h"
#include "tui/tui-layout.h"
#include "tui/tui-win.h"
#include "tui/tui-windata.h"
#include "tui/tui-wingeneral.h"
-#include "tui/tui-file.h"
-#include "tui/tui-regs.h"
-#include "tui/tui-io.h"
-#include "reggroups.h"
-#include "valprint.h"
-#include "completer.h"
+#include "tui/tui.h"
+/* Local includes. */
+#include "arch-utils.h"
+#include "completer.h"
+#include "frame.h"
#include "gdb_curses.h"
+#include "gdbcmd.h"
+#include "gdbtypes.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "reggroups.h"
+#include "symtab.h"
+#include "target.h"
+#include "valprint.h"
/*****************************************
diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h
index 54b1b0870f7..326d6049f9d 100644
--- a/gdb/tui/tui-regs.h
+++ b/gdb/tui/tui-regs.h
@@ -22,7 +22,7 @@
#ifndef TUI_TUI_REGS_H
#define TUI_TUI_REGS_H
-#include "tui/tui-data.h" /* For struct tui_register_display_type. */
+#include "tui/tui-data.h"
extern void tui_check_register_values (struct frame_info *);
extern void tui_show_registers (struct reggroup *group);
diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index 1fa0e986e03..ac2499ebe0a 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -20,22 +20,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "tui/tui-source.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "symtab.h"
-#include "frame.h"
-#include "breakpoint.h"
-#include "source.h"
-#include "objfiles.h"
+
+/* Local non-gdb includes. */
#include "filenames.h"
-#include "source-cache.h"
-#include "tui/tui.h"
+/* Local subdirectory includes. */
#include "tui/tui-data.h"
#include "tui/tui-io.h"
#include "tui/tui-stack.h"
#include "tui/tui-winsource.h"
-#include "tui/tui-source.h"
+#include "tui/tui.h"
+
+/* Local includes. */
+#include "breakpoint.h"
+#include "frame.h"
#include "gdb_curses.h"
+#include "objfiles.h"
+#include "source-cache.h"
+#include "source.h"
+#include "symtab.h"
/* A helper function for tui_set_source_content that extracts some
source text from PTR. LINE_NO is the line number; FIRST_COL is the
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c
index b85b7a5d437..1b9f7268ffa 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-stack.c
@@ -20,24 +20,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "breakpoint.h"
-#include "frame.h"
-#include "command.h"
-#include "inferior.h"
-#include "target.h"
-#include "top.h"
-#include "gdb-demangle.h"
-#include "source.h"
-#include "tui/tui.h"
-#include "tui/tui-data.h"
#include "tui/tui-stack.h"
-#include "tui/tui-wingeneral.h"
+
+/* Local subdirectory includes. */
+#include "tui/tui-data.h"
+#include "tui/tui-file.h"
#include "tui/tui-source.h"
+#include "tui/tui-wingeneral.h"
#include "tui/tui-winsource.h"
-#include "tui/tui-file.h"
+#include "tui/tui.h"
+/* Local includes. */
+#include "breakpoint.h"
+#include "command.h"
+#include "frame.h"
+#include "gdb-demangle.h"
#include "gdb_curses.h"
+#include "inferior.h"
+#include "source.h"
+#include "symtab.h"
+#include "target.h"
+#include "top.h"
/* Get a printable name for the function at the address.
The symbol name is demangled if demangling is turned on.
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index a24f25928e2..2cee76da6db 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -25,32 +25,37 @@
Author: Susan B. Macchia */
#include "defs.h"
-#include "command.h"
-#include "symtab.h"
-#include "breakpoint.h"
-#include "frame.h"
-#include "cli/cli-cmds.h"
-#include "top.h"
-#include "source.h"
-#include "event-loop.h"
+#include "tui/tui-win.h"
-#include "tui/tui.h"
-#include "tui/tui-io.h"
+/* Standard C includes. */
+#include <ctype.h>
+#include <signal.h>
+
+/* Local non-gdb includes. */
+#include "readline/readline.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-cmds.h"
#include "tui/tui-data.h"
-#include "tui/tui-wingeneral.h"
-#include "tui/tui-stack.h"
-#include "tui/tui-regs.h"
#include "tui/tui-disasm.h"
+#include "tui/tui-io.h"
+#include "tui/tui-regs.h"
#include "tui/tui-source.h"
-#include "tui/tui-winsource.h"
+#include "tui/tui-stack.h"
#include "tui/tui-windata.h"
-#include "tui/tui-win.h"
+#include "tui/tui-wingeneral.h"
+#include "tui/tui-winsource.h"
+#include "tui/tui.h"
+/* Local includes. */
+#include "breakpoint.h"
+#include "command.h"
+#include "event-loop.h"
+#include "frame.h"
#include "gdb_curses.h"
-#include <ctype.h>
-#include "readline/readline.h"
-
-#include <signal.h>
+#include "source.h"
+#include "symtab.h"
+#include "top.h"
/*******************************
** Static Local Decls
diff --git a/gdb/tui/tui-windata.c b/gdb/tui/tui-windata.c
index 1bab39f9975..dc910683745 100644
--- a/gdb/tui/tui-windata.c
+++ b/gdb/tui/tui-windata.c
@@ -20,11 +20,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "tui/tui.h"
+#include "tui/tui-windata.h"
+
+/* Local subdirectory includes. */
#include "tui/tui-data.h"
-#include "tui/tui-wingeneral.h"
#include "tui/tui-regs.h"
-#include "tui/tui-windata.h"
+#include "tui/tui-wingeneral.h"
+#include "tui/tui.h"
+
+/* Local includes. */
#include "gdb_curses.h"
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index b1ed0f4378d..5871a477e69 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -20,11 +20,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "tui/tui.h"
-#include "tui/tui-data.h"
#include "tui/tui-wingeneral.h"
+
+/* Local subdirectory includes. */
+#include "tui/tui-data.h"
#include "tui/tui-win.h"
+#include "tui/tui.h"
+/* Local includes. */
#include "gdb_curses.h"
/***********************
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index e31a0164cf2..9ff7716d68b 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -20,25 +20,32 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "tui/tui-winsource.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "symtab.h"
-#include "frame.h"
-#include "breakpoint.h"
-#include "value.h"
-#include "source.h"
-#include "objfiles.h"
+
+/* Local non-gdb includes. */
#include "filenames.h"
-#include "tui/tui.h"
+/* Local subdirectory includes. */
#include "tui/tui-data.h"
+#include "tui/tui-disasm.h"
#include "tui/tui-io.h"
+#include "tui/tui-source.h"
#include "tui/tui-stack.h"
#include "tui/tui-win.h"
#include "tui/tui-wingeneral.h"
-#include "tui/tui-winsource.h"
-#include "tui/tui-source.h"
-#include "tui/tui-disasm.h"
+#include "tui/tui.h"
+
+/* Local includes. */
+#include "breakpoint.h"
+#include "frame.h"
#include "gdb_curses.h"
+#include "objfiles.h"
+#include "source.h"
+#include "symtab.h"
+#include "value.h"
/* Function to display the "main" routine. */
void
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 4c9963291dc..9e083818b0e 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -20,29 +20,35 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcmd.h"
#include "tui/tui.h"
-#include "tui/tui-hooks.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+#include <fcntl.h>
+#include <signal.h>
+
+/* Local subdirectory includes. */
#include "tui/tui-data.h"
-#include "tui/tui-layout.h"
+#include "tui/tui-hooks.h"
#include "tui/tui-io.h"
+#include "tui/tui-layout.h"
#include "tui/tui-regs.h"
#include "tui/tui-stack.h"
#include "tui/tui-win.h"
-#include "tui/tui-winsource.h"
#include "tui/tui-windata.h"
-#include "target.h"
-#include "frame.h"
+#include "tui/tui-winsource.h"
+
+/* Local includes. */
#include "breakpoint.h"
+#include "frame.h"
+#include "gdbcmd.h"
#include "inferior.h"
-#include "symtab.h"
#include "source.h"
+#include "symtab.h"
+#include "target.h"
#include "terminal.h"
#include "top.h"
-#include <ctype.h>
-#include <signal.h>
-#include <fcntl.h>
#if 0
#include <termio.h>
#endif
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index 0a93a831b86..334cdf0aeaa 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -18,24 +18,32 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdb_obstack.h"
-#include "bfd.h" /* Binary File Description */
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "value.h"
-#include "gdbcore.h"
-#include "command.h"
-#include "gdbcmd.h"
-#include "target.h"
-#include "language.h"
-#include "cp-abi.h"
#include "typeprint.h"
-#include "valprint.h"
+
+/* Standard C includes. */
#include <ctype.h>
+
+/* Local non-gdb includes. */
+#include "bfd.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-utils.h"
-#include "extension.h"
+
+/* Local includes. */
+#include "command.h"
#include "completer.h"
+#include "cp-abi.h"
+#include "expression.h"
+#include "extension.h"
+#include "gdb_obstack.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "language.h"
+#include "symtab.h"
+#include "target.h"
+#include "valprint.h"
+#include "value.h"
const struct type_print_options type_print_raw_options =
{
diff --git a/gdb/ui-file.c b/gdb/ui-file.c
index 77f6b31ce4b..bd8647a5b1e 100644
--- a/gdb/ui-file.c
+++ b/gdb/ui-file.c
@@ -21,9 +21,13 @@
#include "defs.h"
#include "ui-file.h"
+
+/* Local subdirectory includes. */
+#include "common/filestuff.h"
+
+/* Local includes. */
#include "gdb_obstack.h"
#include "gdb_select.h"
-#include "common/filestuff.h"
null_file null_stream;
diff --git a/gdb/ui-file.h b/gdb/ui-file.h
index 6e6ca1c9cdc..d69ab621ca1 100644
--- a/gdb/ui-file.h
+++ b/gdb/ui-file.h
@@ -20,6 +20,8 @@
#define UI_FILE_H
#include <string>
+
+/* Local includes. */
#include "ui-style.h"
/* The abstract ui_file base class. */
diff --git a/gdb/ui-out.c b/gdb/ui-out.c
index 6851fd29c6a..7be1b9b12b1 100644
--- a/gdb/ui-out.c
+++ b/gdb/ui-out.c
@@ -21,13 +21,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "expression.h" /* For language.h */
-#include "language.h"
#include "ui-out.h"
-#include <vector>
+/* Standard C++ includes. */
#include <memory>
#include <string>
+#include <vector>
+
+/* Local includes. */
+#include "expression.h"
+#include "language.h"
namespace {
diff --git a/gdb/ui-out.h b/gdb/ui-out.h
index 8d183060b53..d0433492f58 100644
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -25,6 +25,7 @@
#include <vector>
+/* Local subdirectory includes. */
#include "common/enum-flags.h"
class ui_out_level;
diff --git a/gdb/unittests/array-view-selftests.c b/gdb/unittests/array-view-selftests.c
index d0d1128cd2a..d4acb419cea 100644
--- a/gdb/unittests/array-view-selftests.c
+++ b/gdb/unittests/array-view-selftests.c
@@ -18,10 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/selftest.h"
-#include "common/array-view.h"
+
+/* Standard C++ includes. */
#include <array>
+/* Local subdirectory includes. */
+#include "common/array-view.h"
+#include "common/selftest.h"
+
namespace selftests {
namespace array_view_tests {
diff --git a/gdb/unittests/child-path-selftests.c b/gdb/unittests/child-path-selftests.c
index 4c436efa969..7de12e7d300 100644
--- a/gdb/unittests/child-path-selftests.c
+++ b/gdb/unittests/child-path-selftests.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
#include "common/pathstuff.h"
#include "common/selftest.h"
diff --git a/gdb/unittests/cli-utils-selftests.c b/gdb/unittests/cli-utils-selftests.c
index dd4a7a0f0f9..f7f30ae5a90 100644
--- a/gdb/unittests/cli-utils-selftests.c
+++ b/gdb/unittests/cli-utils-selftests.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
#include "cli/cli-utils.h"
#include "common/selftest.h"
diff --git a/gdb/unittests/common-utils-selftests.c b/gdb/unittests/common-utils-selftests.c
index 996ab5e82d1..01416a6f8f0 100644
--- a/gdb/unittests/common-utils-selftests.c
+++ b/gdb/unittests/common-utils-selftests.c
@@ -17,6 +17,9 @@
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"
+
+/* Local subdirectory includes. */
#include "common/common-defs.h"
#include "common/selftest.h"
diff --git a/gdb/unittests/copy_bitwise-selftests.c b/gdb/unittests/copy_bitwise-selftests.c
index 9dd9aeac00c..ee0d60f6128 100644
--- a/gdb/unittests/copy_bitwise-selftests.c
+++ b/gdb/unittests/copy_bitwise-selftests.c
@@ -18,7 +18,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
#include "common/selftest.h"
+
+/* Local includes. */
#include "utils.h"
namespace selftests {
diff --git a/gdb/unittests/environ-selftests.c b/gdb/unittests/environ-selftests.c
index 2bbff7039e6..1aeda9d9340 100644
--- a/gdb/unittests/environ-selftests.c
+++ b/gdb/unittests/environ-selftests.c
@@ -18,10 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/selftest.h"
-#include "common/environ.h"
+
+/* Local non-gdb includes. */
#include "diagnostics.h"
+/* Local subdirectory includes. */
+#include "common/environ.h"
+#include "common/selftest.h"
+
static const char gdb_selftest_env_var[] = "GDB_SELFTEST_ENVIRON";
static bool
diff --git a/gdb/unittests/format_pieces-selftests.c b/gdb/unittests/format_pieces-selftests.c
index 976af3d2fcd..b62644759c2 100644
--- a/gdb/unittests/format_pieces-selftests.c
+++ b/gdb/unittests/format_pieces-selftests.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
#include "common/format.h"
#include "common/selftest.h"
diff --git a/gdb/unittests/function-view-selftests.c b/gdb/unittests/function-view-selftests.c
index 2abaa1f9917..f5355ce2931 100644
--- a/gdb/unittests/function-view-selftests.c
+++ b/gdb/unittests/function-view-selftests.c
@@ -18,8 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/selftest.h"
+
+/* Local subdirectory includes. */
#include "common/function-view.h"
+#include "common/selftest.h"
namespace selftests {
namespace function_view {
diff --git a/gdb/unittests/lookup_name_info-selftests.c b/gdb/unittests/lookup_name_info-selftests.c
index 04fcd7e0b5a..f1746653c18 100644
--- a/gdb/unittests/lookup_name_info-selftests.c
+++ b/gdb/unittests/lookup_name_info-selftests.c
@@ -18,7 +18,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
#include "common/selftest.h"
+
+/* Local includes. */
#include "symtab.h"
namespace selftests {
diff --git a/gdb/unittests/memory-map-selftests.c b/gdb/unittests/memory-map-selftests.c
index fc6f0fe5730..88e277532d6 100644
--- a/gdb/unittests/memory-map-selftests.c
+++ b/gdb/unittests/memory-map-selftests.c
@@ -18,7 +18,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
#include "common/selftest.h"
+
+/* Local includes. */
#include "memory-map.h"
#if defined(HAVE_LIBEXPAT)
diff --git a/gdb/unittests/memrange-selftests.c b/gdb/unittests/memrange-selftests.c
index ada8e3e4342..0a39b49e7b7 100644
--- a/gdb/unittests/memrange-selftests.c
+++ b/gdb/unittests/memrange-selftests.c
@@ -18,7 +18,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
#include "common/selftest.h"
+
+/* Local includes. */
#include "memrange.h"
namespace selftests {
diff --git a/gdb/unittests/mkdir-recursive-selftests.c b/gdb/unittests/mkdir-recursive-selftests.c
index a8b571f38c7..1a19805fa95 100644
--- a/gdb/unittests/mkdir-recursive-selftests.c
+++ b/gdb/unittests/mkdir-recursive-selftests.c
@@ -19,10 +19,11 @@
#include "defs.h"
-#include "common/filestuff.h"
-#include "common/selftest.h"
+/* Local subdirectory includes. */
#include "common/byte-vector.h"
+#include "common/filestuff.h"
#include "common/pathstuff.h"
+#include "common/selftest.h"
namespace selftests {
namespace mkdir_recursive {
diff --git a/gdb/unittests/observable-selftests.c b/gdb/unittests/observable-selftests.c
index 2a51a999561..55ececaa6fa 100644
--- a/gdb/unittests/observable-selftests.c
+++ b/gdb/unittests/observable-selftests.c
@@ -18,8 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/selftest.h"
+
+/* Local subdirectory includes. */
#include "common/observable.h"
+#include "common/selftest.h"
namespace selftests {
namespace observers {
diff --git a/gdb/unittests/offset-type-selftests.c b/gdb/unittests/offset-type-selftests.c
index 8222a94ad02..0f04d41d563 100644
--- a/gdb/unittests/offset-type-selftests.c
+++ b/gdb/unittests/offset-type-selftests.c
@@ -18,8 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/selftest.h"
+
+/* Local subdirectory includes. */
#include "common/offset-type.h"
+#include "common/selftest.h"
#include "common/underlying.h"
#include "common/valid-expr.h"
diff --git a/gdb/unittests/optional-selftests.c b/gdb/unittests/optional-selftests.c
index fdd4437b16e..ca2e2432f57 100644
--- a/gdb/unittests/optional-selftests.c
+++ b/gdb/unittests/optional-selftests.c
@@ -18,8 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/selftest.h"
+
+/* Local subdirectory includes. */
#include "common/gdb_optional.h"
+#include "common/selftest.h"
/* Used by the included .cc files below. Included here because the
included test files are wrapped in a namespace. */
diff --git a/gdb/unittests/parse-connection-spec-selftests.c b/gdb/unittests/parse-connection-spec-selftests.c
index 969c51e4e88..7e451c8b70e 100644
--- a/gdb/unittests/parse-connection-spec-selftests.c
+++ b/gdb/unittests/parse-connection-spec-selftests.c
@@ -18,9 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/selftest.h"
-#include "common/netstuff.h"
+
+/* Local non-gdb includes. */
#include "diagnostics.h"
+
+/* Local subdirectory includes. */
+#include "common/netstuff.h"
+#include "common/selftest.h"
+
#ifdef USE_WIN32API
#if _WIN32_WINNT < 0x0501
# undef _WIN32_WINNT
diff --git a/gdb/unittests/ptid-selftests.c b/gdb/unittests/ptid-selftests.c
index 0194d9a229f..cc43ee96511 100644
--- a/gdb/unittests/ptid-selftests.c
+++ b/gdb/unittests/ptid-selftests.c
@@ -18,9 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/ptid.h"
+
+/* Standard C++ includes. */
#include <type_traits>
+/* Local subdirectory includes. */
+#include "common/ptid.h"
+
namespace selftests {
namespace ptid {
diff --git a/gdb/unittests/rsp-low-selftests.c b/gdb/unittests/rsp-low-selftests.c
index dc3e8f52054..d3594b46c48 100644
--- a/gdb/unittests/rsp-low-selftests.c
+++ b/gdb/unittests/rsp-low-selftests.c
@@ -18,8 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/selftest.h"
+
+/* Local subdirectory includes. */
#include "common/rsp-low.h"
+#include "common/selftest.h"
namespace selftests {
namespace rsp_low {
diff --git a/gdb/unittests/scoped_fd-selftests.c b/gdb/unittests/scoped_fd-selftests.c
index 886ff261acb..1089c1efd9c 100644
--- a/gdb/unittests/scoped_fd-selftests.c
+++ b/gdb/unittests/scoped_fd-selftests.c
@@ -19,9 +19,12 @@
#include "defs.h"
+/* Local non-gdb includes. */
+#include "config.h"
+
+/* Local subdirectory includes. */
#include "common/filestuff.h"
#include "common/scoped_fd.h"
-#include "config.h"
#include "common/selftest.h"
namespace selftests {
diff --git a/gdb/unittests/scoped_mmap-selftests.c b/gdb/unittests/scoped_mmap-selftests.c
index a3d2040b62a..9da476b0b25 100644
--- a/gdb/unittests/scoped_mmap-selftests.c
+++ b/gdb/unittests/scoped_mmap-selftests.c
@@ -19,9 +19,12 @@
#include "defs.h"
+/* Local non-gdb includes. */
+#include "config.h"
+
+/* Local subdirectory includes. */
#include "common/filestuff.h"
#include "common/scoped_mmap.h"
-#include "config.h"
#if defined(HAVE_SYS_MMAN_H)
diff --git a/gdb/unittests/scoped_restore-selftests.c b/gdb/unittests/scoped_restore-selftests.c
index 564ca07a920..5a38dc24840 100644
--- a/gdb/unittests/scoped_restore-selftests.c
+++ b/gdb/unittests/scoped_restore-selftests.c
@@ -18,8 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/selftest.h"
+
+/* Local subdirectory includes. */
#include "common/scoped_restore.h"
+#include "common/selftest.h"
namespace selftests {
namespace scoped_restore_tests {
diff --git a/gdb/unittests/style-selftests.c b/gdb/unittests/style-selftests.c
index 9682724b86f..bcf6885aac4 100644
--- a/gdb/unittests/style-selftests.c
+++ b/gdb/unittests/style-selftests.c
@@ -18,7 +18,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
#include "common/selftest.h"
+
+/* Local includes. */
#include "ui-style.h"
namespace selftests {
diff --git a/gdb/unittests/tracepoint-selftests.c b/gdb/unittests/tracepoint-selftests.c
index 1e2618453b4..39cd0f9eec1 100644
--- a/gdb/unittests/tracepoint-selftests.c
+++ b/gdb/unittests/tracepoint-selftests.c
@@ -18,7 +18,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
#include "common/selftest.h"
+
+/* Local includes. */
#include "tracepoint.h"
namespace selftests {
diff --git a/gdb/unittests/unpack-selftests.c b/gdb/unittests/unpack-selftests.c
index e85aa2180b7..be5f595e7a8 100644
--- a/gdb/unittests/unpack-selftests.c
+++ b/gdb/unittests/unpack-selftests.c
@@ -18,11 +18,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local subdirectory includes. */
#include "common/selftest.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "gdbtypes.h"
#include "selftest-arch.h"
#include "value.h"
-#include "gdbtypes.h"
-#include "arch-utils.h"
namespace selftests {
namespace unpack {
diff --git a/gdb/unittests/utils-selftests.c b/gdb/unittests/utils-selftests.c
index c874de3e181..da79b2652d7 100644
--- a/gdb/unittests/utils-selftests.c
+++ b/gdb/unittests/utils-selftests.c
@@ -18,9 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "utils.h"
+
+/* Local subdirectory includes. */
#include "common/selftest.h"
+/* Local includes. */
+#include "utils.h"
+
namespace selftests {
namespace utils {
diff --git a/gdb/unittests/xml-utils-selftests.c b/gdb/unittests/xml-utils-selftests.c
index 2c24056aacd..fd5b17f4839 100644
--- a/gdb/unittests/xml-utils-selftests.c
+++ b/gdb/unittests/xml-utils-selftests.c
@@ -18,8 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "common/xml-utils.h"
+
+/* Local subdirectory includes. */
#include "common/selftest.h"
+#include "common/xml-utils.h"
namespace selftests {
namespace xml_utils {
diff --git a/gdb/user-regs.c b/gdb/user-regs.c
index 44a82ff5870..4da4042a417 100644
--- a/gdb/user-regs.c
+++ b/gdb/user-regs.c
@@ -21,11 +21,15 @@
#include "defs.h"
#include "user-regs.h"
-#include "gdbtypes.h"
-#include "frame.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-cmds.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "command.h"
-#include "cli/cli-cmds.h"
+#include "frame.h"
+#include "gdbtypes.h"
/* A table of user registers.
diff --git a/gdb/utils.c b/gdb/utils.c
index 840779a6307..cd90c6e181c 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -18,16 +18,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "utils.h"
+
+/* Standard C includes. */
#include <ctype.h>
-#include "common/gdb_wait.h"
-#include "event-top.h"
-#include "gdbthread.h"
-#include "fnmatch.h"
-#include "gdb_bfd.h"
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif /* HAVE_SYS_RESOURCE_H */
+/* Local non-gdb includes. */
+#include "fnmatch.h"
+
+/* Local subdirectory includes. */
+#include "common/gdb_wait.h"
+
+/* Local includes. */
+#include "event-top.h"
+#include "gdb_bfd.h"
+#include "gdbthread.h"
+
#ifdef TUI
#include "tui/tui.h" /* For tui_get_command_dimension. */
#endif
diff --git a/gdb/utils.h b/gdb/utils.h
index f0cb48e7a55..144fbcc7ef0 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -21,10 +21,14 @@
#ifndef UTILS_H
#define UTILS_H
-#include "exceptions.h"
-#include "common/scoped_restore.h"
#include <chrono>
+/* Local subdirectory includes. */
+#include "common/scoped_restore.h"
+
+/* Local includes. */
+#include "exceptions.h"
+
extern void initialize_utils (void);
/* String utilities. */
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 4f3cc5e9e2b..04370eadb4f 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -18,20 +18,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+#include "elf-bfd.h"
+#include "elf/v850.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "dwarf2-frame.h"
#include "frame-base.h"
-#include "trad-frame.h"
#include "frame-unwind.h"
-#include "dwarf2-frame.h"
+#include "frame.h"
+#include "gdbcore.h"
#include "gdbtypes.h"
#include "inferior.h"
-#include "gdbcore.h"
-#include "arch-utils.h"
-#include "regcache.h"
-#include "dis-asm.h"
#include "osabi.h"
-#include "elf-bfd.h"
-#include "elf/v850.h"
+#include "regcache.h"
+#include "trad-frame.h"
enum
{
diff --git a/gdb/valarith.c b/gdb/valarith.c
index d59f692a4a0..4cb99222612 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -18,15 +18,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "value.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+
+/* Local subdirectory includes. */
+#include "common/byte-vector.h"
+
+/* Local includes. */
#include "expression.h"
-#include "target.h"
+#include "gdbtypes.h"
+#include "infcall.h"
#include "language.h"
+#include "symtab.h"
#include "target-float.h"
-#include "infcall.h"
-#include "common/byte-vector.h"
+#include "target.h"
+#include "value.h"
/* Define whether or not the C operator '/' truncates towards zero for
differently signed operands (truncation direction is undefined in C). */
diff --git a/gdb/valops.c b/gdb/valops.c
index 3d1f39f8c95..ca01a0309e9 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -18,28 +18,34 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "value.h"
+
+/* Local non-gdb includes. */
+#include "demangle.h"
+
+/* Local subdirectory includes. */
+#include "common/byte-vector.h"
+
+/* Local includes. */
+#include "block.h"
+#include "cp-abi.h"
+#include "cp-support.h"
+#include "dictionary.h"
+#include "extension.h"
#include "frame.h"
-#include "inferior.h"
+#include "gdbcmd.h"
#include "gdbcore.h"
-#include "target.h"
-#include "demangle.h"
+#include "gdbtypes.h"
+#include "infcall.h"
+#include "inferior.h"
#include "language.h"
-#include "gdbcmd.h"
+#include "objfiles.h"
+#include "observable.h"
#include "regcache.h"
-#include "cp-abi.h"
-#include "block.h"
-#include "infcall.h"
-#include "dictionary.h"
-#include "cp-support.h"
+#include "symtab.h"
#include "target-float.h"
+#include "target.h"
#include "tracepoint.h"
-#include "observable.h"
-#include "objfiles.h"
-#include "extension.h"
-#include "common/byte-vector.h"
+#include "value.h"
extern unsigned int overload_debug;
/* Local functions. */
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 10020901c2d..4665ae3ecd8 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -18,25 +18,33 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "value.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
-#include "target.h"
-#include "language.h"
-#include "annotate.h"
#include "valprint.h"
-#include "target-float.h"
-#include "extension.h"
-#include "ada-lang.h"
-#include "gdb_obstack.h"
-#include "charset.h"
-#include "typeprint.h"
+
+/* Standard C includes. */
#include <ctype.h>
+
+/* Standard C++ includes. */
#include <algorithm>
+
+/* Local subdirectory includes. */
#include "common/byte-vector.h"
+/* Local includes. */
+#include "ada-lang.h"
+#include "annotate.h"
+#include "charset.h"
+#include "extension.h"
+#include "gdb_obstack.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "language.h"
+#include "symtab.h"
+#include "target-float.h"
+#include "target.h"
+#include "typeprint.h"
+#include "value.h"
+
/* Maximum number of wchars returned from wchar_iterate. */
#define MAX_WCHARS 4
diff --git a/gdb/value.c b/gdb/value.c
index dc297dfe0f9..c39dd77e2cb 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -18,31 +18,41 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
-#include "symtab.h"
-#include "gdbtypes.h"
#include "value.h"
-#include "gdbcore.h"
+
+/* Standard C includes. */
+#include <ctype.h>
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
+#include "demangle.h"
+
+/* Local subdirectory includes. */
+#include "cli/cli-decode.h"
+#include "common/array-view.h"
+#include "common/selftest.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "block.h"
#include "command.h"
+#include "completer.h"
+#include "cp-abi.h"
+#include "extension.h"
#include "gdbcmd.h"
-#include "target.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
#include "language.h"
-#include "demangle.h"
+#include "objfiles.h"
#include "regcache.h"
-#include "block.h"
+#include "symtab.h"
#include "target-float.h"
-#include "objfiles.h"
-#include "valprint.h"
-#include "cli/cli-decode.h"
-#include "extension.h"
-#include <ctype.h>
+#include "target.h"
#include "tracepoint.h"
-#include "cp-abi.h"
#include "user-regs.h"
-#include <algorithm>
-#include "completer.h"
-#include "common/selftest.h"
-#include "common/array-view.h"
+#include "valprint.h"
/* Definition of a user function. */
struct internal_function
diff --git a/gdb/value.h b/gdb/value.h
index d3905cc354a..6be582f9ace 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -20,10 +20,12 @@
#if !defined (VALUE_H)
#define VALUE_H 1
-#include "frame.h" /* For struct frame_id. */
-#include "extension.h"
#include "common/gdb_ref_ptr.h"
+/* Local includes. */
+#include "extension.h"
+#include "frame.h"
+
struct block;
struct expression;
struct regcache;
diff --git a/gdb/varobj.c b/gdb/varobj.c
index b2975be6b77..a852acd6c41 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -16,21 +16,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "value.h"
+#include "varobj.h"
+
+/* Local subdirectory includes. */
+#include "common/vec.h"
+
+/* Local includes. */
+#include "block.h"
#include "expression.h"
#include "frame.h"
-#include "language.h"
-#include "gdbcmd.h"
-#include "block.h"
-#include "valprint.h"
#include "gdb_regex.h"
-
-#include "varobj.h"
-#include "common/vec.h"
+#include "gdbcmd.h"
#include "gdbthread.h"
#include "inferior.h"
-#include "varobj-iter.h"
+#include "language.h"
#include "parser-defs.h"
+#include "valprint.h"
+#include "value.h"
+#include "varobj-iter.h"
#if HAVE_PYTHON
#include "python/python.h"
diff --git a/gdb/varobj.h b/gdb/varobj.h
index 5d8c6876dd8..3460275cf5b 100644
--- a/gdb/varobj.h
+++ b/gdb/varobj.h
@@ -17,9 +17,11 @@
#ifndef VAROBJ_H
#define VAROBJ_H 1
-#include "symtab.h"
-#include "gdbtypes.h"
#include "common/vec.h"
+
+/* Local includes. */
+#include "gdbtypes.h"
+#include "symtab.h"
#include "value.h"
/* Enumeration for the format types */
diff --git a/gdb/vax-bsd-nat.c b/gdb/vax-bsd-nat.c
index 910746a7af8..82fb18ccce0 100644
--- a/gdb/vax-bsd-nat.c
+++ b/gdb/vax-bsd-nat.c
@@ -18,16 +18,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "target.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
+/* Standard C includes. */
#include <machine/reg.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
-#include "vax-tdep.h"
+/* Local includes. */
#include "inf-ptrace.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "target.h"
+#include "vax-tdep.h"
struct vax_bsd_nat_target final : public inf_ptrace_target
{
diff --git a/gdb/vax-nbsd-tdep.c b/gdb/vax-nbsd-tdep.c
index 77c988d63bd..9a98d745cb6 100644
--- a/gdb/vax-nbsd-tdep.c
+++ b/gdb/vax-nbsd-tdep.c
@@ -18,11 +18,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+
+/* Local includes. */
#include "arch-utils.h"
#include "osabi.h"
-
-#include "vax-tdep.h"
#include "solib-svr4.h"
+#include "vax-tdep.h"
/* NetBSD ELF. */
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index 6046c0e98b4..34c39d5be90 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -18,11 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "arch-utils.h"
+#include "vax-tdep.h"
+
+/* Local non-gdb includes. */
#include "dis-asm.h"
-#include "frame.h"
+
+/* Local includes. */
+#include "arch-utils.h"
#include "frame-base.h"
#include "frame-unwind.h"
+#include "frame.h"
#include "gdbcore.h"
#include "gdbtypes.h"
#include "osabi.h"
@@ -31,8 +36,6 @@
#include "trad-frame.h"
#include "value.h"
-#include "vax-tdep.h"
-
/* Return the name of register REGNUM. */
static const char *
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 47f6cbb5412..393facc1d01 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -22,21 +22,27 @@
/* Originally by Steve Chamberlain, sac@cygnus.com */
#include "defs.h"
-#include "frame.h" /* required by inferior.h */
-#include "inferior.h"
-#include "infrun.h"
-#include "target.h"
-#include "gdbcore.h"
+#include "windows-nat.h"
+
+/* Standard C includes. */
+#include <fcntl.h>
+#include <imagehlp.h>
+#include <psapi.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <windows.h>
+
+/* Local includes. */
#include "command.h"
#include "completer.h"
+#include "frame.h"
+#include "gdbcore.h"
+#include "inferior.h"
+#include "infrun.h"
#include "regcache.h"
+#include "target.h"
#include "top.h"
-#include <signal.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <windows.h>
-#include <imagehlp.h>
-#include <psapi.h>
+
#ifdef __CYGWIN__
#include <wchar.h>
#include <sys/cygwin.h>
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index 42083e789a5..2fdbdc8bfa0 100644
--- a/gdb/windows-tdep.c
+++ b/gdb/windows-tdep.c
@@ -17,23 +17,25 @@
#include "defs.h"
#include "windows-tdep.h"
+
+/* Local includes. */
+#include "coff-pe-read.h"
+#include "command.h"
+#include "complaints.h"
+#include "gdb_bfd.h"
#include "gdb_obstack.h"
-#include "xml-support.h"
#include "gdbarch.h"
-#include "target.h"
-#include "value.h"
-#include "inferior.h"
-#include "command.h"
#include "gdbcmd.h"
+#include "gdbcore.h"
#include "gdbthread.h"
+#include "inferior.h"
#include "objfiles.h"
-#include "symfile.h"
-#include "coff-pe-read.h"
-#include "gdb_bfd.h"
-#include "complaints.h"
-#include "solib.h"
#include "solib-target.h"
-#include "gdbcore.h"
+#include "solib.h"
+#include "symfile.h"
+#include "target.h"
+#include "value.h"
+#include "xml-support.h"
struct cmd_list_element *info_w32_cmdlist;
diff --git a/gdb/x86-bsd-nat.c b/gdb/x86-bsd-nat.c
index b000976619f..43edb44d2d7 100644
--- a/gdb/x86-bsd-nat.c
+++ b/gdb/x86-bsd-nat.c
@@ -18,8 +18,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
+#include "x86-bsd-nat.h"
+
+/* Local includes. */
#include "gdbthread.h"
+#include "inferior.h"
/* We include <signal.h> to make sure `struct fxsave64' is defined on
NetBSD, since NetBSD's <machine/reg.h> needs it. */
diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c
index 9a451e0e1aa..f1812ec4db7 100644
--- a/gdb/x86-linux-nat.c
+++ b/gdb/x86-linux-nat.c
@@ -18,15 +18,24 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h"
-#include "elf/common.h"
-#include "gdb_proc_service.h"
-#include "nat/gdb_ptrace.h"
-#include <sys/user.h>
+#include "x86-linux-nat.h"
+
+/* Standard C includes. */
#include <sys/procfs.h>
#include <sys/uio.h>
+#include <sys/user.h>
+/* Local non-gdb includes. */
+#include "elf/common.h"
+
+/* Local subdirectory includes. */
+#include "nat/gdb_ptrace.h"
+
+/* Local includes. */
+#include "gdb_proc_service.h"
+#include "inferior.h"
#include "x86-nat.h"
+
#ifndef __x86_64__
#include "i386-linux-nat.h"
#endif
diff --git a/gdb/x86-linux-nat.h b/gdb/x86-linux-nat.h
index 887e30eecd6..299842ceb29 100644
--- a/gdb/x86-linux-nat.h
+++ b/gdb/x86-linux-nat.h
@@ -20,10 +20,12 @@
#ifndef X86_LINUX_NAT_H
#define X86_LINUX_NAT_H 1
-#include "gdb_proc_service.h" /* For ps_err_e. */
+#include "nat/x86-linux.h"
+
+/* Local includes. */
+#include "gdb_proc_service.h"
#include "linux-nat.h"
#include "x86-nat.h"
-#include "nat/x86-linux.h"
struct x86_linux_nat_target : public x86_nat_target<linux_nat_target>
{
diff --git a/gdb/x86-nat.c b/gdb/x86-nat.c
index cd9ce17e8dc..a9c41d02cef 100644
--- a/gdb/x86-nat.c
+++ b/gdb/x86-nat.c
@@ -19,6 +19,8 @@
#include "defs.h"
#include "x86-nat.h"
+
+/* Local includes. */
#include "gdbcmd.h"
#include "inferior.h"
diff --git a/gdb/x86-nat.h b/gdb/x86-nat.h
index baa4218a87b..09eb73fb019 100644
--- a/gdb/x86-nat.h
+++ b/gdb/x86-nat.h
@@ -23,8 +23,10 @@
#ifndef X86_NAT_H
#define X86_NAT_H 1
-#include "breakpoint.h"
#include "nat/x86-dregs.h"
+
+/* Local includes. */
+#include "breakpoint.h"
#include "target.h"
/* Hardware-assisted breakpoints and watchpoints. */
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index e93a34b411f..e9cd7f0420b 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -19,25 +19,29 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "bfd.h"
+#include "xcoffread.h"
-#include <sys/types.h>
-#include <fcntl.h>
+/* Standard C includes. */
#include <ctype.h>
+#include <fcntl.h>
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
#include <sys/stat.h>
+#include <sys/types.h>
+/* Local non-gdb includes. */
+#include "bfd.h"
#include "coff/internal.h"
-#include "libcoff.h" /* FIXME, internal data from BFD */
+#include "coff/rs6000.h"
#include "coff/xcoff.h"
+#include "libcoff.h"
#include "libxcoff.h"
-#include "coff/rs6000.h"
-#include "xcoffread.h"
-#include "symtab.h"
+/* Local includes. */
#include "gdbtypes.h"
+#include "symtab.h"
+
/* FIXME: ezannoni/2004-02-13 Verify if the include below is really needed. */
#include "symfile.h"
#include "objfiles.h"
diff --git a/gdb/xml-support.c b/gdb/xml-support.c
index 2b19a000471..640917c86ab 100644
--- a/gdb/xml-support.c
+++ b/gdb/xml-support.c
@@ -18,12 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcmd.h"
#include "xml-support.h"
-#include "common/filestuff.h"
-#include "safe-ctype.h"
-#include <vector>
+
+/* Standard C++ includes. */
#include <string>
+#include <vector>
+
+/* Local non-gdb includes. */
+#include "safe-ctype.h"
+
+/* Local subdirectory includes. */
+#include "common/filestuff.h"
+
+/* Local includes. */
+#include "gdbcmd.h"
/* Debugging flag. */
static int debug_xml;
diff --git a/gdb/xml-support.h b/gdb/xml-support.h
index c5cf617050a..b8d1b2cccb1 100644
--- a/gdb/xml-support.h
+++ b/gdb/xml-support.h
@@ -21,10 +21,12 @@
#ifndef XML_SUPPORT_H
#define XML_SUPPORT_H
-#include "gdb_obstack.h"
+#include "common/byte-vector.h"
#include "common/vec.h"
#include "common/xml-utils.h"
-#include "common/byte-vector.h"
+
+/* Local includes. */
+#include "gdb_obstack.h"
struct gdb_xml_parser;
struct gdb_xml_element;
diff --git a/gdb/xml-syscall.c b/gdb/xml-syscall.c
index d144f82fbf2..bfb4b51ea8e 100644
--- a/gdb/xml-syscall.c
+++ b/gdb/xml-syscall.c
@@ -19,10 +19,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbtypes.h"
-#include "xml-support.h"
#include "xml-syscall.h"
+
+/* Local includes. */
#include "gdbarch.h"
+#include "gdbtypes.h"
+#include "xml-support.h"
/* For the struct syscall definition. */
#include "target.h"
diff --git a/gdb/xml-tdesc.c b/gdb/xml-tdesc.c
index 7588cb0f99f..d081823e859 100644
--- a/gdb/xml-tdesc.c
+++ b/gdb/xml-tdesc.c
@@ -20,14 +20,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "target.h"
-#include "target-descriptions.h"
-#include "xml-support.h"
#include "xml-tdesc.h"
-#include "osabi.h"
-#include "filenames.h"
-#include <unordered_map>
+
+/* Standard C++ includes. */
#include <string>
+#include <unordered_map>
+
+/* Local non-gdb includes. */
+#include "filenames.h"
+
+/* Local includes. */
+#include "osabi.h"
+#include "target-descriptions.h"
+#include "target.h"
+#include "xml-support.h"
/* Maximum sizes.
This is just to catch obviously wrong values. */
diff --git a/gdb/xml-tdesc.h b/gdb/xml-tdesc.h
index 2137ee8a411..15a0701a8d4 100644
--- a/gdb/xml-tdesc.h
+++ b/gdb/xml-tdesc.h
@@ -22,9 +22,11 @@
#ifndef XML_TDESC_H
#define XML_TDESC_H
-#include "common/gdb_optional.h"
#include <string>
+/* Local subdirectory includes. */
+#include "common/gdb_optional.h"
+
struct target_ops;
struct target_desc;
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index 49c72e231c5..5efbe8fe2b0 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -18,22 +18,28 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
+
+/* Local non-gdb includes. */
+#include "dis-asm.h"
+
+/* Local subdirectory includes. */
+#include "common/byte-vector.h"
+
+/* Local includes. */
+#include "arch-utils.h"
+#include "dwarf2-frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
-#include "dwarf2-frame.h"
-#include "symtab.h"
-#include "gdbtypes.h"
+#include "frame.h"
#include "gdbcmd.h"
#include "gdbcore.h"
-#include "value.h"
-#include "dis-asm.h"
+#include "gdbtypes.h"
#include "inferior.h"
-#include "arch-utils.h"
-#include "regcache.h"
-#include "osabi.h"
#include "objfiles.h"
-#include "common/byte-vector.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "symtab.h"
+#include "value.h"
enum gdb_regnum
{
diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c
index 13904069b3a..a48f0ec397d 100644
--- a/gdb/xtensa-linux-nat.c
+++ b/gdb/xtensa-linux-nat.c
@@ -18,23 +18,28 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "regcache.h"
-#include "target.h"
-#include "linux-nat.h"
-#include <sys/types.h>
+
+/* Standard C includes. */
+#include <asm/ptrace.h>
+#include <fcntl.h>
#include <signal.h>
-#include <sys/user.h>
#include <sys/ioctl.h>
-#include "common/gdb_wait.h"
-#include <fcntl.h>
#include <sys/procfs.h>
+#include <sys/types.h>
+#include <sys/user.h>
+
+/* Local subdirectory includes. */
+#include "common/gdb_wait.h"
#include "nat/gdb_ptrace.h"
-#include <asm/ptrace.h>
+/* Local includes. */
+#include "frame.h"
+#include "gdbcore.h"
#include "gregset.h"
+#include "inferior.h"
+#include "linux-nat.h"
+#include "regcache.h"
+#include "target.h"
#include "xtensa-tdep.h"
/* Defines ps_err_e, struct ps_prochandle. */
diff --git a/gdb/xtensa-linux-tdep.c b/gdb/xtensa-linux-tdep.c
index 796143c6699..f3ac7ff6f37 100644
--- a/gdb/xtensa-linux-tdep.c
+++ b/gdb/xtensa-linux-tdep.c
@@ -18,11 +18,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "xtensa-tdep.h"
-#include "osabi.h"
+
+/* Local includes. */
#include "linux-tdep.h"
+#include "osabi.h"
#include "solib-svr4.h"
#include "symtab.h"
+#include "xtensa-tdep.h"
/* This enum represents the signals' numbers on the Xtensa
architecture. It just contains the signal definitions which are
diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c
index efa0bcb1dc3..8055ac7da49 100644
--- a/gdb/xtensa-tdep.c
+++ b/gdb/xtensa-tdep.c
@@ -18,40 +18,42 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "frame.h"
-#include "solib-svr4.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "gdbtypes.h"
-#include "gdbcore.h"
-#include "value.h"
+#include "xtensa-tdep.h"
+
+/* Standard C++ includes. */
+#include <algorithm>
+
+/* Local non-gdb includes. */
#include "dis-asm.h"
-#include "inferior.h"
-#include "osabi.h"
-#include "regcache.h"
-#include "reggroups.h"
-#include "regset.h"
+#include "dwarf2.h"
+#include "xtensa-config.h"
+#include "xtensa-isa.h"
+/* Local includes. */
+#include "arch-utils.h"
+#include "command.h"
#include "dummy-frame.h"
-#include "dwarf2.h"
#include "dwarf2-frame.h"
#include "dwarf2loc.h"
#include "frame-base.h"
#include "frame-unwind.h"
-
-#include "arch-utils.h"
+#include "frame.h"
#include "gdbarch.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "inferior.h"
+#include "objfiles.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "reggroups.h"
+#include "regset.h"
#include "remote.h"
#include "serial.h"
-
-#include "command.h"
-#include "gdbcmd.h"
-
-#include "xtensa-isa.h"
-#include "xtensa-tdep.h"
-#include "xtensa-config.h"
-#include <algorithm>
+#include "solib-svr4.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "value.h"
static unsigned int xtensa_debug_level = 0;