#endif
#include "target.h"
-#include "log.h"
+#include <helper/log.h>
#include "breakpoints.h"
}
/* free up a breakpoint */
-static void breakpoint_free(struct target *target, struct breakpoint *breakpoint_remove)
+static void breakpoint_free(struct target *target, struct breakpoint *breakpoint_to_remove)
{
struct breakpoint *breakpoint = target->breakpoints;
struct breakpoint **breakpoint_p = &target->breakpoints;
+ int retval;
while (breakpoint)
{
- if (breakpoint == breakpoint_remove)
+ if (breakpoint == breakpoint_to_remove)
break;
breakpoint_p = &breakpoint->next;
breakpoint = breakpoint->next;
if (breakpoint == NULL)
return;
- target_remove_breakpoint(target, breakpoint);
+ retval = target_remove_breakpoint(target, breakpoint);
- LOG_DEBUG("BPID: %d", breakpoint->unique_id );
+ LOG_DEBUG("free BPID: %d --> %d", breakpoint->unique_id, retval);
(*breakpoint_p) = breakpoint->next;
free(breakpoint->orig_instr);
free(breakpoint);
return ERROR_OK;
}
-static void watchpoint_free(struct target *target, struct watchpoint *watchpoint_remove)
+static void watchpoint_free(struct target *target, struct watchpoint *watchpoint_to_remove)
{
struct watchpoint *watchpoint = target->watchpoints;
struct watchpoint **watchpoint_p = &target->watchpoints;
+ int retval;
while (watchpoint)
{
- if (watchpoint == watchpoint_remove)
+ if (watchpoint == watchpoint_to_remove)
break;
watchpoint_p = &watchpoint->next;
watchpoint = watchpoint->next;
if (watchpoint == NULL)
return;
- target_remove_watchpoint(target, watchpoint);
- LOG_DEBUG("WPID: %d", watchpoint->unique_id );
+ retval = target_remove_watchpoint(target, watchpoint);
+ LOG_DEBUG("free WPID: %d --> %d", watchpoint->unique_id, retval);
(*watchpoint_p) = watchpoint->next;
free(watchpoint);
}