This is an automated email from Gerrit.

"Ben McMorran <bemcm...@microsoft.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/6828

-- gerrit

commit ec686d0a9ac2a37b42b368075d02bf33a6c0a764
Author: Ben McMorran <bemcm...@microsoft.com>
Date:   Thu Jan 27 14:30:58 2022 -0800

    gdb_server: Include thread name as XML attribute
    
    Explicitly providing a thread name in the "thread" element produces
    better thread visualizations in downstream tools like IDEs.
    
    Signed-off-by: Ben McMorran <bemcm...@microsoft.com>
    Change-Id: I102c14ddb8b87757fa474de8e3a3f6a1cfe10d98

diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index fc58971a7..94d035a51 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -2465,7 +2465,13 @@ static int gdb_generate_thread_list(struct target 
*target, char **thread_list_ou
                                continue;
 
                        xml_printf(&retval, &thread_list, &pos, &size,
-                                  "<thread id=\"%" PRIx64 "\">", 
thread_detail->threadid);
+                                  "<thread id=\"%" PRIx64 "\"", 
thread_detail->threadid);
+
+                       if (thread_detail->thread_name_str != NULL)
+                               xml_printf(&retval, &thread_list, &pos, &size,
+                                          " name=\"%s\"", 
thread_detail->thread_name_str);
+
+                       xml_printf(&retval, &thread_list, &pos, &size, ">");
 
                        if (thread_detail->thread_name_str != NULL)
                                xml_printf(&retval, &thread_list, &pos, &size,

-- 

Reply via email to