)]}'
{"id":"openocd~master~I9872062dfa0e3f1ca531d282d52a1b04c527546a","project":"openocd","branch":"master","topic":"riscv sync","attention_set":{},"removed_from_attention_set":{"1000021":{"account":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"last_update":"2025-11-24 14:04:17.000000000","reason":"Change was submitted"},"1002047":{"account":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"last_update":"2025-11-24 14:04:17.000000000","reason":"Change was submitted"},"1000687":{"account":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"last_update":"2025-11-09 08:28:05.000000000","reason":"\u003cGERRIT_ACCOUNT_1000687\u003e replied on the change","reason_account":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"}}},"hashtags":[],"change_id":"I9872062dfa0e3f1ca531d282d52a1b04c527546a","subject":"rtos: server/gdb_server: fix missing thread ID in stop reply","status":"MERGED","created":"2025-10-23 16:48:31.000000000","updated":"2025-11-24 14:04:17.000000000","submitted":"2025-11-24 14:04:17.000000000","submitter":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"total_comment_count":16,"unresolved_comment_count":0,"has_review_started":true,"submission_id":"9183-riscv sync","meta_rev_id":"9b801a8c2a665527b55863d4bdbd882f671881a5","_number":9183,"owner":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"actions":{},"labels":{"Verified":{"approved":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"all":[{"value":0,"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},{"tag":"autogenerated:gerrit:merged","value":1,"date":"2025-11-24 14:04:17.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}],"values":{"-1":"Fails"," 0":"No score","+1":"Verified"},"description":"","default_value":0},"Code-Review":{"approved":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"all":[{"tag":"autogenerated:gerrit:merged","value":2,"date":"2025-11-24 14:04:17.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},{"value":0,"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}],"values":{"-2":"This shall not be merged","-1":"I would prefer this is not merged as is"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me, approved"},"description":"","default_value":0}},"removable_reviewers":[],"reviewers":{"CC":[{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"}],"REVIEWER":[{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2025-10-23 17:23:19.000000000","updated_by":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"reviewer":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"state":"CC"},{"updated":"2025-10-23 18:14:51.000000000","updated_by":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"reviewer":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"state":"REVIEWER"},{"updated":"2025-10-25 12:32:20.000000000","updated_by":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"reviewer":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"state":"CC"},{"updated":"2025-11-03 23:16:15.000000000","updated_by":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"reviewer":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"state":"CC"},{"updated":"2025-11-07 07:34:04.000000000","updated_by":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"reviewer":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"state":"REVIEWER"}],"messages":[{"id":"5a82b0abba3e0949da35d40101cd540df8907d31","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"real_author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"date":"2025-10-23 16:48:31.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"7c3be0c5434a34fa90cfb114f27015f10f3a7ba8","tag":"autogenerated:gerrit:setTopic","author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"real_author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"date":"2025-10-23 16:48:48.000000000","message":"Topic set to riscv sync","accounts_in_message":[],"_revision_number":1},{"id":"dfdc675f4df189aad31dbc2472d7946f205a3fb6","tag":"autogenerated:jenkins-gerrit-trigger","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2025-10-23 18:14:51.000000000","message":"Patch Set 1: Verified-1\n\nBuild Failed \n\nhttps://build.openocd.org/job/openocd-gerrit-build/21232/ : FAILURE\n\nhttps://build.openocd.org/job/openocd-gerrit/22111/ : FAILURE","accounts_in_message":[],"_revision_number":1},{"id":"3e4e2778b83433cac85a9379ed5780f4928f49c4","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2025-10-25 12:32:20.000000000","message":"Patch Set 1:\n\n(3 comments)","accounts_in_message":[],"_revision_number":1},{"id":"63f60a8dfb96a4bd0e3ca52beecb46f3d4e0b538","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"date":"2025-11-03 23:16:15.000000000","message":"Patch Set 1:\n\n(1 comment)","accounts_in_message":[],"_revision_number":1},{"id":"3d3781cdbd3192df87de50349590c047bd4625e9","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"real_author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"date":"2025-11-06 11:15:37.000000000","message":"Uploaded patch set 2.\n\nOutdated Votes:\n* Verified-1 (copy condition: \"changekind:NO_CHANGE\")\n","accounts_in_message":[],"_revision_number":2},{"id":"1095b643a03bc5ad2bb4a2685a1524d02b34169b","author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"real_author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"date":"2025-11-06 11:17:40.000000000","message":"Patch Set 2:\n\n(4 comments)","accounts_in_message":[],"_revision_number":2},{"id":"2982fef18c6b95b5959bf543422b593036ea9eba","tag":"autogenerated:jenkins-gerrit-trigger","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2025-11-06 11:36:10.000000000","message":"Patch Set 2: Verified+1\n\nBuild Successful \n\nhttps://build.openocd.org/job/openocd-gerrit/22254/ : SUCCESS\n\nhttps://build.openocd.org/job/openocd-gerrit-build/21368/ : SUCCESS","accounts_in_message":[],"_revision_number":2},{"id":"314c740906a07ff05b28a434fd69b91774a19b64","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"date":"2025-11-07 07:34:04.000000000","message":"Patch Set 2: Code-Review+1","accounts_in_message":[],"_revision_number":2},{"id":"b0c902d988b50fec270fe485a0573feb1d536071","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2025-11-08 17:27:23.000000000","message":"Patch Set 2:\n\n(5 comments)","accounts_in_message":[],"_revision_number":2},{"id":"28b75c59c61d7b15055f1aa89ea0fc282b41b445","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"date":"2025-11-09 08:22:22.000000000","message":"Patch Set 3: Commit message was updated.\n\nOutdated Votes:\n* Code-Review+1 (copy condition: \"changekind:NO_CHANGE OR is:MIN\")\n* Verified+1 (copy condition: \"changekind:NO_CHANGE\")\n","accounts_in_message":[],"_revision_number":3},{"id":"3c961c64facba446419e826013cd623633bcc16b","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"date":"2025-11-09 08:28:05.000000000","message":"Patch Set 3:\n\n(2 comments)","accounts_in_message":[],"_revision_number":3},{"id":"9d276a23e73dc9ee6777a78c6e56bf11f13fcf5a","tag":"autogenerated:jenkins-gerrit-trigger","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2025-11-09 08:44:49.000000000","message":"Patch Set 3: Verified+1\n\nBuild Successful \n\nhttps://build.openocd.org/job/openocd-gerrit/22258/ : SUCCESS\n\nhttps://build.openocd.org/job/openocd-gerrit-build/21372/ : SUCCESS","accounts_in_message":[],"_revision_number":3},{"id":"16ba20aab51675f54c6cf06a5fd9c1a5e966950b","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"date":"2025-11-09 08:46:05.000000000","message":"Patch Set 3: Code-Review+1","accounts_in_message":[],"_revision_number":3},{"id":"280614e387d63482af74cc22a515947c250ae763","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"date":"2025-11-12 20:42:02.000000000","message":"Patch Set 3: Code-Review+2","accounts_in_message":[],"_revision_number":3},{"id":"87ff163bcc88b133b851647e017434c70f2fb911","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"date":"2025-11-12 21:08:19.000000000","message":"Patch Set 3:\n\n(1 comment)","accounts_in_message":[],"_revision_number":3},{"id":"9b801a8c2a665527b55863d4bdbd882f671881a5","tag":"autogenerated:gerrit:merged","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"date":"2025-11-24 14:04:17.000000000","message":"Change has been successfully cherry-picked as 1ea763d23c2337374909170687e16d1c5b9d9e89","accounts_in_message":[],"_revision_number":4}],"current_revision":"1ea763d23c2337374909170687e16d1c5b9d9e89","revisions":{"1ea763d23c2337374909170687e16d1c5b9d9e89":{"kind":"REWORK","_number":4,"created":"2025-11-24 14:04:17.000000000","uploader":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"ref":"refs/changes/83/9183/4","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/83/9183/4","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/4 \u0026\u0026 git checkout -b change-9183 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/4 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/4 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/4 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/83/9183/4","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/4 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"7b6496db7e1c41d62be944021f46543bbbfba4ae","subject":"rtos: server: target: ask the RTOS which target to set swbp on."}],"author":{"name":"Greg Savin","email":"greg.savin@sifive.com","date":"2022-02-07 17:28:31.000000000","tz":-480},"committer":{"name":"Tomas Vanek","email":"vanekt@fbl.cz","date":"2025-11-24 14:04:17.000000000","tz":0},"subject":"rtos: server/gdb_server: fix missing thread ID in stop reply","message":"rtos: server/gdb_server: fix missing thread ID in stop reply\n\nCherry-picked from [1].\n\nTo replicate the issue that this fixes:\n\n1. Connect to a multi-hart RISC-V target configured as an SMP group.\n2. Start a GDB instance against the running OpenOCD.\n3. Observe that GDB might display \"warning: multi-threaded target\n   stopped without sending a thread-id, using first non-exited thread.\"\n4. Set a breakpoint in code that any non-hart-0 hart is expected to\n   reach (but hart 0 is not expected to reach).\n5. Allow a non-hart-0 hart to reach the breakpoint.\n6. Remove the breakpoint.\n7. Do a few sequential `stepi` commands in GDB.\n8. Observe that GDB displays \"Switching to Thread 1\" even though the\n   thread that was just single stepped was not Thread 1 in GDB. Also\n   observe that the register values in GDB correspond to the thread that\n   was single-stepped, not Thread 1. Basically GDB erroneously starts to\n   consider thread 1 to be current, when in fact the thread that was\n   single-stepped is still current.\n\nThe changes in this pull request are intended to avoid the erroneous\n\"Switching to Thread 1\" described in (8) above.\n\nWhat was happening was that, in a couple areas of code, non-hart-0 harts\nweren\u0027t seen as belonging to an RTOS module, and this had the effect of\n(1) bypassing `hwthread_update_threads()` being called after a halt; (2)\nomitting a thread ID in a stop reply over GDB remote protocol connection\n(requiring GDB to take an arbitrary guess of current thread id, a guess\nthat is wrong unless the current thread happens to be hart 0).\n\nLink: https://github.com/riscv-collab/riscv-openocd/pull/675 [1]\nChange-Id: I9872062dfa0e3f1ca531d282d52a1b04c527546a\nSigned-off-by: Greg Savin \u003cgreg.savin@sifive.com\u003e\nReviewed-on: https://review.openocd.org/c/openocd/+/9183\nTested-by: jenkins\nReviewed-by: Tomas Vanek \u003cvanekt@fbl.cz\u003e\n"}},"f78898f9a9446a20c85b1ba953c0bd86b379ef55":{"kind":"REWORK","_number":1,"created":"2025-10-23 16:48:31.000000000","uploader":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"ref":"refs/changes/83/9183/1","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/83/9183/1","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/1 \u0026\u0026 git checkout -b change-9183 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/83/9183/1","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/1 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"a28452ea4afd80a1698cb59ce87f0c2aa464b0b7","subject":"rtos: server: target: ask the RTOS which target to set swbp on."}],"author":{"name":"Greg Savin","email":"greg.savin@sifive.com","date":"2022-02-07 17:28:31.000000000","tz":-480},"committer":{"name":"Evgeniy Naydanov","email":"evgeniy.naydanov@syntacore.com","date":"2025-10-23 16:47:47.000000000","tz":180},"subject":"Draft: fix missing thread ID in stop reply when smp-configured hart (but not hart 0) single-stepped","message":"Draft: fix missing thread ID in stop reply when smp-configured hart (but not hart 0) single-stepped\n\nSee [1] for context.\n\nLink: https://github.com/riscv-collab/riscv-openocd/pull/675 [1]\nChange-Id: I9872062dfa0e3f1ca531d282d52a1b04c527546a\nSigned-off-by: Greg Savin \u003cgreg.savin@sifive.com\u003e\n"}},"3096908783cedeeb726d504f8f99eb539e8890aa":{"kind":"REWORK","_number":2,"created":"2025-11-06 11:15:37.000000000","uploader":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"ref":"refs/changes/83/9183/2","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/83/9183/2","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/2 \u0026\u0026 git checkout -b change-9183 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/83/9183/2","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/2 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"a28452ea4afd80a1698cb59ce87f0c2aa464b0b7","subject":"rtos: server: target: ask the RTOS which target to set swbp on."}],"author":{"name":"Greg Savin","email":"greg.savin@sifive.com","date":"2022-02-07 17:28:31.000000000","tz":-480},"committer":{"name":"Evgeniy Naydanov","email":"evgeniy.naydanov@syntacore.com","date":"2025-11-06 11:07:59.000000000","tz":180},"subject":"rtos: server/gdb_srever: fix missing thread ID in stop reply","message":"rtos: server/gdb_srever: fix missing thread ID in stop reply\n\nCherry-picked from [1].\n\nTo replicate the issue that this fixes:\n\n1. Connect to a multi-hart RISC-V target configured as an SMP group.\n2. Start a GDB instance against the running OpenOCD.\n3. Observe that GDB might display \"warning: multi-threaded target\n   stopped without sending a thread-id, using first non-exited thread.\"\n4. Set a breakpoint in code that any non-hart-0 hart is expected to\n   reach (but hart 0 is not expected to reach).\n5. Allow a non-hart-0 hart to reach the breakpoint.\n6. Remove the breakpoint.\n7. Do a few sequential `stepi` commands in GDB.\n8. Observe that GDB displays \"Switching to Thread 1\" even though the\n   thread that was just single stepped was not Thread 1 in GDB. Also\n   observe that the register values in GDB correspond to the thread that\n   was single-stepped, not Thread 1. Basically GDB erroneously starts to\n   consider thread 1 to be current, when in fact the thread that was\n   single-stepped is still current.\n\nThe changes in this pull request are intended to avoid the erroneous\n\"Switching to Thread 1\" described in (8) above.\n\nWhat was happening was that, in a couple areas of code, non-hart-0 harts\nweren\u0027t seen as belonging to an RTOS module, and this had the effect of\n(1) bypassing `hwthread_update_threads()` being called after a halt; (2)\nomitting a thread ID in a stop reply over GDB remote protocol connection\n(requiring GDB to take an arbitrary guess of current thread id, a guess\nthat is wrong unless the current thread happens to be hart 0).\n\nLink: https://github.com/riscv-collab/riscv-openocd/pull/675 [1]\nChange-Id: I9872062dfa0e3f1ca531d282d52a1b04c527546a\nSigned-off-by: Greg Savin \u003cgreg.savin@sifive.com\u003e\n"}},"20e742d38fc85717a90158736685992d44832d1a":{"kind":"NO_CODE_CHANGE","_number":3,"created":"2025-11-09 08:22:22.000000000","uploader":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"ref":"refs/changes/83/9183/3","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/83/9183/3","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/3 \u0026\u0026 git checkout -b change-9183 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/3 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/3 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/3 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/83/9183/3","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/83/9183/3 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"a28452ea4afd80a1698cb59ce87f0c2aa464b0b7","subject":"rtos: server: target: ask the RTOS which target to set swbp on."}],"author":{"name":"Greg Savin","email":"greg.savin@sifive.com","date":"2022-02-07 17:28:31.000000000","tz":-480},"committer":{"name":"Tomas Vanek","email":"vanekt@fbl.cz","date":"2025-11-09 08:22:22.000000000","tz":0},"subject":"rtos: server/gdb_server: fix missing thread ID in stop reply","message":"rtos: server/gdb_server: fix missing thread ID in stop reply\n\nCherry-picked from [1].\n\nTo replicate the issue that this fixes:\n\n1. Connect to a multi-hart RISC-V target configured as an SMP group.\n2. Start a GDB instance against the running OpenOCD.\n3. Observe that GDB might display \"warning: multi-threaded target\n   stopped without sending a thread-id, using first non-exited thread.\"\n4. Set a breakpoint in code that any non-hart-0 hart is expected to\n   reach (but hart 0 is not expected to reach).\n5. Allow a non-hart-0 hart to reach the breakpoint.\n6. Remove the breakpoint.\n7. Do a few sequential `stepi` commands in GDB.\n8. Observe that GDB displays \"Switching to Thread 1\" even though the\n   thread that was just single stepped was not Thread 1 in GDB. Also\n   observe that the register values in GDB correspond to the thread that\n   was single-stepped, not Thread 1. Basically GDB erroneously starts to\n   consider thread 1 to be current, when in fact the thread that was\n   single-stepped is still current.\n\nThe changes in this pull request are intended to avoid the erroneous\n\"Switching to Thread 1\" described in (8) above.\n\nWhat was happening was that, in a couple areas of code, non-hart-0 harts\nweren\u0027t seen as belonging to an RTOS module, and this had the effect of\n(1) bypassing `hwthread_update_threads()` being called after a halt; (2)\nomitting a thread ID in a stop reply over GDB remote protocol connection\n(requiring GDB to take an arbitrary guess of current thread id, a guess\nthat is wrong unless the current thread happens to be hart 0).\n\nLink: https://github.com/riscv-collab/riscv-openocd/pull/675 [1]\nChange-Id: I9872062dfa0e3f1ca531d282d52a1b04c527546a\nSigned-off-by: Greg Savin \u003cgreg.savin@sifive.com\u003e\n"},"description":"Edit commit message"}},"requirements":[],"submit_records":[{"rule_name":"gerrit~DefaultSubmitRule","status":"CLOSED","labels":[{"label":"Verified","status":"OK","applied_by":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}},{"label":"Code-Review","status":"OK","applied_by":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"}}]}],"submit_requirements":[{"name":"Verified","status":"SATISFIED","is_legacy":true,"submittability_expression_result":{"expression":"label:Verified\u003dMAX -label:Verified\u003dMIN","fulfilled":true,"status":"PASS","passing_atoms":["label:Verified\u003dMAX","-label:Verified\u003dMIN"],"failing_atoms":[]}},{"name":"Code-Review","status":"SATISFIED","is_legacy":true,"submittability_expression_result":{"expression":"label:Code-Review\u003dMAX -label:Code-Review\u003dMIN","fulfilled":true,"status":"PASS","passing_atoms":["label:Code-Review\u003dMAX","-label:Code-Review\u003dMIN"],"failing_atoms":[]}}]}
