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;
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));