More cleanup.

Change-Id: I804bdcec23b69d77dfc376e23c6d1f29f99e7335
This commit is contained in:
Tim Newsome 2019-01-25 15:31:42 -08:00
parent 96df1db7b1
commit e186f62962
5 changed files with 8 additions and 47 deletions

View File

@ -432,7 +432,6 @@ int rtos_thread_packet(struct connection *connection, char const *packet, int pa
target->rtos->current_threadid = target->rtos->current_thread; target->rtos->current_threadid = target->rtos->current_thread;
else else
target->rtos->current_threadid = threadid; target->rtos->current_threadid = threadid;
LOG_DEBUG("current_threadid=%ld", target->rtos->current_threadid);
} }
gdb_put_packet(connection, "OK", 2); gdb_put_packet(connection, "OK", 2);
return ERROR_OK; return ERROR_OK;
@ -517,7 +516,6 @@ int rtos_get_gdb_reg_list(struct connection *connection)
{ {
struct target *target = get_target_from_connection(connection); struct target *target = get_target_from_connection(connection);
int64_t current_threadid = target->rtos->current_threadid; int64_t current_threadid = target->rtos->current_threadid;
LOG_DEBUG("current_threadid=%ld", target->rtos->current_threadid);
if ((target->rtos != NULL) && (current_threadid != -1) && if ((target->rtos != NULL) && (current_threadid != -1) &&
(current_threadid != 0) && (current_threadid != 0) &&
((current_threadid != target->rtos->current_thread) || ((current_threadid != target->rtos->current_thread) ||

View File

@ -96,7 +96,7 @@ struct gdb_connection {
char *thread_list; char *thread_list;
}; };
#if 1 #if 0
#define _DEBUG_GDB_IO_ #define _DEBUG_GDB_IO_
#endif #endif
@ -736,7 +736,7 @@ static void gdb_signal_reply(struct target *target, struct connection *connectio
struct target *ct; struct target *ct;
if (target->rtos != NULL) { if (target->rtos != NULL) {
target->rtos->current_threadid = target->rtos->current_thread; target->rtos->current_threadid = target->rtos->current_thread;
LOG_DEBUG("current_threadid=%ld", target->rtos->current_threadid); LOG_DEBUG("current_threadid=%" PRId64, target->rtos->current_threadid);
target->rtos->gdb_target_for_threadid(connection, target->rtos->current_threadid, &ct); target->rtos->gdb_target_for_threadid(connection, target->rtos->current_threadid, &ct);
} else { } else {
ct = target; ct = target;

View File

@ -549,8 +549,6 @@ int watchpoint_hit(struct target *target, enum watchpoint_rw *rw,
int retval; int retval;
struct watchpoint *hit_watchpoint; struct watchpoint *hit_watchpoint;
LOG_DEBUG("[%d]", target->coreid);
retval = target_hit_watchpoint(target, &hit_watchpoint); retval = target_hit_watchpoint(target, &hit_watchpoint);
if (retval != ERROR_OK) if (retval != ERROR_OK)
return ERROR_FAIL; return ERROR_FAIL;

View File

@ -648,33 +648,12 @@ static void trigger_from_watchpoint(struct trigger *trigger,
int riscv_add_watchpoint(struct target *target, struct watchpoint *watchpoint) int riscv_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
{ {
LOG_DEBUG("[%d] @0x%" TARGET_PRIxADDR, target->coreid, watchpoint->address);
struct trigger trigger; struct trigger trigger;
trigger_from_watchpoint(&trigger, watchpoint); trigger_from_watchpoint(&trigger, watchpoint);
if (target->smp) { int result = add_trigger(target, &trigger);
struct target *failed = NULL; if (result != ERROR_OK)
for (struct target_list *list = target->head; list != NULL; return result;
list = list->next) {
struct target *t = list->target;
if (add_trigger(t, &trigger) != ERROR_OK) {
failed = t;
break;
}
}
if (failed) {
for (struct target_list *list = target->head;
list->target != failed; list = list->next) {
struct target *t = list->target;
remove_trigger(t, &trigger);
}
return ERROR_FAIL;
}
} else {
int result = add_trigger(target, &trigger);
if (result != ERROR_OK)
return result;
}
watchpoint->set = true; watchpoint->set = true;
return ERROR_OK; return ERROR_OK;
@ -688,21 +667,9 @@ int riscv_remove_watchpoint(struct target *target,
struct trigger trigger; struct trigger trigger;
trigger_from_watchpoint(&trigger, watchpoint); trigger_from_watchpoint(&trigger, watchpoint);
if (target->smp) { int result = remove_trigger(target, &trigger);
bool failed = false; if (result != ERROR_OK)
for (struct target_list *list = target->head; list != NULL; return result;
list = list->next) {
struct target *t = list->target;
if (remove_trigger(t, &trigger) != ERROR_OK)
failed = true;
}
if (failed)
return ERROR_FAIL;
} else {
int result = remove_trigger(target, &trigger);
if (result != ERROR_OK)
return result;
}
watchpoint->set = false; watchpoint->set = false;
return ERROR_OK; return ERROR_OK;

View File

@ -1206,8 +1206,6 @@ int target_hit_watchpoint(struct target *target,
return ERROR_FAIL; return ERROR_FAIL;
} }
LOG_DEBUG("[%d]", target->coreid);
return target->type->hit_watchpoint(target, hit_watchpoint); return target->type->hit_watchpoint(target, hit_watchpoint);
} }