diff options
author | Nick Clifton <nickc@redhat.com> | 2001-02-14 22:21:20 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2001-02-14 22:21:20 +0000 |
commit | 5f7d0a33db7af3f11616af2af001cf7dce753eb2 (patch) | |
tree | f4b2522dde1bf5e9194a09b5dbd0ea295b84cda4 /sim/arm | |
parent | 42dc96cab86f70181020e1762b42b79a4bbab8aa (diff) | |
download | gdb-5f7d0a33db7af3f11616af2af001cf7dce753eb2.zip gdb-5f7d0a33db7af3f11616af2af001cf7dce753eb2.tar.gz gdb-5f7d0a33db7af3f11616af2af001cf7dce753eb2.tar.bz2 |
Reset processor into ARM mode for any machine type except the early ARMs.
Diffstat (limited to 'sim/arm')
-rw-r--r-- | sim/arm/ChangeLog | 5 | ||||
-rw-r--r-- | sim/arm/wrapper.c | 27 |
2 files changed, 20 insertions, 12 deletions
diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index a5820c3..32e1056 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,8 @@ +2001-02-14 Nick Clifton <nickc@redhat.com> + + * wrapper.c (sim_create_inferior): Reset processor into ARM mode + for any machine type except the early ARMs. + 2001-02-13 Nick Clifton <nickc@redhat.com> * armos.c (in_SWI_handler): New static variable. diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index f2e5823..242f0bb 100644 --- a/sim/arm/wrapper.c +++ b/sim/arm/wrapper.c @@ -249,37 +249,40 @@ sim_create_inferior (sd, abfd, argv, env) break; } - if (mach > 3) + if ( mach != bfd_mach_arm_3 + && mach != bfd_mach_arm_3M + && mach != bfd_mach_arm_2 + && mach != bfd_mach_arm_2a) { /* Reset mode to ARM. A gdb user may rerun a program that had entered THUMB mode from the start and cause the ARM-mode startup code to be - executed in THUMB mode. */ - ARMul_SetCPSR (state, USER32MODE); + executed in THUMB mode. */ + ARMul_SetCPSR (state, SVC32MODE); } if (argv != NULL) { - /* - ** Set up the command line (by laboriously stringing together the - ** environment carefully picked apart by our caller...) - */ - /* Free any old stuff */ + /* Set up the command line by laboriously stringing together + the environment carefully picked apart by our caller. */ + + /* Free any old stuff. */ if (state->CommandLine != NULL) { free (state->CommandLine); state->CommandLine = NULL; } - /* See how much we need */ + /* See how much we need. */ for (arg = argv; *arg != NULL; arg++) argvlen += strlen (*arg) + 1; - /* allocate it... */ + /* Allocate it. */ state->CommandLine = malloc (argvlen + 1); if (state->CommandLine != NULL) { arg = argv; state->CommandLine[0] = '\0'; + for (arg = argv; *arg != NULL; arg++) { strcat (state->CommandLine, *arg); @@ -290,14 +293,14 @@ sim_create_inferior (sd, abfd, argv, env) if (env != NULL) { - /* Now see if there's a MEMSIZE spec in the environment */ + /* Now see if there's a MEMSIZE spec in the environment. */ while (*env) { if (strncmp (*env, "MEMSIZE=", sizeof ("MEMSIZE=") - 1) == 0) { char *end_of_num; - /* Set up memory limit */ + /* Set up memory limit. */ state->MemSize = strtoul (*env + sizeof ("MEMSIZE=") - 1, &end_of_num, 0); } |