1 /* front end to the simulator.
3 Written by Steve Chamberlain of Cygnus Support.
6 This file is part of H8/300 sim
9 THIS SOFTWARE IS NOT COPYRIGHTED
11 Cygnus offers the following for use in the public domain. Cygnus
12 makes no warranty with regard to the software or it's performance
13 and the user accepts the software "AS IS" with all faults.
15 CYGNUS DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO
16 THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25 #include "remote-sim.h"
37 bfd_vma start_address;
44 while ((i = getopt (ac, av, "c:htv")) != EOF)
48 sim_csize (atoi (optarg));
71 printf ("run %s\n", name);
73 abfd = bfd_openr (name, "coff-h8300");
76 if (bfd_check_format(abfd, bfd_object))
78 if (abfd->arch_info->mach == bfd_mach_h8300h)
81 for (s = abfd->sections; s; s=s->next)
83 char *buffer = malloc(bfd_section_size(abfd,s));
84 bfd_get_section_contents(abfd, s, buffer, 0, bfd_section_size(abfd,s));
85 sim_write(s->vma, buffer, bfd_section_size(abfd,s));
88 start_address = bfd_get_start_address(abfd);
89 sim_create_inferior (start_address, NULL, NULL);
92 sim_info (verbose - 1);
101 printf_filtered (va_alist)
108 msg = va_arg (args, char *);
109 vfprintf (stdout, msg, args);
116 fprintf (stderr, "usage: run [-tv] program\n");