On Wed, Apr 27, 2011 at 12:12:12PM -0700, Mike Dunn wrote:
> On 04/27/2011 09:42 AM, Eric Cooper wrote:
> > 1. In gdb, I can step and continue, but I can't halt.  Once I've
> > continued, typing ^C does nothing.  (Typing it a second time just
> > makes gdb offer to quit.)  I can still halt from the openocd telnet
> > client.
> 
> That's odd.  I've never experienced this.  I'm a little behind the latest in
> git.  Recently introduced bug in gdb server code?  In gdb?

I'm using:
    GNU gdb (Sourcery G++ Lite 2010q1-188) 7.0.50.20100218-cvs

> BTW, be careful using openocd through telnet while gdb is connected.  Openocd
> assumes exclusive use of one or the other, and does things like clear all
> existing breakpoints when gdb connects.  It could be confusing the issue for 
> you.

I tried with no telnet client connected, just gdb, and got the same behavior.
Maybe I'll have to run arm-gdb under gdb to find out what's going on ...

> > 2. Breakpoints don't work.  I can set one in either the telnet client
> > or gdb without any error message.  But when I continue execution, the
> > program never halts at the breakpoint.
> 
> Have you tried hardware breakpoints as well?

Yes, apparently that doesn't work on this chip:
    Info : feroceon.cpu: hardware has 1 breakpoint/watchpoint unit
When I try, I get this:

> bp 0x07f7c2e4 4 hw
no watchpoint unit available for hardware breakpoint
can't add breakpoint: resource not available

> You should be able to verify that the software breakpoint was
> succesfully inserted by doing a 'mdw' or 'arm disassemble' at the
> breakpoint address and seeing if the original instruction was
> replaced with the bkpt instruction.

It all seems OK:
> arm disassemble 0x07f7c2e4
0x07f7c2e4        0xe5d03014    LDRB r3, [r0, #0x14]
> bp 0x07f7c2e4 4
breakpoint set at 0x07f7c2e4
> arm disassemble 0x07f7c2e4
0x07f7c2e4        0xe1200070    BKPT 0x0000
> resume
(breakpoint not hit, despite execution going through there)
> halt
target state: halted
target halted in ARM state due to debug-request, current mode:
Supervisor
cpsr: 0x400000d3 pc: 0x07f7c2e8
MMU: disabled, D-Cache: disabled, I-Cache: enabled
> arm disassemble 0x07f7c2e4
0x07f7c2e4        0xe1200070    BKPT 0x0000

I think it must still be executing the unmodified instruction out of
the i-cache.  Shouldn't openocd flush that when it sets a software
breakpoint?

-- 
Eric Cooper             e c c @ c m u . e d u
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to