Fix crash when mode number fetched from the target is invalid.

git-svn-id: svn://svn.berlios.de/openocd/trunk@667 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
oharboe
2008-05-19 19:02:36 +00:00
parent a76c3433e1
commit 05d143857c
4 changed files with 53 additions and 0 deletions

View File

@@ -1091,6 +1091,10 @@ int xscale_debug_entry(target_t *target)
else
armv4_5->core_state = ARMV4_5_STATE_ARM;
if (armv4_5_mode_to_number(armv4_5->core_mode)==-1)
return ERROR_FAIL;
/* get banked registers, r8 to r14, and spsr if not in USR/SYS mode */
if ((armv4_5->core_mode != ARMV4_5_MODE_USR) && (armv4_5->core_mode != ARMV4_5_MODE_SYS))
{