From: Gary Benson Date: Fri, 12 Sep 2014 09:11:42 +0000 (+0100) Subject: Include common-defs.h instead of defs.h/server.h in shared code X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=727605ca75e009d8468bb6378b7d18b774838b2d;p=binutils-gdb.git Include common-defs.h instead of defs.h/server.h in shared code This commit makes 19 of the 22 shared .c files in common, nat and target include common-defs.h instead of defs.h/server.h. The remaining three files need slight extra work and are dealt with in separate commits. gdb/ChangeLog: * common/agent.c: Include common-defs.h. Don't include defs.h or server.h. * common/buffer.c: Likewise. * common/common-debug.c: Likewise. * common/common-utils.c: Likewise. * common/errors.c: Likewise. * common/filestuff.c: Likewise. * common/format.c: Likewise. * common/gdb_vecs.c: Likewise. * common/print-utils.c: Likewise. * common/ptid.c: Likewise. * common/rsp-low.c: Likewise. * common/signals.c: Likewise. * common/vec.c: Likewise. * common/xml-utils.c: Likewise. * nat/linux-osdata.c: Likewise. * nat/linux-procfs.c: Likewise. * nat/linux-ptrace.c: Likewise. * nat/mips-linux-watch.c: Likewise. * target/waitstatus.c: Likewise. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 96d65ae92f5..2e18116704d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,26 @@ +2014-09-12 Gary Benson + + * common/agent.c: Include common-defs.h. + Don't include defs.h or server.h. + * common/buffer.c: Likewise. + * common/common-debug.c: Likewise. + * common/common-utils.c: Likewise. + * common/errors.c: Likewise. + * common/filestuff.c: Likewise. + * common/format.c: Likewise. + * common/gdb_vecs.c: Likewise. + * common/print-utils.c: Likewise. + * common/ptid.c: Likewise. + * common/rsp-low.c: Likewise. + * common/signals.c: Likewise. + * common/vec.c: Likewise. + * common/xml-utils.c: Likewise. + * nat/linux-osdata.c: Likewise. + * nat/linux-procfs.c: Likewise. + * nat/linux-ptrace.c: Likewise. + * nat/mips-linux-watch.c: Likewise. + * target/waitstatus.c: Likewise. + 2014-09-12 Tom Tromey Gary Benson diff --git a/gdb/common/agent.c b/gdb/common/agent.c index 433ae2a2d5a..854a9975683 100644 --- a/gdb/common/agent.c +++ b/gdb/common/agent.c @@ -17,11 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "common-defs.h" #include "target/target.h" #include "common/symbol.h" #include diff --git a/gdb/common/buffer.c b/gdb/common/buffer.c index 4a213b33272..d6afb6a39ee 100644 --- a/gdb/common/buffer.c +++ b/gdb/common/buffer.c @@ -17,12 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif - +#include "common-defs.h" #include "xml-utils.h" #include "buffer.h" #include "inttypes.h" diff --git a/gdb/common/common-debug.c b/gdb/common/common-debug.c index 5cac3bf81ae..933d4363742 100644 --- a/gdb/common/common-debug.c +++ b/gdb/common/common-debug.c @@ -17,11 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "common-defs.h" #include "common-debug.h" /* See common/common-debug.h. */ diff --git a/gdb/common/common-utils.c b/gdb/common/common-utils.c index a905d1dfc05..3b8237e9fe1 100644 --- a/gdb/common/common-utils.c +++ b/gdb/common/common-utils.c @@ -17,11 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "common-defs.h" /* The xmalloc() (libiberty.h) family of memory management routines. diff --git a/gdb/common/errors.c b/gdb/common/errors.c index d6e17a88b54..089c64b0de7 100644 --- a/gdb/common/errors.c +++ b/gdb/common/errors.c @@ -17,11 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "common-defs.h" #include "errors.h" /* See common/errors.h. */ diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c index a31ecd78fea..7ee9c5a823d 100644 --- a/gdb/common/filestuff.c +++ b/gdb/common/filestuff.c @@ -16,11 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "common-defs.h" #include "filestuff.h" #include "gdb_vecs.h" #include diff --git a/gdb/common/format.c b/gdb/common/format.c index 247aaffd09b..b989dc784a6 100644 --- a/gdb/common/format.c +++ b/gdb/common/format.c @@ -17,12 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif - +#include "common-defs.h" #include "format.h" struct format_piece * diff --git a/gdb/common/gdb_vecs.c b/gdb/common/gdb_vecs.c index 4a3330f5969..ae11cc6d6fa 100644 --- a/gdb/common/gdb_vecs.c +++ b/gdb/common/gdb_vecs.c @@ -17,12 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif - +#include "common-defs.h" #include "gdb_vecs.h" #include "host-defs.h" diff --git a/gdb/common/print-utils.c b/gdb/common/print-utils.c index f5bef0a6104..820ade01fa0 100644 --- a/gdb/common/print-utils.c +++ b/gdb/common/print-utils.c @@ -17,12 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif - +#include "common-defs.h" #include "print-utils.h" #include diff --git a/gdb/common/ptid.c b/gdb/common/ptid.c index 04fd118855c..84e4aa744bb 100644 --- a/gdb/common/ptid.c +++ b/gdb/common/ptid.c @@ -17,11 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "common-defs.h" #include "ptid.h" /* See ptid.h for these. */ diff --git a/gdb/common/rsp-low.c b/gdb/common/rsp-low.c index 02630054c82..e88799a6742 100644 --- a/gdb/common/rsp-low.c +++ b/gdb/common/rsp-low.c @@ -17,12 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif - +#include "common-defs.h" #include "rsp-low.h" /* See rsp-low.h. */ diff --git a/gdb/common/signals.c b/gdb/common/signals.c index 13d1e2c8c81..ebe2761220f 100644 --- a/gdb/common/signals.c +++ b/gdb/common/signals.c @@ -17,11 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "common-defs.h" #ifdef HAVE_SIGNAL_H #include diff --git a/gdb/common/vec.c b/gdb/common/vec.c index 4611e5f8db0..9fc691504c3 100644 --- a/gdb/common/vec.c +++ b/gdb/common/vec.c @@ -17,12 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif - +#include "common-defs.h" #include "vec.h" struct vec_prefix diff --git a/gdb/common/xml-utils.c b/gdb/common/xml-utils.c index 0f813907c10..b90dd21d104 100644 --- a/gdb/common/xml-utils.c +++ b/gdb/common/xml-utils.c @@ -17,12 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif - +#include "common-defs.h" #include "xml-utils.h" /* Return a malloc allocated string with special characters from TEXT diff --git a/gdb/nat/linux-osdata.c b/gdb/nat/linux-osdata.c index 887e518d316..3f72883c8af 100644 --- a/gdb/nat/linux-osdata.c +++ b/gdb/nat/linux-osdata.c @@ -17,12 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif - +#include "common-defs.h" #include "linux-osdata.h" #include diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c index 84fc890c7cc..30797da3438 100644 --- a/gdb/nat/linux-procfs.c +++ b/gdb/nat/linux-procfs.c @@ -16,12 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif - +#include "common-defs.h" #include "linux-procfs.h" #include "filestuff.h" diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c index b4db86249a6..627551646ab 100644 --- a/gdb/nat/linux-ptrace.c +++ b/gdb/nat/linux-ptrace.c @@ -16,12 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif - +#include "common-defs.h" #include "linux-ptrace.h" #include "linux-procfs.h" #include "linux-waitpid.h" diff --git a/gdb/nat/mips-linux-watch.c b/gdb/nat/mips-linux-watch.c index ea6e02de378..afa3d78e390 100644 --- a/gdb/nat/mips-linux-watch.c +++ b/gdb/nat/mips-linux-watch.c @@ -15,11 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "common-defs.h" #include #include "mips-linux-watch.h" diff --git a/gdb/target/waitstatus.c b/gdb/target/waitstatus.c index 4493555d52c..717f47ae88e 100644 --- a/gdb/target/waitstatus.c +++ b/gdb/target/waitstatus.c @@ -17,12 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif - +#include "common-defs.h" #include "waitstatus.h" /* Return a pretty printed form of target_waitstatus.