rtos: remove display_str member 58/3558/4
authorSteven Stallion <stallion@squareup.com>
Wed, 20 Jul 2016 19:05:12 +0000 (14:05 -0500)
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sun, 14 Aug 2016 00:38:12 +0000 (01:38 +0100)
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>
src/rtos/ChibiOS.c
src/rtos/FreeRTOS.c
src/rtos/ThreadX.c
src/rtos/eCos.c
src/rtos/embKernel.c
src/rtos/mqx.c
src/rtos/rtos.c
src/rtos/rtos.h

index 2d8866439a5f1a295ed7df88de4ce4c965bb35b1..00e9df7839740fdc41c45537924132d74fa8eddc 100644 (file)
@@ -357,7 +357,6 @@ static int ChibiOS_update_threads(struct rtos *rtos)
                                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));
@@ -448,7 +447,6 @@ static int ChibiOS_update_threads(struct rtos *rtos)
                strcpy(curr_thrd_details->extra_info_str, state_desc);
 
                curr_thrd_details->exists = true;
-               curr_thrd_details->display_str = NULL;
 
                curr_thrd_details++;
        }
index a68ac2b30726201e14cea676cdb602ee47214f65..52cebadc7ca7423d789cabc5b0ce593d0332b7b7 100644 (file)
@@ -221,7 +221,6 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
                }
                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);
@@ -360,7 +359,6 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
                        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) {
index 229bf72e532de645c33068938475b503053a70e1..8267b9f6adfd5cf41ec848886de2e789a17f6ee5 100644 (file)
@@ -319,7 +319,6 @@ static int ThreadX_update_threads(struct rtos *rtos)
                                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);
@@ -414,8 +413,6 @@ static int ThreadX_update_threads(struct rtos *rtos)
 
                rtos->thread_details[tasks_found].exists = true;
 
-               rtos->thread_details[tasks_found].display_str = NULL;
-
                tasks_found++;
                prev_thread_ptr = thread_ptr;
 
@@ -596,8 +593,6 @@ static int ThreadX_get_thread_detail(struct rtos *rtos,
 
        detail->exists = true;
 
-       detail->display_str = NULL;
-
        return 0;
 }
 
index e4080695c0ab30045d1ec35a35f9f65e1965ad06..e38e11f04437a6646b2c59ce56cd4d26632da1e0 100644 (file)
@@ -172,7 +172,6 @@ static int eCos_update_threads(struct rtos *rtos)
                                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);
@@ -267,8 +266,6 @@ static int eCos_update_threads(struct rtos *rtos)
 
                rtos->thread_details[tasks_found].exists = true;
 
-               rtos->thread_details[tasks_found].display_str = NULL;
-
                tasks_found++;
                prev_thread_ptr = thread_index;
 
index 107cbdd559a9d2aa93a62e792de62fc39f62e347..ceb313f02979c5e14e33b56d3587408a789cc382 100644 (file)
@@ -143,7 +143,6 @@ static int embKernel_get_tasks_details(struct rtos *rtos, int64_t iterable, cons
                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,
index 728647c93d7fb984eb44435fc41281cabff4a92a..b8095a0cf00ba90c1796177d3361bc98073f61d0 100644 (file)
@@ -423,7 +423,6 @@ static int mqx_update_threads(
                /* 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)
index 8f50b49e681df034a83281671d8aa8d7dac077f0..4c99ad2333b17c53e4f0f772be0cb7fef2a4461e 100644 (file)
@@ -296,28 +296,20 @@ int rtos_thread_packet(struct connection *connection, char const *packet, int pa
                        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) ==
@@ -545,7 +537,6 @@ void rtos_free_threadlist(struct rtos *rtos)
 
                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);
                }
index 4c6989fe8cd88758ed360909e18ebd30f6cb8528..70c1193e54840c460afd1c520a7aaea7e2492d66 100644 (file)
@@ -39,7 +39,6 @@ typedef struct symbol_table_elem_struct {
 struct thread_detail {
        threadid_t threadid;
        bool exists;
-       char *display_str;
        char *thread_name_str;
        char *extra_info_str;
 };

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)