Re: [Openocd-development] dsp56371 crash

2010-02-14 Thread Mathias K.
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


Re: [Openocd-development] dsp56371 crash

2010-02-14 Thread David Brownell
On Sunday 14 February 2010, Mathias K. wrote:
 here the patch to fix the crash and create the reg list.

Merged, thanks.


 Now another Problem with gdb:
 
 User : 340 52745 gdb_server.c:106 gdb_last_signal(): undefined debug reason 6 
 - target needs reset

I think we've seen that before in other contexts.   I think
the issue is along the lines of OpenOCD having a few more
reasons for debug entry than GDB expects ...

One problem case was the OpenOCD has no idea why the
target is now in a debug state.  But ISTR another problem
case was where the target's reason can't be expressed using
the limited vocabulary OpenOCD allows.  (Much less with the
vocabulary GDB supported...)

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


Re: [Openocd-development] dsp56371 crash

2010-02-13 Thread David Brownell
On Saturday 13 February 2010, Austin, Alex wrote:
 openocd segfaults upon connecting to it. I've tracked it down to
 target_get_gdb_reg_list being called when target-type-get_gdb_reg_list
 is null. Tracing back to where the target-type comes from, it never
 gets set in dsp563xx.c, so is null. Why isn't this set?

Good question.  Which GDB version were you using?


 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.

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


Re: [Openocd-development] dsp56371 crash

2010-02-13 Thread Austin, Alex
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.


From: David Brownell [davi...@pacbell.net]
Sent: Saturday, February 13, 2010 5:52 AM
To: openocd-development@lists.berlios.de
Cc: Austin, Alex
Subject: Re: [Openocd-development] dsp56371 crash

On Saturday 13 February 2010, Austin, Alex wrote:
 openocd segfaults upon connecting to it. I've tracked it down to
 target_get_gdb_reg_list being called when target-type-get_gdb_reg_list
 is null. Tracing back to where the target-type comes from, it never
 gets set in dsp563xx.c, so is null. Why isn't this set?

Good question.  Which GDB version were you using?


 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.

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


Re: [Openocd-development] dsp56371 crash

2010-02-13 Thread 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