aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-13 22:14:40 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-17 00:11:48 -0400
commitef5058ae8714d68c0f671726618e721681523ac5 (patch)
treede9b85e73d69328fc91d905709fe65754cdc654b
parent62cfa544a44b6891f8fcdec953232a99da74a21c (diff)
downloadgdb-ef5058ae8714d68c0f671726618e721681523ac5.zip
gdb-ef5058ae8714d68c0f671726618e721681523ac5.tar.gz
gdb-ef5058ae8714d68c0f671726618e721681523ac5.tar.bz2
sim: split sim/callback.h include out
The sim-basics.h is too big and includes too many things. This leads to some arch's sim-main.h having circular loop issues with defs, and makes it hard to separate out common objects from arch-specific defs. By splitting up sim-basics.h and killing off sim-main.h, it'll make it easier to separate out the two. Start with splitting out sim/callback.h.
-rw-r--r--sim/common/ChangeLog9
-rw-r--r--sim/common/cgen-trace.c1
-rw-r--r--sim/common/nrun.c1
-rw-r--r--sim/common/sim-basics.h1
-rw-r--r--sim/common/sim-endian.h1
-rw-r--r--sim/common/sim-hw.c1
-rw-r--r--sim/common/sim-io.c1
-rw-r--r--sim/common/sim-syscall.c1
-rw-r--r--sim/common/sim-syscall.h2
-rw-r--r--sim/common/sim-trace.c1
-rw-r--r--sim/common/sim-utils.h1
-rw-r--r--sim/cris/ChangeLog4
-rw-r--r--sim/cris/traps.c1
-rw-r--r--sim/frv/ChangeLog4
-rw-r--r--sim/frv/traps.c1
-rw-r--r--sim/h8300/ChangeLog4
-rw-r--r--sim/h8300/compile.c1
-rw-r--r--sim/m68hc11/ChangeLog4
-rw-r--r--sim/m68hc11/sim-main.h1
19 files changed, 38 insertions, 2 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 60b94cf..abb2ec6 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,12 @@
+2021-06-17 Mike Frysinger <vapier@gentoo.org>
+
+ * cgen-trace.c: Include sim/callback.h.
+ * nrun.c, sim-hw.c, sim-io.c, sim-syscall.c, sim-trace.c: Likewise.
+ * sim-basics.h: Delete sim/callback.h include.
+ * sim-endian.h: Include bfd.h.
+ * sim-syscall.h (struct cb_syscall): New forward decl.
+ * sim-utils.h (sim_analyze_program): Likewise.
+
2021-06-16 Mike Frysinger <vapier@gentoo.org>
* Make-common.in (CONFIG_CFLAGS): Change @DEFS@ to -DHAVE_CONFIG_H.
diff --git a/sim/common/cgen-trace.c b/sim/common/cgen-trace.c
index 66250c0..206720c 100644
--- a/sim/common/cgen-trace.c
+++ b/sim/common/cgen-trace.c
@@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "bfd.h"
#include "sim-main.h"
#include "sim-fpu.h"
+#include "sim/callback.h"
#ifndef SIZE_INSTRUCTION
#define SIZE_INSTRUCTION 16
diff --git a/sim/common/nrun.c b/sim/common/nrun.c
index e39a0c6..ba293d1 100644
--- a/sim/common/nrun.c
+++ b/sim/common/nrun.c
@@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <string.h>
#include "sim-main.h"
+#include "sim/callback.h"
#include "bfd.h"
#include "environ.h"
diff --git a/sim/common/sim-basics.h b/sim/common/sim-basics.h
index ac63aef..1354742 100644
--- a/sim/common/sim-basics.h
+++ b/sim/common/sim-basics.h
@@ -112,7 +112,6 @@ typedef enum {
/* Basic definitions - ordered so that nothing calls what comes after it. */
#include "ansidecl.h"
-#include "sim/callback.h"
#include "sim/sim.h"
#include "sim-config.h"
diff --git a/sim/common/sim-endian.h b/sim/common/sim-endian.h
index 6e9101f..7b663a3 100644
--- a/sim/common/sim-endian.h
+++ b/sim/common/sim-endian.h
@@ -23,6 +23,7 @@
#ifndef SIM_ENDIAN_H
#define SIM_ENDIAN_H
+#include "bfd.h"
/* C byte conversion functions */
diff --git a/sim/common/sim-hw.c b/sim/common/sim-hw.c
index 95d9504..9a3db17 100644
--- a/sim/common/sim-hw.c
+++ b/sim/common/sim-hw.c
@@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "sim-main.h"
#include "sim-assert.h"
#include "sim-options.h"
+#include "sim/callback.h"
#include "sim-hw.h"
diff --git a/sim/common/sim-io.c b/sim/common/sim-io.c
index b5e874b..e09a4af 100644
--- a/sim/common/sim-io.c
+++ b/sim/common/sim-io.c
@@ -24,6 +24,7 @@
#include "sim-main.h"
#include "sim-io.h"
+#include "sim/callback.h"
#include "targ-vals.h"
#include <errno.h>
diff --git a/sim/common/sim-syscall.c b/sim/common/sim-syscall.c
index 0f7601c..be3ff8f 100644
--- a/sim/common/sim-syscall.c
+++ b/sim/common/sim-syscall.c
@@ -24,6 +24,7 @@
#include "sim-main.h"
#include "sim-syscall.h"
+#include "sim/callback.h"
#include "targ-vals.h"
/* Read/write functions for system call interface. */
diff --git a/sim/common/sim-syscall.h b/sim/common/sim-syscall.h
index 6f79d9d..562f443 100644
--- a/sim/common/sim-syscall.h
+++ b/sim/common/sim-syscall.h
@@ -20,6 +20,8 @@
#ifndef SIM_SYSCALL_H
#define SIM_SYSCALL_H
+struct cb_syscall;
+
/* Perform a syscall on the behalf of the target program. The error/result are
normalized into a single value (like a lot of operating systems do). If you
want the split values, see the other function below.
diff --git a/sim/common/sim-trace.c b/sim/common/sim-trace.c
index b8224e0..2c37989 100644
--- a/sim/common/sim-trace.c
+++ b/sim/common/sim-trace.c
@@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "sim-io.h"
#include "sim-options.h"
#include "sim-fpu.h"
+#include "sim/callback.h"
#include "bfd.h"
#include "libiberty.h"
diff --git a/sim/common/sim-utils.h b/sim/common/sim-utils.h
index 9cc19f5..bfc8ac7 100644
--- a/sim/common/sim-utils.h
+++ b/sim/common/sim-utils.h
@@ -60,6 +60,7 @@ SIM_RC sim_analyze_program (SIM_DESC sd, const char *prog_name,
write the program sections at LMA interpreted as a virtual address.
This is still accommodated for backward compatibility reasons. */
+typedef struct host_callback_struct host_callback;
typedef int sim_write_fn (SIM_DESC sd, SIM_ADDR mem,
const unsigned char *buf, int length);
struct bfd *sim_load_file (SIM_DESC sd, const char *myname,
diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog
index 60a5ce1..2408419 100644
--- a/sim/cris/ChangeLog
+++ b/sim/cris/ChangeLog
@@ -1,3 +1,7 @@
+2021-06-17 Mike Frysinger <vapier@gentoo.org>
+
+ * traps.c: Include sim/callback.h.
+
2021-06-16 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
diff --git a/sim/cris/traps.c b/sim/cris/traps.c
index a55f7df..2ad4081 100644
--- a/sim/cris/traps.c
+++ b/sim/cris/traps.c
@@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "sim-main.h"
#include "sim-syscall.h"
#include "sim-options.h"
+#include "sim/callback.h"
#include "bfd.h"
/* FIXME: get rid of targ-vals.h usage everywhere else. */
diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog
index f5038cbf..80b33cd 100644
--- a/sim/frv/ChangeLog
+++ b/sim/frv/ChangeLog
@@ -1,3 +1,7 @@
+2021-06-17 Mike Frysinger <vapier@gentoo.org>
+
+ * traps.c: Include sim/callback.h.
+
2021-06-16 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
diff --git a/sim/frv/traps.c b/sim/frv/traps.c
index d5cab24..91b424f 100644
--- a/sim/frv/traps.c
+++ b/sim/frv/traps.c
@@ -28,6 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "cgen-engine.h"
#include "cgen-par.h"
#include "sim-fpu.h"
+#include "sim/callback.h"
#include "bfd.h"
#include "libiberty.h"
diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog
index 1d506ff..e12242c 100644
--- a/sim/h8300/ChangeLog
+++ b/sim/h8300/ChangeLog
@@ -1,3 +1,7 @@
+2021-06-17 Mike Frysinger <vapier@gentoo.org>
+
+ * compile.c: Include sim/callback.h.
+
2021-06-16 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 01e9766..8b13326a 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -33,6 +33,7 @@
#include "sys/stat.h"
#include "sys/types.h"
#include "sim-options.h"
+#include "sim/callback.h"
#ifndef SIGTRAP
# define SIGTRAP 5
diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog
index 5b757d0..0c1aa11 100644
--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -1,3 +1,7 @@
+2021-06-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h: Delete sim/callback.h include.
+
2021-06-16 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
diff --git a/sim/m68hc11/sim-main.h b/sim/m68hc11/sim-main.h
index 955c69f..18a7426 100644
--- a/sim/m68hc11/sim-main.h
+++ b/sim/m68hc11/sim-main.h
@@ -28,7 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "opcode/m68hc11.h"
-#include "sim/callback.h"
#include "sim/sim.h"
#include "opcode/m68hc11.h"
#include "sim-types.h"