On 02/12/2010 12:21, Martin Davey wrote:
Hello,

I just upgraded to the latest CodeSourcery g++ lite, 2010.09-51. Recent
build of OpenOCD 02/12/2010.

After upgrading the compiler, I now get the error Remote 'g' packet is
too long. Output from arm-none-eabi-gdb:

file bin/xxx.elf
target remote localhost:2000
Remote 'g' packet is too long:
c8000000b0c0002084000000c8000000102002400c2002400cdc4061e8ff002010238238d7ba0078a0c39d04d74113d00000000000000120ffffffffe12c02080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000001

Not sure whether the problem lies with CodeSourcery or with OpenOCD.
Using Eclipse, but same happens on the command line.


Looks like this is a mixture between a change in codesoucery gdb and openocd.

This patch seems to fix the problem, but it has not been fully tested and it will break all other versions of gdb - including mainline.
So this is for testing only.

The real fix would be to support "qXfer:features:read:" but that involves a bit of work.

Cheers
Spen
diff --git a/src/target/armv7m.c b/src/target/armv7m.c
index 03c9c7a..3e05f03 100644
--- a/src/target/armv7m.c
+++ b/src/target/armv7m.c
@@ -254,7 +254,7 @@ int armv7m_get_gdb_reg_list(struct target *target, struct 
reg **reg_list[], int
        struct armv7m_common *armv7m = target_to_armv7m(target);
        int i;
 
-       *reg_list_size = 26;
+       *reg_list_size = 17;
        *reg_list = malloc(sizeof(struct reg*) * (*reg_list_size));
 
        /*
@@ -264,26 +264,11 @@ int armv7m_get_gdb_reg_list(struct target *target, struct 
reg **reg_list[], int
         *  - (obsolete) FPA status
         *  - CPSR
         */
-       for (i = 0; i < 16; i++)
+       for (i = 0; i < 17; i++)
        {
                (*reg_list)[i] = &armv7m->core_cache->reg_list[i];
        }
 
-       for (i = 16; i < 24; i++)
-               (*reg_list)[i] = &arm_gdb_dummy_fp_reg;
-       (*reg_list)[24] = &arm_gdb_dummy_fps_reg;
-
-#ifdef ARMV7_GDB_HACKS
-       /* use dummy cpsr reg otherwise gdb may try and set the thumb bit */
-       (*reg_list)[25] = &armv7m_gdb_dummy_cpsr_reg;
-
-       /* ARMV7M is always in thumb mode, try to make GDB understand this
-        * if it does not support this arch */
-       *((char*)armv7m->arm.pc->value) |= 1;
-#else
-       (*reg_list)[25] = &armv7m->core_cache->reg_list[ARMV7M_xPSR];
-#endif
-
        return ERROR_OK;
 }
 
diff --git a/src/target/armv7m.h b/src/target/armv7m.h
index 8ef3800..0e86a30 100644
--- a/src/target/armv7m.h
+++ b/src/target/armv7m.h
@@ -30,7 +30,7 @@
 #include "arm.h"
 
 /* define for enabling armv7 gdb workarounds */
-#if 1
+#if 0
 #define ARMV7_GDB_HACKS
 #endif
 
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to