2 * run front end support for ERC32SIM Copyright (C) 1987, 1992 Free Software
5 * This file is part of ERC32SIM
7 * ERC32SIM is free software; you can redistribute it and/or modify it under the
8 * terms of the GNU General Public License as published by the Free Software
9 * Foundation; either version 2, or (at your option) any later version.
11 * ERC32SIM is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 * You should have received a copy of the GNU General Public License along with
17 * ERC32SIM; see the file COPYING. If not, write to the Free Software
18 * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
30 bfd_vma start_address
;
36 for (i
= 1; i
< ac
; i
++) {
37 if (strcmp(av
[i
], "-v") == 0) {
39 } else if (strcmp(av
[i
], "-t") == 0) {
46 printf("run %s\n", name
);
49 abfd
= bfd_openr(name
, "a.out-sunos-big");
53 if (bfd_check_format(abfd
, bfd_object
)) {
54 for (s
= abfd
->sections
; s
; s
= s
->next
) {
55 char *buffer
= malloc(bfd_section_size(abfd
, s
));
56 bfd_get_section_contents(abfd
, s
, buffer
, 0, bfd_section_size(abfd
, s
));
57 sim_write(s
->vma
, buffer
, bfd_section_size(abfd
, s
));
60 start_address
= bfd_get_start_address(abfd
);
61 sim_create_inferior(start_address
, NULL
, NULL
);
82 printf_filtered(va_alist
)
89 msg
= va_arg(args
, char *);
90 vfprintf(stdout
, msg
, args
);