Don't reset current thread id on single step.
Now passing 36/45 tests. Change-Id: I244b045f84397b058cf526e3bff238cb05d8ad06
This commit is contained in:
parent
c1ef5f61c3
commit
348f15315e
|
@ -96,9 +96,6 @@ static int hwthread_update_threads(struct rtos *rtos)
|
||||||
|
|
||||||
target = rtos->target;
|
target = rtos->target;
|
||||||
|
|
||||||
/* wipe out previous thread details if any */
|
|
||||||
rtos_free_threadlist(rtos);
|
|
||||||
|
|
||||||
/* determine the number of "threads" */
|
/* determine the number of "threads" */
|
||||||
if (target->smp) {
|
if (target->smp) {
|
||||||
for (head = target->head; head != NULL; head = head->next) {
|
for (head = target->head; head != NULL; head = head->next) {
|
||||||
|
@ -112,6 +109,23 @@ static int hwthread_update_threads(struct rtos *rtos)
|
||||||
} else
|
} else
|
||||||
thread_list_size = 1;
|
thread_list_size = 1;
|
||||||
|
|
||||||
|
if (thread_list_size == rtos->thread_count) {
|
||||||
|
/* Nothing changed. Exit early.
|
||||||
|
* This is important because if we do recreate the data, we potentially
|
||||||
|
* change what the current thread is, which can lead to trouble because
|
||||||
|
* this function is sometimes called when single stepping
|
||||||
|
* (gdb_handle_vcont_packet), and the current thread should not be
|
||||||
|
* changed as part of that. */
|
||||||
|
/* TODO: Do we need to confirm that all the "threads" are really the
|
||||||
|
* same? Is it even possible to change the number of configured
|
||||||
|
* targets and SMP groups after this function is called the first time?
|
||||||
|
*/
|
||||||
|
return ERROR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* wipe out previous thread details if any */
|
||||||
|
rtos_free_threadlist(rtos);
|
||||||
|
|
||||||
/* create space for new thread details */
|
/* create space for new thread details */
|
||||||
rtos->thread_details = malloc(sizeof(struct thread_detail) * thread_list_size);
|
rtos->thread_details = malloc(sizeof(struct thread_detail) * thread_list_size);
|
||||||
|
|
||||||
|
@ -303,18 +317,11 @@ int hwthread_set_reg(struct rtos *rtos, int reg_num, uint8_t *reg_value)
|
||||||
if (curr == NULL)
|
if (curr == NULL)
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
|
|
||||||
struct reg **reg_list;
|
struct reg *reg = register_get_by_number(curr->reg_cache, reg_num, true);
|
||||||
int reg_list_size;
|
if (!reg)
|
||||||
if (target_get_gdb_reg_list(curr, ®_list, ®_list_size,
|
|
||||||
REG_CLASS_GENERAL) != ERROR_OK)
|
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
|
|
||||||
if (reg_list_size <= reg_num) {
|
return reg->type->set(reg, reg_value);
|
||||||
LOG_ERROR("Register %d requested, but only %d registers exist.",
|
|
||||||
reg_num, reg_list_size);
|
|
||||||
return ERROR_FAIL;
|
|
||||||
}
|
|
||||||
return reg_list[reg_num]->type->set(reg_list[reg_num], reg_value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hwthread_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
|
static int hwthread_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
|
||||||
|
|
Loading…
Reference in New Issue