fix crash with DSP563XX
authorMathias Kuester <mkdorg@users.sourceforge.net>
Sun, 14 Feb 2010 20:59:10 +0000 (12:59 -0800)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Sun, 14 Feb 2010 20:59:10 +0000 (12:59 -0800)
When a DSP563xx-aware GDB asks OpenOCD for target registers,
the result should be a GDB with register data ... not an
OpenOCD crash.

(Note that mainline GDB doesn't currently support this core,
so for now, this requires a GDB with FreeScale patches.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/target/dsp563xx.c

index 9e2f6093986cead169e5124470ff74ad5f156170..049ee1a780e436ad93e530766fb86f72bbe5eafc 100644 (file)
@@ -246,6 +246,29 @@ static const struct
        /* *INDENT-ON* */
 };
 
+static int dsp563xx_get_gdb_reg_list(struct target *target, struct reg **reg_list[],
+                             int *reg_list_size)
+{
+       struct dsp563xx_common *dsp563xx = target_to_dsp563xx(target);
+       int i;
+
+       if (target->state != TARGET_HALTED)
+       {
+               return ERROR_TARGET_NOT_HALTED;
+       }
+
+       *reg_list_size = DSP563XX_NUMCOREREGS;
+       *reg_list = malloc(sizeof(struct reg *) * (*reg_list_size));
+
+       for (i = 0; i < DSP563XX_NUMCOREREGS; i++)
+       {
+               (*reg_list)[i] = &dsp563xx->core_cache->reg_list[i];
+       }
+
+       return ERROR_OK;
+
+}
+
 int dsp563xx_read_core_reg(struct target *target, int num)
 {
        uint32_t reg_value;
@@ -974,6 +997,8 @@ struct target_type dsp563xx_target = {
 
        .target_request_data = NULL,
 
+       .get_gdb_reg_list = dsp563xx_get_gdb_reg_list,
+
        .halt = dsp563xx_halt,
        .resume = dsp563xx_resume,
        .step = dsp563xx_step,

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)