Hello,

here the patch to fix the crash and create the reg list.

Now another Problem with gdb:

User : 340 52745 gdb_server.c:106 gdb_last_signal(): undefined debug reason 6 - 
target needs reset


Regards,

Mathias

Am 14.02.2010 07:33, schrieb David Brownell:
> On Saturday 13 February 2010, Austin, Alex wrote:
>> The GDB in question is the gdb56300.exe provided by freescale, running
>> under WINE. I had the source for it at one time, but I've somehow managed
>> to misplace it.
> 
> Yeah, that's what you'd want to have OpenOCD work with.
> 
> 
>>
>>
>>> If it's not
>>> supposed to be set, why is target_get_gdb_reg_list being called?
>>
>> Another good question.  It shouldn't crash, regardless.
>>
>> Could you maybe come up with a quick patch to prevent 0.4.0 from
>> crashing?  I don't know that you'd be able to talk with GDB
>> without that support.
> 
> That is, eventually there should be two patches:
> 
>  (1) anti-crash patch
>  (2) actual support for returning the relevant registers.
> _______________________________________________
> Openocd-development mailing list
> Openocd-development@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/openocd-development
> 

From: Mathias Kuester <mkd...@users.sourceforge.net>
Subject: [PATCH] - fix crash

---
 src/target/dsp563xx.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/src/target/dsp563xx.c b/src/target/dsp563xx.c
index 9e2f609..7b96902 100644
--- a/src/target/dsp563xx.c
+++ b/src/target/dsp563xx.c
@@ -246,6 +246,29 @@ static const struct
 	/* *INDENT-ON* */
 };
 
+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,
-- 
1.6.6.1

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to