diff options
author | Nick Clifton <nickc@redhat.com> | 2002-01-09 14:59:22 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2002-01-09 14:59:22 +0000 |
commit | 0088c07699b98106470e4194405d029c0ab480f6 (patch) | |
tree | 6cc1b0bce2aa51dc7a0bc62fef74cfc38929456a /sim/arm | |
parent | 25a8a418a5617446daf1fe7d41de902ac1bc8f16 (diff) | |
download | gdb-0088c07699b98106470e4194405d029c0ab480f6.tar.gz |
Fix bug detected by GDB testsuite - when fetching registers more than 4
bytes wide return 0 for the other bytes.
Diffstat (limited to 'sim/arm')
-rw-r--r-- | sim/arm/ChangeLog | 5 | ||||
-rw-r--r-- | sim/arm/wrapper.c | 19 |
2 files changed, 19 insertions, 5 deletions
diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index 901d52e85b5..8bd0502b328 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,8 @@ +2002-01-09 Nick Clifton <nickc@cambridge.redhat.com> + + * wrapper.c (sim_fetch_register): If fetching more than 4 bytes + return zeroes in the other words. + 2001-11-16 Ben Harris <bjh21@netbsd.org> * Makefile.in (armemu32.o): Replace $< with autoconf recommended diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index 877f7fbfd6f..0c49666aec9 100644 --- a/sim/arm/wrapper.c +++ b/sim/arm/wrapper.c @@ -220,6 +220,10 @@ sim_create_inferior (sd, abfd, argv, env) /* We wouldn't set the machine type with earlier toolchains, so we explicitly select a processor capable of supporting all ARMs in 32bit mode. */ + case bfd_mach_arm_XScale: + ARMul_SelectProcessor (state, ARM_v5_Prop | ARM_v5e_Prop | ARM_XScale_Prop); + break; + case bfd_mach_arm_5: case bfd_mach_arm_5T: ARMul_SelectProcessor (state, ARM_v5_Prop); @@ -229,10 +233,6 @@ sim_create_inferior (sd, abfd, argv, env) ARMul_SelectProcessor (state, ARM_v5_Prop | ARM_v5e_Prop); break; - case bfd_mach_arm_XScale: - ARMul_SelectProcessor (state, ARM_v5_Prop | ARM_v5e_Prop | ARM_XScale_Prop); - break; - case bfd_mach_arm_4: case bfd_mach_arm_4T: ARMul_SelectProcessor (state, ARM_v4_Prop); @@ -395,7 +395,16 @@ sim_fetch_register (sd, rn, memory, length) regval = ARMul_GetCPSR (state); else regval = 0; /* FIXME: should report an error */ - tomem (state, memory, regval); + + while (length) + { + tomem (state, memory, regval); + + length -= 4; + memory += 4; + regval = 0; + } + return -1; } |