aboutsummaryrefslogtreecommitdiff
path: root/sim/h8300/run.c
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>1993-07-15 17:01:40 +0000
committerDavid Edelsohn <dje.gcc@gmail.com>1993-07-15 17:01:40 +0000
commitcf5b4aa63a7e219290baa1c502ae82218b748e99 (patch)
treef48b954aa7f5caa9633afd514f5ed97bf8b96e60 /sim/h8300/run.c
parentb3a2b4975f604f7c5b4a285eb1034448f9b196c4 (diff)
downloadgdb-cf5b4aa63a7e219290baa1c502ae82218b748e99.zip
gdb-cf5b4aa63a7e219290baa1c502ae82218b748e99.tar.gz
gdb-cf5b4aa63a7e219290baa1c502ae82218b748e99.tar.bz2
* run.c (main): If h8/300h binary detected, call set_h8300h.
* compile.c (sim_resume): Fix O_NEG insn.
Diffstat (limited to 'sim/h8300/run.c')
-rw-r--r--sim/h8300/run.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sim/h8300/run.c b/sim/h8300/run.c
index 5b0f732..3010433 100644
--- a/sim/h8300/run.c
+++ b/sim/h8300/run.c
@@ -56,29 +56,29 @@ main (ac, av)
if (verbose)
printf ("run %s\n", name);
- abfd = bfd_openr (name, "coff-h8300");
- if (abfd)
+ abfd = bfd_openr (name, "coff-h8300");
+ if (abfd)
+ {
+ if (bfd_check_format(abfd, bfd_object))
{
- if (bfd_check_format(abfd, bfd_object))
- {
-
- for (s = abfd->sections; s; s=s->next)
- {
- char *buffer = malloc(bfd_section_size(abfd,s));
- bfd_get_section_contents(abfd, s, buffer, 0, bfd_section_size(abfd,s));
- sim_write(s->vma, buffer, bfd_section_size(abfd,s));
- }
+ if (abfd->arch_info->mach == bfd_mach_h8300h)
+ set_h8300h ();
- start_address = bfd_get_start_address(abfd);
- sim_store_register(
- 9,start_address);
- sim_resume(0,0);
- if (verbose)
- sim_info (verbose);
- return 0;
+ for (s = abfd->sections; s; s=s->next)
+ {
+ char *buffer = malloc(bfd_section_size(abfd,s));
+ bfd_get_section_contents(abfd, s, buffer, 0, bfd_section_size(abfd,s));
+ sim_write(s->vma, buffer, bfd_section_size(abfd,s));
}
+
+ start_address = bfd_get_start_address(abfd);
+ sim_store_register(9,start_address);
+ sim_resume(0,0);
+ if (verbose)
+ sim_info (verbose);
+ return 0;
}
-
+ }
return 1;
}