Fix register array sizes.

This commit is contained in:
Gareth McMullin 2013-06-17 15:46:26 +12:00
parent df32aad757
commit 2d63dd4b5b
4 changed files with 7 additions and 7 deletions

View File

@ -667,7 +667,7 @@ static int cortexm_fault_unwind(struct target_s *target)
* for a configurable fault to avoid catching core resets */
if((hfsr & CORTEXM_HFSR_FORCED) || cfsr) {
/* Unwind exception */
uint32_t regs[target->regs_size];
uint32_t regs[target->regs_size / 4];
uint32_t stack[8];
uint32_t retcode, framesize;
/* Read registers for post-exception stack pointer */

View File

@ -88,8 +88,8 @@ gdb_main(void)
/* Implementation of these is mandatory! */
case 'g': { /* 'g': Read general registers */
ERROR_IF_NO_TARGET();
uint32_t arm_regs[cur_target->regs_size];
target_regs_read(cur_target, (void*)arm_regs);
uint8_t arm_regs[cur_target->regs_size];
target_regs_read(cur_target, arm_regs);
gdb_putpacket(hexify(pbuf, (void*)arm_regs, cur_target->regs_size), cur_target->regs_size * 2);
break;
}
@ -111,8 +111,8 @@ gdb_main(void)
}
case 'G': { /* 'G XX': Write general registers */
ERROR_IF_NO_TARGET();
uint32_t arm_regs[cur_target->regs_size];
unhexify((void*)arm_regs, &pbuf[1], cur_target->regs_size);
uint8_t arm_regs[cur_target->regs_size];
unhexify(arm_regs, &pbuf[1], cur_target->regs_size);
target_regs_write(cur_target, arm_regs);
gdb_putpacketz("OK");
break;

View File

@ -313,7 +313,7 @@ static int32_t sector_number(uint32_t addr)
static void lpc43xx_iap_call(struct target_s *target, struct flash_param *param, unsigned param_len)
{
uint32_t regs[target->regs_size];
uint32_t regs[target->regs_size / 4];
uint32_t iap_entry;
target_mem_read_words(target, &iap_entry, IAP_ENTRYPOINT_LOCATION, sizeof(iap_entry));

View File

@ -116,7 +116,7 @@ lpc11xx_probe(struct target_s *target)
static void
lpc11x_iap_call(struct target_s *target, struct flash_param *param, unsigned param_len)
{
uint32_t regs[target->regs_size];
uint32_t regs[target->regs_size / 4];
/* fill out the remainder of the parameters and copy the structure to RAM */
param->opcodes[0] = 0xbe00;