Ticket #30970: openocd_gpacket_bug_patch.diff

File openocd_gpacket_bug_patch.diff, 1.3 KB (added by stuartwesterman (Stuart Westerman), 10 years ago)
  • src/target/armv7m.c

    diff --git a/src/target/armv7m.c b/src/target/armv7m.c
    index 258653e..bbffffd 100644
    a b int armv7m_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int 
    267267       struct armv7m_common *armv7m = target_to_armv7m(target);
    268268       int i;
    269269
    270        *reg_list_size = 26;
     270       *reg_list_size = 17;
    271271       *reg_list = malloc(sizeof(struct reg *) * (*reg_list_size));
    272272
    273273       /*
    int armv7m_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int 
    280280       for (i = 0; i < 16; i++)
    281281               (*reg_list)[i] = &armv7m->core_cache->reg_list[i];
    282282
    283        for (i = 16; i < 24; i++)
    284                (*reg_list)[i] = &arm_gdb_dummy_fp_reg;
    285        (*reg_list)[24] = &arm_gdb_dummy_fps_reg;
    286 
    287283#ifdef ARMV7_GDB_HACKS
    288284       /* use dummy cpsr reg otherwise gdb may try and set the thumb bit */
    289        (*reg_list)[25] = &armv7m_gdb_dummy_cpsr_reg;
     285       (*reg_list)[16] = &armv7m_gdb_dummy_cpsr_reg;
    290286
    291287       /* ARMV7M is always in thumb mode, try to make GDB understand this
    292288        * if it does not support this arch */
    293289       *((char *)armv7m->arm.pc->value) |= 1;
    294290#else
    295        (*reg_list)[25] = &armv7m->core_cache->reg_list[ARMV7M_xPSR];
     291       (*reg_list)[16] = &armv7m->core_cache->reg_list[ARMV7M_xPSR];
    296292#endif
    297293
    298294       return ERROR_OK;