X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Farmv4_5.c;h=a2f055753bfa1d176af1e90209dd9f3af9a27ac7;hb=80a94681de4c304ed8d550d4da547cdc523d2207;hp=10f84d81248f1369e8badd3f9f0c40a723c78b53;hpb=08d4411b59dd8bd0e7d8009003b71d23acbf6eee;p=openocd.git diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index 10f84d8124..a2f055753b 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -429,7 +429,11 @@ struct reg *arm_reg_current(struct arm *arm, unsigned regnum) if (regnum > 16) return NULL; - r = arm->core_cache->reg_list + arm->map[regnum]; + if (!arm->map) { + LOG_ERROR("Register map is not available yet, the target is not fully initialised"); + r = arm->core_cache->reg_list + regnum; + } else + r = arm->core_cache->reg_list + arm->map[regnum]; /* e.g. invalid CPSR said "secure monitor" mode on a core * that doesn't support it... @@ -1047,7 +1051,8 @@ const struct command_registration arm_command_handlers[] = { }; int arm_get_gdb_reg_list(struct target *target, - struct reg **reg_list[], int *reg_list_size) + struct reg **reg_list[], int *reg_list_size, + enum target_register_class reg_class) { struct arm *arm = target_to_arm(target); int i;