gdb_server: support gdb target description

* Add a parameter in .get_gdb_reg_list() to return different
  register lists as generating target description.
* Modify STRUCT REG to let gdb generate target description
  according to register information.

The modified structure of register is
struct reg {
        const char *name;
        uint32_t number;  /* for regnum="num" */
        struct reg_feature *feature;  /* for register group feature name */
        bool caller_save;  /* for save-restore="yes|no" */
        void *value;
        bool dirty;
        bool valid;
        bool exist;
        uint32_t size;
        struct reg_data_type *reg_data_type;  /* for type="type" */
        const char *group;  /* for group="general|float|vector" */
        void *arch_info;
        const struct reg_arch_type *type;
};

Change-Id: I2096b67adf94518ba0b8b23d8c6a9f64ad7932b8
Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com>
Reviewed-on: http://openocd.zylin.com/1382
Tested-by: jenkins
Reviewed-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
This commit is contained in:
Hsiangkai Wang
2013-05-07 21:43:35 +08:00
committed by Spencer Oliver
parent 9f2922aa7a
commit d979d78e97
16 changed files with 657 additions and 56 deletions

View File

@@ -114,6 +114,12 @@ struct backoff_timer {
int count;
};
/* split target registers into multiple class */
enum target_register_class {
REG_CLASS_ALL,
REG_CLASS_GENERAL,
};
/* target_type.h contains the full definition of struct target_type */
struct target {
struct target_type *type; /* target type definition (name, access functions) */
@@ -399,7 +405,8 @@ 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,
enum target_register_class reg_class);
/**
* Step the target.