* run.c: Include "getopt.h".

(verbose): Delete.
	(usage): Make static.
	(main): Call arm_sim_set_verbosity.
	Only load sections marked SEC_LOAD.
	* wrapper.c (mem_size, verbosity): New static global.
	(arm_sim_set_mem_size): Renamed from sim_size.
	Callers updated
	(arm_sim_set_profile{,_size}): Renamed from sim_foo.  Callers updated.
This commit is contained in:
David Edelsohn 1995-11-21 01:44:50 +00:00
parent 78570d35b6
commit 6d8e15cbaf
2 changed files with 57 additions and 23 deletions

View file

@ -1,3 +1,34 @@
Mon Nov 20 17:40:38 1995 Doug Evans <dje@canuck.cygnus.com>
* run.c: Include "getopt.h".
(verbose): Delete.
(usage): Make static.
(main): Call arm_sim_set_verbosity.
Only load sections marked SEC_LOAD.
* wrapper.c (mem_size, verbosity): New static global.
(arm_sim_set_mem_size): Renamed from sim_size.
Callers updated
(arm_sim_set_profile{,_size}): Renamed from sim_foo. Callers updated.
Fri Nov 17 19:35:11 1995 Doug Evans <dje@canuck.cygnus.com>
* armdefs.h (ARMul_State): New member `verbose'.
* armrdi.c (ARMul_ConsolePrint): Add missing va_end.
* run.c (verbose): Make global.
* wrapper.c (init): Set state->verbose.
(ARMul_ConsolePrint): Don't print anything if !verbose.
Fri Oct 13 15:30:30 1995 Doug Evans <dje@canuck.cygnus.com>
* armos.c: #include dbg_rdi.h.
(ARMul_OSHandleSWI): Handle SWI_Breakpoint.
* armos.h (SWI_Breakpoint): Define.
* wrapper.c: #include armemu.h, dbg_rdi.h.
(rc): Delete.
(sim_resume): Use state->EndCondition to record stop state.
Call FLUSHPIPE before returning.
(sim_stop_reason): Determine reason from state->EndCondition.
Fri Oct 13 15:04:05 1995 steve chamberlain <sac@slash.cygnus.com> Fri Oct 13 15:04:05 1995 steve chamberlain <sac@slash.cygnus.com>
* wrapper.c (sim_set_callbacks): New. * wrapper.c (sim_set_callbacks): New.

View file

@ -14,9 +14,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with this program; if not, write to the Free Software
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Steve Chamberlain /* Steve Chamberlain
sac@cygnus.com */ sac@cygnus.com */
@ -24,13 +23,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
#include <stdio.h> #include <stdio.h>
#include <varargs.h> #include <varargs.h>
#include "bfd.h" #include "bfd.h"
#include "getopt.h"
#include "remote-sim.h" #include "remote-sim.h"
void usage(); static void usage();
extern int optind;
extern char *optarg;
int verbose = 0;
int target_byte_order; int target_byte_order;
int int
@ -43,25 +40,27 @@ main (ac, av)
asection *s; asection *s;
int i; int i;
int trace = 0; int trace = 0;
char *name = ""; int verbose = 0;
char *name;
while ((i = getopt (ac, av, "m:p:s:tv")) != EOF) while ((i = getopt (ac, av, "m:p:s:tv")) != EOF)
switch (i) switch (i)
{ {
case 'm': case 'm':
sim_size (atoi (optarg)); arm_sim_set_mem_size (atoi (optarg));
break; break;
case 'p': case 'p': /* FIXME: unused */
sim_set_profile (atoi (optarg)); arm_sim_set_profile (atoi (optarg));
break; break;
case 's': case 's': /* FIXME: unused */
sim_set_profile_size (atoi (optarg)); arm_sim_set_profile_size (atoi (optarg));
break; break;
case 't': case 't':
trace = 1; trace = 1;
break; break;
case 'v': case 'v':
verbose = 1; verbose = 1;
arm_sim_set_verbosity (1);
break; break;
default: default:
usage(); usage();
@ -78,21 +77,25 @@ main (ac, av)
{ {
printf ("run %s\n", name); printf ("run %s\n", name);
} }
abfd = bfd_openr (name, 0); abfd = bfd_openr (name, 0);
if (abfd) if (abfd)
{ {
if (bfd_check_format (abfd, bfd_object)) if (bfd_check_format (abfd, bfd_object))
{ {
for (s = abfd->sections; s; s = s->next) for (s = abfd->sections; s; s = s->next)
{ {
unsigned char *buffer = malloc (bfd_section_size (abfd, s)); if (s->flags & SEC_LOAD)
bfd_get_section_contents (abfd, {
s, unsigned char *buffer = malloc (bfd_section_size (abfd, s));
buffer, bfd_get_section_contents (abfd,
0, s,
bfd_section_size (abfd, s)); buffer,
sim_write (s->vma, buffer, bfd_section_size (abfd, s)); 0,
bfd_section_size (abfd, s));
sim_write (s->vma, buffer, bfd_section_size (abfd, s));
free (buffer);
}
} }
start_address = bfd_get_start_address (abfd); start_address = bfd_get_start_address (abfd);
@ -117,19 +120,19 @@ main (ac, av)
/* Assume we left through the exit system call, /* Assume we left through the exit system call,
in which case r0 has the exit code */ in which case r0 has the exit code */
/* FIXME: byte order dependent? */
{ {
unsigned char b[4]; unsigned char b[4];
sim_fetch_register (0, b); sim_fetch_register (0, b);
return b[0]; return b[0];
} }
} }
} }
return 1; return 1;
} }
void static void
usage() usage()
{ {
fprintf (stderr, "usage: run [-tv] program\n"); fprintf (stderr, "usage: run [-tv] program\n");