)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"95623840669de35cfa90e4b5915a7789bd10b32e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"4815f267_b651dde2","updated":"2022-11-18 17:44:06.000000000","message":"I made a similar change in riscv-openocd. (4 years ago! I\u0027m *so* behind on upstreaming. :-( ) My implementation is:\n\n                return ERROR_OK;\n        }\n \n-       /* wipe out previous thread details if any */\n+       /* Wipe out previous thread details if any, but preserve threadid. */\n+       int64_t current_threadid \u003d rtos-\u003ecurrent_threadid;\n        rtos_free_threadlist(rtos);\n+       rtos-\u003ecurrent_threadid \u003d current_threadid;\n \n        /* create space for new thread details */\n        rtos-\u003ethread_details \u003d malloc(sizeof(struct thread_detail) * thread_list_size);\n\nI don\u0027t have any opinion on which is better (especially since it was so long ago), but I thought I\u0027d leave this here as food for thought.","commit_id":"6fc60a4bd44204261ef8cf79f0f67a291b197e60"},{"author":{"_account_id":1002050,"name":"Koudai Iwahori","email":"koudai@google.com","username":"koudai"},"change_message_id":"4d5f7502a6efabdd47fa2817f5d7b6354bf6ce9a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"b4d55e44_b7837751","in_reply_to":"4815f267_b651dde2","updated":"2022-11-21 10:04:45.000000000","message":"Thanks for letting me know\nI noticed I need to restore `current_threadid` right after determining the number of threads\nLet\u0027s wait for the maintainer\u0027s review","commit_id":"6fc60a4bd44204261ef8cf79f0f67a291b197e60"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"97abed8e8bf8dcdfe87703f77c4cf2a9da2627ff","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"e87772cb_6c2cd83a","updated":"2022-11-26 09:57:10.000000000","message":"Thanks!","commit_id":"e48e09d28ef9009d114b6a4aae13f3dda7f748f0"}],"src/rtos/hwthread.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"814926d108c7c8c51c99ed5f0cad16e0daad9292","unresolved":true,"context_lines":[{"line_number":109,"context_line":"\t/* restore the threadid which is currently selected by GDB"},{"line_number":110,"context_line":"\t * because rtos_free_threadlist() wipes out it"},{"line_number":111,"context_line":"\t * (GDB thread id is 1-based indexing) */"},{"line_number":112,"context_line":"\tif (current_threadid \u003e\u003d 1 \u0026\u0026 current_threadid \u003c\u003d thread_list_size)"},{"line_number":113,"context_line":"\t\trtos-\u003ecurrent_threadid \u003d current_threadid;"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"\t/* create space for new thread details */"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"917c0fd9_3cbd1536","line":112,"updated":"2022-11-24 22:49:22.000000000","message":"this check looks redundant as it should not be possible to change SMP node \"during\" a step, but SMP code can evolve breaking all. Keeping this check should not hurt.\nWhat about adding also:\n else\n   LOG_WARNING(\"SMP node change, disconnect GDB from core/thread %d\", current_threadid);","commit_id":"0b671061410f08b3057ea80eed455ae7d494360d"},{"author":{"_account_id":1002050,"name":"Koudai Iwahori","email":"koudai@google.com","username":"koudai"},"change_message_id":"a3fec568be67f61f06c58ef4e4e9a481fc5349ca","unresolved":false,"context_lines":[{"line_number":109,"context_line":"\t/* restore the threadid which is currently selected by GDB"},{"line_number":110,"context_line":"\t * because rtos_free_threadlist() wipes out it"},{"line_number":111,"context_line":"\t * (GDB thread id is 1-based indexing) */"},{"line_number":112,"context_line":"\tif (current_threadid \u003e\u003d 1 \u0026\u0026 current_threadid \u003c\u003d thread_list_size)"},{"line_number":113,"context_line":"\t\trtos-\u003ecurrent_threadid \u003d current_threadid;"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"\t/* create space for new thread details */"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"2bfab0bb_dec34296","line":112,"in_reply_to":"917c0fd9_3cbd1536","updated":"2022-11-25 03:02:25.000000000","message":"Added the logging code\nI also removed `current_threadid \u003e\u003d 1`. The warning message always appears at the initialization stage of OpenOCD if we keep `current_threadid \u003e\u003d 1`","commit_id":"0b671061410f08b3057ea80eed455ae7d494360d"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"895ec97a9c37e8295084e526d5a14249d57ee194","unresolved":true,"context_lines":[{"line_number":112,"context_line":"\tif (current_threadid \u003c\u003d thread_list_size)"},{"line_number":113,"context_line":"\t\trtos-\u003ecurrent_threadid \u003d current_threadid;"},{"line_number":114,"context_line":"\telse"},{"line_number":115,"context_line":"\t\tLOG_WARNING(\"SMP node change, disconnect GDB from core/thread %ld\","},{"line_number":116,"context_line":"\t\t\t    current_threadid);"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"\t/* create space for new thread details */"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"56fec0d7_18919e4a","line":115,"updated":"2022-11-25 21:49:19.000000000","message":"Oops, current_threadid is a int64_t\nLOG_WARNING(\"SMP node change, disconnect GDB from core/thread %\" PRId64, current_threadid);","commit_id":"86aa6e50def270bfcd8166afe3ce4702f23ad464"},{"author":{"_account_id":1002050,"name":"Koudai Iwahori","email":"koudai@google.com","username":"koudai"},"change_message_id":"f4ca96342f5f8a7e3429684e64b2bd06342b8ae3","unresolved":false,"context_lines":[{"line_number":112,"context_line":"\tif (current_threadid \u003c\u003d thread_list_size)"},{"line_number":113,"context_line":"\t\trtos-\u003ecurrent_threadid \u003d current_threadid;"},{"line_number":114,"context_line":"\telse"},{"line_number":115,"context_line":"\t\tLOG_WARNING(\"SMP node change, disconnect GDB from core/thread %ld\","},{"line_number":116,"context_line":"\t\t\t    current_threadid);"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"\t/* create space for new thread details */"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"7b0ac283_61d36c50","line":115,"in_reply_to":"56fec0d7_18919e4a","updated":"2022-11-26 07:23:18.000000000","message":"Done","commit_id":"86aa6e50def270bfcd8166afe3ce4702f23ad464"}]}
