• David Brownell's avatar
    target: uplevel add_{break,watch}point() error checks · acbe054a
    David Brownell authored
    In target_type.h it's documented that the target must be
    halted for add_breakpoint() ... and with slight ambiguity,
    also for its add_watchpoint() sibling.  So rather than
    verifying that constraint in the CPU drivers, do it in the
    target_add_{break,watch}point() routines.
    Add minor paranoia on the remove_*point() paths too:  save
    the return value, and print it out in in the LOG_DEBUG message
    in case it's nonzero.
    Note that with some current cores, like all ARMv7 ones I've
    looked at, there's no technical issue preventing watchpoint or
    breakpoint add/remove operations on active cores.  This model
    seems deeply wired into OpenOCD though.
    ALSO:  the ARM targets were fairly "good" about enforcing that
    constraint themselves.  The MIPS ones were relied on other code
    to catch such stuff, but it's not clear such code existed ...
    keep an eye out for new issues on MIPS.
    Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>