summaryrefslogtreecommitdiff
path: root/sim/h8300
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2003-06-05 02:18:01 +0000
committerMichael Snyder <msnyder@specifix.com>2003-06-05 02:18:01 +0000
commitecf5988fd21ae04eb98b48af5fb5c5090f4ccc21 (patch)
tree4061f3bc2ed06dc9e778bc1a2cfe222dbc469195 /sim/h8300
parent5691a4e7d9a90f8ef313557975cb443ea6798a3c (diff)
downloadgdb-ecf5988fd21ae04eb98b48af5fb5c5090f4ccc21.tar.gz
2003-06-04 Michael Snyder <msnyder@redhat.com>
* compile.c (sim_info): Fix typo in output. * h8300/compile.c (set_h8300h): Replace 'flag' arguments with a bfd_machine argument, and decode it inline. Check for bfd_mach_h8300hn and bfd_mach_h8300sn.
Diffstat (limited to 'sim/h8300')
-rw-r--r--sim/h8300/ChangeLog4
-rw-r--r--sim/h8300/compile.c22
2 files changed, 14 insertions, 12 deletions
diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog
index b5a2cf83030..e35d2b7eb7c 100644
--- a/sim/h8300/ChangeLog
+++ b/sim/h8300/ChangeLog
@@ -2,6 +2,10 @@
* compile.c (sim_info): Fix typo in output.
+ * h8300/compile.c (set_h8300h): Replace 'flag' arguments
+ with a bfd_machine argument, and decode it inline.
+ Check for bfd_mach_h8300hn and bfd_mach_h8300sn.
+
2003-06-03 Michael Snyder <msnyder@redhat.com>
* compile.c: Add h8300sx insns and addressing modes.
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 33a28f584c0..c71658e5c8b 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -4748,15 +4748,20 @@ sim_info (SIM_DESC sd, int verbose)
FLAG is non-zero for the H8/300H. */
void
-set_h8300h (int h_flag, int s_flag, int sx_flag)
+set_h8300h (unsigned long machine)
{
/* FIXME: Much of the code in sim_load can be moved to sim_open.
This function being replaced by a sim_open:ARGV configuration
option. */
- h8300hmode = h_flag;
- h8300smode = s_flag;
- h8300sxmode = sx_flag;
+ if (machine == bfd_mach_h8300sx)
+ h8300sxmode = 1;
+
+ if (machine == bfd_mach_h8300s || machine == bfd_mach_h8300sn || h8300sxmode)
+ h8300smode = 1;
+
+ if (machine == bfd_mach_h8300h || machine == bfd_mach_h8300hn || h8300smode)
+ h8300hmode = 1;
}
/* Cover function of sim_state_free to free the cpu buffers as well. */
@@ -4873,14 +4878,7 @@ sim_load (SIM_DESC sd, char *prog, bfd *abfd, int from_tty)
and bfd_openr as sim_load_file checks too. */
if (bfd_check_format (prog_bfd, bfd_object))
{
- unsigned long mach = bfd_get_mach (prog_bfd);
-
- set_h8300h (mach == bfd_mach_h8300h ||
- mach == bfd_mach_h8300s ||
- mach == bfd_mach_h8300sx,
- mach == bfd_mach_h8300s ||
- mach == bfd_mach_h8300sx,
- mach == bfd_mach_h8300sx);
+ set_h8300h (bfd_get_mach (prog_bfd));
}
}