1 /* run front end support for H8/500
2 Copyright (C) 1987, 1992 Free Software Foundation, Inc.
4 This file is part of H8300 SIM
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
28 #include "remote-sim.h"
30 int target_byte_order
;
38 bfd_vma start_address
;
45 for (i
= 1; i
< ac
; i
++)
47 if (strcmp (av
[i
], "-v") == 0)
51 else if (strcmp (av
[i
], "-t") == 0)
55 else if (strcmp (av
[i
], "-p") == 0)
57 sim_set_profile (atoi (av
[i
+ 1]));
60 else if (strcmp (av
[i
], "-s") == 0)
62 sim_set_profile_size (atoi (av
[i
+ 1]));
65 else if (strcmp (av
[i
], "-m") == 0)
67 sim_size (atoi (av
[i
+ 1]));
77 printf ("run %s\n", name
);
79 abfd
= bfd_openr (name
, 0);
82 if (bfd_check_format (abfd
, bfd_object
))
85 for (s
= abfd
->sections
; s
; s
= s
->next
)
87 unsigned char *buffer
= malloc (bfd_section_size (abfd
, s
));
88 bfd_get_section_contents (abfd
,
92 bfd_section_size (abfd
, s
));
93 sim_write (s
->vma
, buffer
, bfd_section_size (abfd
, s
));
96 start_address
= bfd_get_start_address (abfd
);
97 sim_create_inferior (start_address
, NULL
, NULL
);
99 target_byte_order
= abfd
->xvec
->byteorder_big_p
? 4321 : 1234;
116 /* Assume we left through the exit system call,
117 in which case r5 has the exit code */
120 sim_fetch_register (5, b
);
130 /* Callbacks used by the simulator proper. */
133 printf_filtered (va_alist
)
140 format
= va_arg (args
, char *);
142 vfprintf (stdout
, format
, args
);
This page took 0.032252 seconds and 5 git commands to generate.