On Wed, Sep 8, 2010 at 4:50 PM, Drasko DRASKOVIC
<drasko.drasko...@gmail.com> wrote:
> Hi all,
> I have a following problem debugging with GDB (v. 7.1) connected via OpenOCD :
> If I set hardware break point on a function everything works fine,
> program stops, and I can single-step...
> But if I set software breakpoint, prokram keeps stopping on this
> breakpoint. I can not single step nor continue.
> Even when I delete breakpoint explicitly (delete breakpoints in GDB),
> program keeps stopping on this breakpoint with every "n", "s", or "c".
>
> I suspect that breakpoint that GDB have inserted is left in the cache
> and never replaced back by the instruction (I am using ARM946 with
> caches enabled).
>
> Any ideas on sources/solution of this problem ?
>
> Best regards,
> Drasko
>

Here is an example that depicts situation in more details :

> bp 0x128fc 4
breakpoint set at 0x000128fc
> resume 0x00008000
target state: halted
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0xa0000013 pc: 0x000128fc
> resume
target state: halted
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0xa0000013 pc: 0x000128fc
> bp
0x000128fc, 0x4, 1, 0x08
> rbp 0x000128fc
> bp
> resume
target state: halted
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0xa0000013 pc: 0x000128fc
> resume
target state: halted
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0xa0000013 pc: 0x000128fc

Dumping the memory dhows that instruction is replaced upon inserting
breakpoint, and that same instruction is put back in memory when
breakpoint is deleted.

What is happening in the I-Cache, I have no idea, but I think that one
in cache, bkpt is never replaced back with real instruction (just
SDRAM addr is replaced, not cache), but I can not confirm this yet.

Hope that somebody has an idea...

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

Reply via email to