Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Need some help with xtensa processor
@ 2016-08-17  0:02 Ben Greear
  2016-08-17  0:11 ` Sterling Augustine
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Greear @ 2016-08-17  0:02 UTC (permalink / raw)
  To: gdb

Hello!

I'm working on a closed source (not my decision) project that uses
an xtensa cpu.  I have no jtag access to this board, but I can pass
messages, including grabbing 'logs' and stack traces on crash, and so forth.

Currently, I have narrowed down a bug to a wild write on a structure of
method pointers.  Next time code tries to execute one of these methods,
it crashes spectacularly.

So, I wanted to tell the processor to set a watchpoint on this address, and
then assert or otherwise give me an ability to grab the program counter, stack,
etc, when something writes on the memory.

I think I know how to set the BREAKA, BREAKC registers, but I must be missing something
related perhaps to setting up a proper exception vector handler for this?  Whatever
the cause, I can scribble on memory after setting the watchpoint and nothing useful
happens.

So, I'd appreciate pointers if someone has some ideas.  And, if someone wants to
work on this for pay, please contact me off-list.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Need some help with xtensa processor
  2016-08-17  0:02 Need some help with xtensa processor Ben Greear
@ 2016-08-17  0:11 ` Sterling Augustine
  2016-08-17  0:22   ` Ben Greear
  0 siblings, 1 reply; 5+ messages in thread
From: Sterling Augustine @ 2016-08-17  0:11 UTC (permalink / raw)
  To: Ben Greear; +Cc: gdb

On Tue, Aug 16, 2016 at 5:01 PM, Ben Greear <greearb@candelatech.com> wrote:
>
> Hello!
>
> I'm working on a closed source (not my decision) project that uses
> an xtensa cpu.  I have no jtag access to this board, but I can pass
> messages, including grabbing 'logs' and stack traces on crash, and so forth.

Can the Cadence people not help you?

If you have a copy of the ISA book or the programmer's book, then I
believe they have explanations on how to set the registers as well.

Failing all that, then your best bet it to look at the gdb sources and
see how it is done.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Need some help with xtensa processor
  2016-08-17  0:11 ` Sterling Augustine
@ 2016-08-17  0:22   ` Ben Greear
  0 siblings, 0 replies; 5+ messages in thread
From: Ben Greear @ 2016-08-17  0:22 UTC (permalink / raw)
  To: Sterling Augustine; +Cc: gdb

On 08/16/2016 05:11 PM, Sterling Augustine wrote:
> On Tue, Aug 16, 2016 at 5:01 PM, Ben Greear <greearb@candelatech.com> wrote:
>>
>> Hello!
>>
>> I'm working on a closed source (not my decision) project that uses
>> an xtensa cpu.  I have no jtag access to this board, but I can pass
>> messages, including grabbing 'logs' and stack traces on crash, and so forth.
>
> Can the Cadence people not help you?
>
> If you have a copy of the ISA book or the programmer's book, then I
> believe they have explanations on how to set the registers as well.
>
> Failing all that, then your best bet it to look at the gdb sources and
> see how it is done.

Cadence probably could, but I don't think I rate high enough for them to care.

I have the ISA book, and you can find it online, and I think I am close,
but I must be missing something.  I suspect it is the exception vector...trying
to figure out how to set that now.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Need some help with xtensa processor
  2016-09-01  4:23 doark
@ 2016-09-01 14:18 ` Ben Greear
  0 siblings, 0 replies; 5+ messages in thread
From: Ben Greear @ 2016-09-01 14:18 UTC (permalink / raw)
  To: doark, gdb



On 08/31/2016 09:20 PM, doark@mail.com wrote:
> On 08/16/16(Tue) 20:01 <greearb@candelatech.com> wrote:
>> Hello!
>>
>> I'm working on a closed source (not my decision) project that uses
>> an xtensa cpu.  I have no jtag access to this board, but I can pass
>> messages, including grabbing 'logs' and stack traces on crash, and so
>> forth.
>>
>> Currently, I have narrowed down a bug to a wild write on a structure of
>> method pointers.  Next time code tries to execute one of these methods,
>> it crashes spectacularly.
>
> It's been about a two weeks, did you ever solve the issue?
> It might be helpful to others with similar problems (you don't need to
> provide identifying information).

I could never get it working.  My problem is likely that I do not know how to
write the assembly that creates and assigns the exception vector.

In the end, it was easier to track down the problem by adding asserts
and debug statements...

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Need some help with xtensa processor
@ 2016-09-01  4:23 doark
  2016-09-01 14:18 ` Ben Greear
  0 siblings, 1 reply; 5+ messages in thread
From: doark @ 2016-09-01  4:23 UTC (permalink / raw)
  To: gdb; +Cc: Ben Greear

On 08/16/16(Tue) 20:01 <greearb@candelatech.com> wrote:
> Hello!
> 
> I'm working on a closed source (not my decision) project that uses
> an xtensa cpu.  I have no jtag access to this board, but I can pass
> messages, including grabbing 'logs' and stack traces on crash, and so
> forth.
> 
> Currently, I have narrowed down a bug to a wild write on a structure of
> method pointers.  Next time code tries to execute one of these methods,
> it crashes spectacularly.

It's been about a two weeks, did you ever solve the issue?
It might be helpful to others with similar problems (you don't need to
provide identifying information).

Sincerely,
David


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-01 14:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-17  0:02 Need some help with xtensa processor Ben Greear
2016-08-17  0:11 ` Sterling Augustine
2016-08-17  0:22   ` Ben Greear
2016-09-01  4:23 doark
2016-09-01 14:18 ` Ben Greear

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox