This patch removes the display_str member in the thread_detail struct.
This member was not being used and provides no additional benefit over
the thread_name_str and extra_info_str members. This change is made in
preparation of support for the qXfer:threads:read packet, which will
modernize how thread information is shared with GDB.
Change-Id: I1f8bc6325e6aa790e02ea6caee9d6f44c5fedf36
Signed-off-by: Steven Stallion <stallion@squareup.com>
Reviewed-on: http://openocd.zylin.com/3558
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
sizeof(struct thread_detail));
rtos->thread_details->threadid = 1;
rtos->thread_details->exists = true;
- rtos->thread_details->display_str = NULL;
rtos->thread_details->extra_info_str = malloc(
sizeof(tmp_thread_extra_info));
strcpy(curr_thrd_details->extra_info_str, state_desc);
curr_thrd_details->exists = true;
- curr_thrd_details->display_str = NULL;
curr_thrd_details++;
}
}
rtos->thread_details->threadid = 1;
rtos->thread_details->exists = true;
- rtos->thread_details->display_str = NULL;
rtos->thread_details->extra_info_str = NULL;
rtos->thread_details->thread_name_str = malloc(sizeof(tmp_str));
strcpy(rtos->thread_details->thread_name_str, tmp_str);
rtos->thread_details[tasks_found].thread_name_str =
malloc(strlen(tmp_str)+1);
strcpy(rtos->thread_details[tasks_found].thread_name_str, tmp_str);
- rtos->thread_details[tasks_found].display_str = NULL;
rtos->thread_details[tasks_found].exists = true;
if (rtos->thread_details[tasks_found].threadid == rtos->current_thread) {
sizeof(struct thread_detail) * thread_list_size);
rtos->thread_details->threadid = 1;
rtos->thread_details->exists = true;
- rtos->thread_details->display_str = NULL;
rtos->thread_details->extra_info_str = NULL;
rtos->thread_details->thread_name_str = malloc(sizeof(tmp_str));
strcpy(rtos->thread_details->thread_name_str, tmp_str);
rtos->thread_details[tasks_found].exists = true;
- rtos->thread_details[tasks_found].display_str = NULL;
-
tasks_found++;
prev_thread_ptr = thread_ptr;
detail->exists = true;
- detail->display_str = NULL;
-
return 0;
}
sizeof(struct thread_detail) * thread_list_size);
rtos->thread_details->threadid = 1;
rtos->thread_details->exists = true;
- rtos->thread_details->display_str = NULL;
rtos->thread_details->extra_info_str = NULL;
rtos->thread_details->thread_name_str = malloc(sizeof(tmp_str));
strcpy(rtos->thread_details->thread_name_str, tmp_str);
rtos->thread_details[tasks_found].exists = true;
- rtos->thread_details[tasks_found].display_str = NULL;
-
tasks_found++;
prev_thread_ptr = thread_index;
return retval;
details->threadid = (threadid_t) task;
details->exists = true;
- details->display_str = NULL;
int64_t name_ptr = 0;
retval = target_read_buffer(rtos->target, task + param->thread_name_offset, param->pointer_width,
/* setup thread details struct */
rtos->thread_details[i].threadid = task_id;
rtos->thread_details[i].exists = true;
- rtos->thread_details[i].display_str = NULL;
/* set thread name */
rtos->thread_details[i].thread_name_str = malloc(strlen((void *)task_name) + 1);
if (NULL == rtos->thread_details[i].thread_name_str)
struct thread_detail *detail = &target->rtos->thread_details[found];
int str_size = 0;
- if (detail->display_str != NULL)
- str_size += strlen(detail->display_str);
if (detail->thread_name_str != NULL)
str_size += strlen(detail->thread_name_str);
if (detail->extra_info_str != NULL)
str_size += strlen(detail->extra_info_str);
- char *tmp_str = calloc(str_size + 7, sizeof(char));
+ char *tmp_str = calloc(str_size + 4, sizeof(char));
char *tmp_str_ptr = tmp_str;
- if (detail->display_str != NULL)
- tmp_str_ptr += sprintf(tmp_str_ptr, "%s", detail->display_str);
- if (detail->thread_name_str != NULL) {
- if (tmp_str_ptr != tmp_str)
- tmp_str_ptr += sprintf(tmp_str_ptr, " : ");
+ if (detail->thread_name_str != NULL)
tmp_str_ptr += sprintf(tmp_str_ptr, "%s", detail->thread_name_str);
- }
if (detail->extra_info_str != NULL) {
if (tmp_str_ptr != tmp_str)
tmp_str_ptr += sprintf(tmp_str_ptr, " : ");
- tmp_str_ptr +=
- sprintf(tmp_str_ptr, " : %s", detail->extra_info_str);
+ tmp_str_ptr += sprintf(tmp_str_ptr, "%s", detail->extra_info_str);
}
assert(strlen(tmp_str) ==
for (j = 0; j < rtos->thread_count; j++) {
struct thread_detail *current_thread = &rtos->thread_details[j];
- free(current_thread->display_str);
free(current_thread->thread_name_str);
free(current_thread->extra_info_str);
}
struct thread_detail {
threadid_t threadid;
bool exists;
- char *display_str;
char *thread_name_str;
char *extra_info_str;
};