diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-05-19 12:39:06 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-05-19 12:39:06 +0000 |
commit | 454b0a65e6addf87c12da37bb4121d330aec262c (patch) | |
tree | 6574a165dd8456c450b1e0d531055b53d198e997 | |
parent | 552244724c5a88fb1a9d47750450fbfa3d9badba (diff) | |
download | openocd_libswd-454b0a65e6addf87c12da37bb4121d330aec262c.tar.gz openocd_libswd-454b0a65e6addf87c12da37bb4121d330aec262c.tar.bz2 openocd_libswd-454b0a65e6addf87c12da37bb4121d330aec262c.tar.xz openocd_libswd-454b0a65e6addf87c12da37bb4121d330aec262c.zip |
fix mode output when illegal arm mode is detected. Now prints illegal mode for index -1.
git-svn-id: svn://svn.berlios.de/openocd/trunk@664 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r-- | src/target/armv4_5.c | 7 | ||||
-rw-r--r-- | src/target/armv4_5.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index cb5f8758..264a4437 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -70,11 +70,14 @@ char* armv4_5_core_reg_list[] = "cpsr", "spsr_fiq", "spsr_irq", "spsr_svc", "spsr_abt", "spsr_und" }; -char* armv4_5_mode_strings[] = +char * armv4_5_mode_strings_list[] = { - "User", "FIQ", "IRQ", "Supervisor", "Abort", "Undefined", "System" + "Illegal mode value", "User", "FIQ", "IRQ", "Supervisor", "Abort", "Undefined", "System" }; +/* Hack! Yuk! allow -1 index, which simplifies codepaths elsewhere in the code */ +char** armv4_5_mode_strings = armv4_5_mode_strings_list+1; + char* armv4_5_state_strings[] = { "ARM", "Thumb", "Jazelle" diff --git a/src/target/armv4_5.h b/src/target/armv4_5.h index 51f42b9b..3868fa38 100644 --- a/src/target/armv4_5.h +++ b/src/target/armv4_5.h @@ -36,7 +36,7 @@ typedef enum armv4_5_mode ARMV4_5_MODE_ANY = -1 } armv4_5_mode_t; -extern char* armv4_5_mode_strings[]; +extern char** armv4_5_mode_strings; typedef enum armv4_5_state { |