This is an automated email from Gerrit.

Franck Jullien ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/1089

-- gerrit

commit a03362dff659555d7dc9034e9515a483f17516d8
Author: Franck Jullien <[email protected]>
Date:   Sun Dec 23 22:47:27 2012 +0100

    target: add a parameter to get_gdb_reg_list
    
    Some architectures would reply to 'g' RSP commands
    with a limited set of their register list.
    
    For example, on the OpenRisc target (still not official
    for now), the register list has more than 2000 elements.
    This is because it handles SPR (special purpose registers).
    Those SPR are accessed with p/P RSP commands, that's why
    the register list returned by get_gdb_reg_list should not
    be the same depending of the caller situation. As a matter
    of fact, we don't want the 'g' reply to be too long.
    
    This patch adds a parameter to the get_gdb_reg_list function
    and defines two constant for this parameter: FULL_LIST and
    G_REGISTERS_LIST.
    
    This new parameter is not used in currents targets. This is
    a preparation for the OpenRisc target.
    
    Change-Id: I746d09c796fdec3e9dae3e8425ef9856b785c0e9
    Signed-off-by: Franck Jullien <[email protected]>

diff --git a/src/rtos/linux.c b/src/rtos/linux.c
index 9c95597..18e557f 100644
--- a/src/rtos/linux.c
+++ b/src/rtos/linux.c
@@ -226,7 +226,7 @@ static int linux_os_thread_reg_list(struct rtos *rtos,
                /*LOG_INFO("thread %lx current on core %x",thread_id,
                 * target->coreid);*/
                retval =
-                       target_get_gdb_reg_list(target, &reg_list, 
&reg_list_size);
+                       target_get_gdb_reg_list(target, &reg_list, 
&reg_list_size, G_REGISTERS_LIST);
 
                if (retval != ERROR_OK)
                        return retval;
@@ -496,7 +496,7 @@ int get_current(struct target *target, int create)
                int retval;
 
                if (target_get_gdb_reg_list(head->target, &reg_list,
-                               &reg_list_size) != ERROR_OK) {
+                               &reg_list_size, G_REGISTERS_LIST) != ERROR_OK) {
                        free(buffer);
                        return ERROR_TARGET_FAILURE;
                }
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index ee7683a..0c67ac0 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -986,7 +986,7 @@ static int gdb_get_registers_packet(struct connection 
*connection,
        if ((target->rtos != NULL) && (ERROR_OK == 
rtos_get_gdb_reg_list(connection)))
                return ERROR_OK;
 
-       retval = target_get_gdb_reg_list(target, &reg_list, &reg_list_size);
+       retval = target_get_gdb_reg_list(target, &reg_list, &reg_list_size, 
G_REGISTERS_LIST);
        if (retval != ERROR_OK)
                return gdb_error(connection, retval);
 
@@ -1045,7 +1045,7 @@ static int gdb_set_registers_packet(struct connection 
*connection,
                return ERROR_SERVER_REMOTE_CLOSED;
        }
 
-       retval = target_get_gdb_reg_list(target, &reg_list, &reg_list_size);
+       retval = target_get_gdb_reg_list(target, &reg_list, &reg_list_size, 
G_REGISTERS_LIST);
        if (retval != ERROR_OK)
                return gdb_error(connection, retval);
 
@@ -1090,7 +1090,7 @@ static int gdb_get_register_packet(struct connection 
*connection,
        LOG_DEBUG("-");
 #endif
 
-       retval = target_get_gdb_reg_list(target, &reg_list, &reg_list_size);
+       retval = target_get_gdb_reg_list(target, &reg_list, &reg_list_size, 
FULL_LIST);
        if (retval != ERROR_OK)
                return gdb_error(connection, retval);
 
@@ -1127,7 +1127,7 @@ static int gdb_set_register_packet(struct connection 
*connection,
 
        LOG_DEBUG("-");
 
-       retval = target_get_gdb_reg_list(target, &reg_list, &reg_list_size);
+       retval = target_get_gdb_reg_list(target, &reg_list, &reg_list_size, 
FULL_LIST);
        if (retval != ERROR_OK)
                return gdb_error(connection, retval);
 
diff --git a/src/target/arm.h b/src/target/arm.h
index 916b321..19f1074 100644
--- a/src/target/arm.h
+++ b/src/target/arm.h
@@ -211,7 +211,7 @@ extern const struct command_registration 
arm_command_handlers[];
 
 int arm_arch_state(struct target *target);
 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, int list_type);
 
 int arm_init_arch_info(struct target *target, struct arm *arm);
 
diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c
index 7ba2deb..5c249e4 100644
--- a/src/target/armv4_5.c
+++ b/src/target/armv4_5.c
@@ -1032,7 +1032,7 @@ 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, int list_type)
 {
        struct arm *arm = target_to_arm(target);
        int i;
diff --git a/src/target/armv7m.c b/src/target/armv7m.c
index 8915711..7f93cff 100644
--- a/src/target/armv7m.c
+++ b/src/target/armv7m.c
@@ -262,7 +262,8 @@ static int armv7m_write_core_reg(struct target *target, 
unsigned num)
  * hardware, so this also fakes a set of long-obsolete FPA registers that
  * are not used in EABI based software stacks.
  */
-int armv7m_get_gdb_reg_list(struct target *target, struct reg **reg_list[], 
int *reg_list_size)
+int armv7m_get_gdb_reg_list(struct target *target, struct reg **reg_list[],
+                           int *reg_list_size, int list_type)
 {
        struct armv7m_common *armv7m = target_to_armv7m(target);
        int i;
diff --git a/src/target/armv7m.h b/src/target/armv7m.h
index bcf0ee1..d443c43 100644
--- a/src/target/armv7m.h
+++ b/src/target/armv7m.h
@@ -224,7 +224,7 @@ int armv7m_mode_to_number(enum armv7m_mode mode);
 
 int armv7m_arch_state(struct target *target);
 int armv7m_get_gdb_reg_list(struct target *target,
-               struct reg **reg_list[], int *reg_list_size);
+               struct reg **reg_list[], int *reg_list_size, int list_type);
 
 int armv7m_init_arch_info(struct target *target, struct armv7m_common *armv7m);
 
diff --git a/src/target/avr32_ap7k.c b/src/target/avr32_ap7k.c
index c8f0f8e..c7e49ef 100644
--- a/src/target/avr32_ap7k.c
+++ b/src/target/avr32_ap7k.c
@@ -585,7 +585,8 @@ int avr32_ap7k_arch_state(struct target *target)
        return ERROR_OK;
 }
 
-int avr32_ap7k_get_gdb_reg_list(struct target *target, struct reg 
**reg_list[], int *reg_list_size)
+int avr32_ap7k_get_gdb_reg_list(struct target *target, struct reg **reg_list[],
+                               int *reg_list_size, int list_type)
 {
 #if 0
        /* get pointers to arch-specific information */
diff --git a/src/target/dsp563xx.c b/src/target/dsp563xx.c
index 1d703ee..766931f 100644
--- a/src/target/dsp563xx.c
+++ b/src/target/dsp563xx.c
@@ -322,8 +322,7 @@ uint8_t gdb_reg_list_idx[] = {
 };
 
 static int dsp563xx_get_gdb_reg_list(struct target *target,
-       struct reg **reg_list[],
-       int *reg_list_size)
+       struct reg **reg_list[], int *reg_list_size, int list_type)
 {
        int i;
        struct dsp563xx_common *dsp563xx = target_to_dsp563xx(target);
diff --git a/src/target/mips32.c b/src/target/mips32.c
index ab39e6e..b32f649 100644
--- a/src/target/mips32.c
+++ b/src/target/mips32.c
@@ -173,7 +173,8 @@ static int mips32_write_core_reg(struct target *target, int 
num)
        return ERROR_OK;
 }
 
-int mips32_get_gdb_reg_list(struct target *target, struct reg **reg_list[], 
int *reg_list_size)
+int mips32_get_gdb_reg_list(struct target *target, struct reg **reg_list[],
+                           int *reg_list_size, int list_type)
 {
        /* get pointers to arch-specific information */
        struct mips32_common *mips32 = target_to_mips32(target);
diff --git a/src/target/mips32.h b/src/target/mips32.h
index 0bdfc59..35f0d65 100644
--- a/src/target/mips32.h
+++ b/src/target/mips32.h
@@ -241,7 +241,7 @@ int mips32_examine(struct target *target);
 int mips32_register_commands(struct command_context *cmd_ctx);
 
 int mips32_get_gdb_reg_list(struct target *target,
-               struct reg **reg_list[], int *reg_list_size);
+               struct reg **reg_list[], int *reg_list_size, int list_type);
 int mips32_checksum_memory(struct target *target, uint32_t address,
                uint32_t count, uint32_t *checksum);
 int mips32_blank_check_memory(struct target *target,
diff --git a/src/target/target.c b/src/target/target.c
index 6d3a99d..ed392e7 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -1030,9 +1030,9 @@ int target_remove_watchpoint(struct target *target,
 }
 
 int target_get_gdb_reg_list(struct target *target,
-               struct reg **reg_list[], int *reg_list_size)
+               struct reg **reg_list[], int *reg_list_size, int list_type)
 {
-       return target->type->get_gdb_reg_list(target, reg_list, reg_list_size);
+       return target->type->get_gdb_reg_list(target, reg_list, reg_list_size, 
list_type);
 }
 int target_step(struct target *target,
                int current, uint32_t address, int handle_breakpoints)
diff --git a/src/target/target.h b/src/target/target.h
index 9707bcc..6771c21 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -33,6 +33,10 @@
 #ifndef TARGET_H
 #define TARGET_H
 
+/* Values for target_get_gdb_reg_list list_type */
+#define FULL_LIST              0
+#define G_REGISTERS_LIST       1
+
 struct reg;
 struct trace;
 struct command_context;
@@ -393,7 +397,7 @@ int target_remove_watchpoint(struct target *target,
  * This routine is a wrapper for target->type->get_gdb_reg_list.
  */
 int target_get_gdb_reg_list(struct target *target,
-               struct reg **reg_list[], int *reg_list_size);
+               struct reg **reg_list[], int *reg_list_size, int list_type);
 
 /**
  * Step the target.
diff --git a/src/target/target_type.h b/src/target/target_type.h
index 7eacd7f..10ccd8b 100644
--- a/src/target/target_type.h
+++ b/src/target/target_type.h
@@ -101,7 +101,7 @@ struct target_type {
         * list, however it is after GDB is connected that monitor commands can
         * be run to properly initialize the target
         */
-       int (*get_gdb_reg_list)(struct target *target, struct reg **reg_list[], 
int *reg_list_size);
+       int (*get_gdb_reg_list)(struct target *target, struct reg **reg_list[], 
int *reg_list_size, int list_type);
 
        /* target memory access
        * size: 1 = byte (8bit), 2 = half-word (16bit), 4 = word (32bit)

-- 

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to