X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Frtos%2Flinux.c;h=e692ada8274edd417b303fd41751869cd920fafd;hb=1c975fe30b8fb380907133462cc38a0b2e9de565;hp=0fc763557c6929e34e20b3ea34e6a880f093d677;hpb=08d4411b59dd8bd0e7d8009003b71d23acbf6eee;p=openocd.git diff --git a/src/rtos/linux.c b/src/rtos/linux.c index 0fc763557c..e692ada827 100644 --- a/src/rtos/linux.c +++ b/src/rtos/linux.c @@ -226,7 +226,8 @@ static int linux_os_thread_reg_list(struct rtos *rtos, /*LOG_INFO("thread %lx current on core %x",thread_id, * target->coreid);*/ retval = - target_get_gdb_reg_list(target, ®_list, ®_list_size); + target_get_gdb_reg_list(target, ®_list, ®_list_size, + REG_CLASS_GENERAL); if (retval != ERROR_OK) return retval; @@ -498,7 +499,7 @@ int get_current(struct target *target, int create) int retval; if (target_get_gdb_reg_list(head->target, ®_list, - ®_list_size) != ERROR_OK) { + ®_list_size, REG_CLASS_GENERAL) != ERROR_OK) { free(buffer); return ERROR_TARGET_FAILURE; } @@ -532,7 +533,7 @@ int get_current(struct target *target, int create) LOG_ERROR ("error in linux current thread update"); - if (create) { + if (create && ct) { struct threads *t; t = calloc(1, sizeof(struct threads)); t->base_addr = ct->TS; @@ -1139,13 +1140,12 @@ int linux_gdb_thread_packet(struct target *target, char *tmp_str = out_str; tmp_str += sprintf(tmp_str, "m"); struct threads *temp = linux_os->thread_list; - tmp_str += sprintf(tmp_str, "%016" PRIx64, temp->threadid); - temp = temp->next; while (temp != NULL) { - tmp_str += sprintf(tmp_str, ","); tmp_str += sprintf(tmp_str, "%016" PRIx64, temp->threadid); temp = temp->next; + if (temp) + tmp_str += sprintf(tmp_str, ","); } gdb_put_packet(connection, out_str, strlen(out_str));