diff options
author | Ben McMorran <bemcmorr@microsoft.com> | 2022-01-27 14:30:58 -0800 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2022-02-14 15:12:45 +0000 |
commit | 7307fd0e3faa7b3e060a722775c532bcb7f70057 (patch) | |
tree | cfb46abae9590abadb9439748b23adb4740fe4d6 /src | |
parent | f998a2aaf19c14b46fd7f7dd50607a0904f40bd3 (diff) | |
download | riscv-openocd-7307fd0e3faa7b3e060a722775c532bcb7f70057.zip riscv-openocd-7307fd0e3faa7b3e060a722775c532bcb7f70057.tar.gz riscv-openocd-7307fd0e3faa7b3e060a722775c532bcb7f70057.tar.bz2 |
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 <bemcmorr@microsoft.com>
Change-Id: I102c14ddb8b87757fa474de8e3a3f6a1cfe10d98
Reviewed-on: https://review.openocd.org/c/openocd/+/6828
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/server/gdb_server.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 537670c..95720e5 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -2619,8 +2619,14 @@ static int gdb_generate_thread_list(struct target *target, char **thread_list_ou if (!thread_detail->exists) continue; - xml_printf(&retval, &thread_list, &pos, &size, - "<thread id=\"%" PRIx64 "\">", thread_detail->threadid); + if (thread_detail->thread_name_str) + xml_printf(&retval, &thread_list, &pos, &size, + "<thread id=\"%" PRIx64 "\" name=\"%s\">", + thread_detail->threadid, + thread_detail->thread_name_str); + else + xml_printf(&retval, &thread_list, &pos, &size, + "<thread id=\"%" PRIx64 "\">", thread_detail->threadid); if (thread_detail->thread_name_str) xml_printf(&retval, &thread_list, &pos, &size, |