- gdb server was incorrectly sending null terminator on qXfer:features:read: packet
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sat, 22 Mar 2008 14:19:46 +0000 (14:19 +0000)
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sat, 22 Mar 2008 14:19:46 +0000 (14:19 +0000)
- armv7m now sends correct gdb register packet

git-svn-id: svn://svn.berlios.de/openocd/trunk@522 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/server/gdb_server.c
src/target/armv7m.c

index a81b3345f796c79147be0fc54f8024aa9f7689ca..b3c6c9f585c5465d0537dcdcd5991ec8a105131a 100644 (file)
@@ -1616,7 +1616,7 @@ int gdb_query_packet(connection_t *connection, target_t *target, char *packet, i
                        return retval;
                }
 
-               gdb_put_packet(connection, xml, strlen(xml) + 1);
+               gdb_put_packet(connection, xml, strlen(xml));
 
                free(xml);
                return ERROR_OK;
index e3e9d1ce6459ff94423f9168c8b665cc4ca6bca3..e2134420a8333a1cf865e9276eb16baef91648d9 100644 (file)
@@ -85,6 +85,13 @@ reg_t armv7m_gdb_dummy_fp_reg =
        "GDB dummy floating-point register", armv7m_gdb_dummy_fp_value, 0, 1, 96, NULL, 0, NULL, 0
 };
 
+u8 armv7m_gdb_dummy_fps_value[] = {0, 0, 0, 0};
+
+reg_t armv7m_gdb_dummy_fps_reg =
+{
+       "GDB dummy floating-point status register", armv7m_gdb_dummy_fps_value, 0, 1, 32, NULL, 0, NULL, 0
+};
+
 armv7m_core_reg_t armv7m_core_reg_list_arch_info[] = 
 {
        /*  CORE_GP are accesible using the core debug registers */
@@ -324,15 +331,20 @@ int armv7m_get_gdb_reg_list(target_t *target, reg_t **reg_list[], int *reg_list_
        *reg_list_size = 26;
        *reg_list = malloc(sizeof(reg_t*) * (*reg_list_size));
        
-       /* TODOLATER correct list of registers, names ? */
-       for (i = 0; i < *reg_list_size; i++)
+       for (i = 0; i < 16; i++)
        {
-               if (i < ARMV7NUMCOREREGS)
-                       (*reg_list)[i] = &armv7m->process_context->reg_list[i];
-               else
-                       (*reg_list)[i] = &armv7m_gdb_dummy_fp_reg;
+               (*reg_list)[i] = &armv7m->process_context->reg_list[i];
        }
-       /* ARMV7M is always in thumb mode, try to make GDB understand this if it does not support this arch */
+       
+       for (i = 16; i < 24; i++)
+       {
+               (*reg_list)[i] = &armv7m_gdb_dummy_fp_reg;
+       }
+       
+       (*reg_list)[24] = &armv7m_gdb_dummy_fps_reg;
+       
+       /* ARMV7M is always in thumb mode, try to make GDB understand this
+        * if it does not support this arch */
        armv7m->process_context->reg_list[15].value[0] |= 1;    
        (*reg_list)[25] = &armv7m->process_context->reg_list[ARMV7M_xPSR];      
        return ERROR_OK;