Some not quite random observations, mainly for arm7_9 targets

Øyvind Harboe wrote:
> The arm7_9 sw_bpkts fails if the target is not halted.
>   
We can with no ill effects, I hope, add breakpoints with the target 
running, both swbk and hwbk.
The breakpoints will then be added to the openocd target breakpoint list 
but not mapped "set" to
breakpoints on the physical target.

This can very easily be done by removing the check if the target is 
running at the top of
int arm7_9_add_breakpoint(struct target_s *target, breakpoint_t 
*breakpoint) or changeing this to a INFO

(patch below). I cannot test this out now due to travels and vacation

> This is a problem when writing configuration scripts.
>   
The breakpoints will be activated the next time the  target is resumed 
or stepped .  So this is probably
perfectly ok for configuration scripts.

For interactive use with telnet interface,  it is a potential problem 
when the user adds a breakpoint, OpenOCD says ok
but it is not activated until next halt/resume, so a varning or info 
message might be useful. I do not know about gdb.

Breakpoint removal must be done with the target halted
> I find the configuration of breakpoints a bit confusing and I'm wondering
> if we couldn't define an way of handling this that covers
> all common cases in a less confusing manner.
>
> - auto - try sw breakpoint and if we fail to write to that memory location,
> use hw breakpoint
> - sw - only software breakpoints
> - hw - only hw breakpoints
>
>   
This is the kind of stuff that could be improved on in the 
target.c:handle_bp_command  and  tested out in scripting.
The handle_bp_command can check the status of the breakpoints, if they 
are set (mapped to hardware) or not.

AUTO  can be done today from handle_bp_command but it needs the target 
to be halted, otherwise we cannot write to memory so the soft breakpoint 
must alvays fail.
 
> Is there a need for anything more?
>
> Do we really need to make the breakpoint configuration command
> target specific?
>   
> Can the above or a generic command like it be good enough for
> just about all cases for all targets?
>
> A generic breakpoint configuration command and finer control
> w/special target commands are not mutually exclusive.
>
>   
This is really what we have,  the user logic in 
target.c:handle_bp_command and then the actual target hardware logic the 
target->add_breaskpoint.
It can probably be improved but I think the present structure is good. 
It should be possible to move some  of the  hw/sw/length stuff from 
target specific
to general code and clean it up.

Regards
Magnus



Index: src/target/arm7_9_common.c
===================================================================
--- src/target/arm7_9_common.c    (revision 884)
+++ src/target/arm7_9_common.c    (working copy)
@@ -279,8 +279,7 @@
 
     if (target->state != TARGET_HALTED)
     {
-        LOG_WARNING("target not halted");
-        return ERROR_TARGET_NOT_HALTED;
+        LOG_INFO("target not halted so breakpoint is not activated");
     }
 
     if (arm7_9->force_hw_bkpts)

 
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to