)]}'
{"id":"openocd~master~Ib93b7ed3bb03696afdf56a105b333e22b9ec69b5","project":"openocd","branch":"master","attention_set":{},"removed_from_attention_set":{"1002161":{"account":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"last_update":"2024-09-15 09:05:04.000000000","reason":"Change was submitted"},"1000021":{"account":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"last_update":"2024-09-15 09:04:55.000000000","reason":"removed on reply"},"1002047":{"account":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"last_update":"2024-09-02 11:19:34.000000000","reason":"\u003cGERRIT_ACCOUNT_1002047\u003e replied on the change","reason_account":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"}}},"hashtags":[],"change_id":"Ib93b7ed3bb03696afdf56a105b333e22b9ec69b5","subject":"rtos/hwthread: fix threadid generation","status":"MERGED","created":"2024-08-30 19:49:30.000000000","updated":"2024-09-15 09:05:04.000000000","submitted":"2024-09-15 09:05:04.000000000","submitter":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"total_comment_count":3,"unresolved_comment_count":0,"has_review_started":true,"submission_id":"8471","meta_rev_id":"f6847e9cfa309fdce29bf65c420afb516a019fb5","_number":8471,"owner":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"actions":{},"labels":{"Verified":{"approved":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"all":[{"value":0,"_account_id":1002135,"name":"Mark Zhuang","email":"mark.zhuang@spacemit.com","username":"zqb-all"},{"value":0,"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"value":0,"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},{"tag":"autogenerated:gerrit:merged","value":1,"date":"2024-09-15 09:05:04.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":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"all":[{"tag":"autogenerated:gerrit:merged","value":1,"date":"2024-09-15 09:05:04.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":1002135,"name":"Mark Zhuang","email":"mark.zhuang@spacemit.com","username":"zqb-all"},{"tag":"autogenerated:gerrit:merged","value":2,"date":"2024-09-15 09:05:04.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"tag":"autogenerated:gerrit:merged","value":1,"date":"2024-09-15 09:05:04.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},{"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":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},{"_account_id":1002143,"name":"Marek Vrbka","email":"marek.vrbka@codasip.com","username":"MarekVCodasip"}],"REVIEWER":[{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},{"_account_id":1002135,"name":"Mark Zhuang","email":"mark.zhuang@spacemit.com","username":"zqb-all"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2024-08-30 19:50:27.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":"2024-08-30 20:33:31.000000000","updated_by":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"reviewer":{"_account_id":1002135,"name":"Mark Zhuang","email":"mark.zhuang@spacemit.com","username":"zqb-all"},"state":"CC"},{"updated":"2024-08-30 20:33:31.000000000","updated_by":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"reviewer":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"state":"CC"},{"updated":"2024-08-30 20:33:31.000000000","updated_by":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"reviewer":{"_account_id":1002143,"name":"Marek Vrbka","email":"marek.vrbka@codasip.com","username":"MarekVCodasip"},"state":"CC"},{"updated":"2024-08-30 20:33:31.000000000","updated_by":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"reviewer":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"state":"CC"},{"updated":"2024-08-30 20:33:31.000000000","updated_by":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"reviewer":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"state":"REVIEWER"},{"updated":"2024-08-30 20:33:31.000000000","updated_by":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"reviewer":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"state":"REVIEWER"},{"updated":"2024-09-02 13:46:16.000000000","updated_by":{"_account_id":1002135,"name":"Mark Zhuang","email":"mark.zhuang@spacemit.com","username":"zqb-all"},"reviewer":{"_account_id":1002135,"name":"Mark Zhuang","email":"mark.zhuang@spacemit.com","username":"zqb-all"},"state":"REVIEWER"}],"messages":[{"id":"678a4e65f462be8f93332a2e44403c280100945b","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"real_author":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"date":"2024-08-30 19:49:30.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"bd1560c2e17b779b71422abc92ec30a3ea5a720b","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":"2024-08-30 19:50:27.000000000","message":"Patch Set 1: Verified-1\n\nBuild Failed \n\nhttps://build.openocd.org/job/openocd-gerrit/19968/ : FAILURE\n\nhttps://build.openocd.org/job/openocd-gerrit-build/19123/ : FAILURE","accounts_in_message":[],"_revision_number":1},{"id":"265facc202535195d17b9b24be0a120219391c41","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"real_author":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"date":"2024-08-30 19:58:10.000000000","message":"Uploaded patch set 2: Commit message was updated.\n\nOutdated Votes:\n* Verified-1 (copy condition: \"changekind:NO_CHANGE\")\n","accounts_in_message":[],"_revision_number":2},{"id":"90e2b9c4d2d68ab4004f4246841599489a87f9d3","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":"2024-08-30 20:11:41.000000000","message":"Patch Set 2: Verified+1\n\nBuild Successful \n\nhttps://build.openocd.org/job/openocd-gerrit/19969/ : SUCCESS\n\nhttps://build.openocd.org/job/openocd-gerrit-build/19124/ : SUCCESS","accounts_in_message":[],"_revision_number":2},{"id":"8f907c6adc7988390606fb436fe19f2e6fa1d4d8","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":"2024-08-31 13:23:25.000000000","message":"Patch Set 2: Code-Review+1\n\n(1 comment)","accounts_in_message":[],"_revision_number":2},{"id":"f35de08ec625d57c172addf785cd092d4993a65c","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":"2024-09-02 11:19:34.000000000","message":"Patch Set 2: Code-Review+1\n\n(1 comment)","accounts_in_message":[],"_revision_number":2},{"id":"a1a18318af51a5e3c0e6809482f41a5bdb42483d","author":{"_account_id":1002135,"name":"Mark Zhuang","email":"mark.zhuang@spacemit.com","username":"zqb-all"},"real_author":{"_account_id":1002135,"name":"Mark Zhuang","email":"mark.zhuang@spacemit.com","username":"zqb-all"},"date":"2024-09-02 13:46:16.000000000","message":"Patch Set 2: Code-Review+1\n\n(1 comment)","accounts_in_message":[],"_revision_number":2},{"id":"c6ea9dfb67be32d6aeb6d03e22e70441198dae68","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":"2024-09-15 09:04:55.000000000","message":"Patch Set 2: Code-Review+2","accounts_in_message":[],"_revision_number":2},{"id":"f6847e9cfa309fdce29bf65c420afb516a019fb5","tag":"autogenerated:gerrit:merged","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":"2024-09-15 09:05:04.000000000","message":"Change has been successfully cherry-picked as f0bad430df8e9fe0ff5323756a19ad2baa52e9f6","accounts_in_message":[],"_revision_number":3}],"current_revision":"f0bad430df8e9fe0ff5323756a19ad2baa52e9f6","revisions":{"a1a1957e5d5cdc61d013451f064e767642953e2a":{"kind":"REWORK","_number":1,"created":"2024-08-30 19:49:30.000000000","uploader":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"ref":"refs/changes/71/8471/1","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/71/8471/1","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/1 \u0026\u0026 git checkout -b change-8471 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/71/8471/1","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/1 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"e09bb72da50c9a9878565af23ee8d5465c11526d","subject":"target/cortex_m: add DSCSR_CDSKEY bit definition"}],"author":{"name":"Parshintsev Anatoly","email":"anatoly.parshintsev@syntacore.com","date":"2024-08-30 19:45:07.000000000","tz":180},"committer":{"name":"Parshintsev Anatoly","email":"anatoly.parshintsev@syntacore.com","date":"2024-08-30 19:49:17.000000000","tz":180},"subject":"rtos/hwthread: fix threadid generation","message":"rtos/hwthread: fix threadid generation\n\nLooks like 7f2d3e2925 introduced a regression by incorrectly assigning\nthreads. The title of the commit message says that the intention was to\n\"derive threadid from SMP index\", this is not what happens, however.\nInstead threadid is assigned based on an index of all examined targets\nin an SMP group.\n\nThis introduces two logical errors.\n\n*Error 1*\n\nHere is the code that assigns threads to harts:\n\n```\nforeach_smp_target(head, target-\u003esmp_targets) {\n  struct target *curr \u003d head-\u003etarget;\n\n  if (!target_was_examined(curr))\n    continue;\n\n  threadid_t tid \u003d threads_found + 1;\n  hwthread_fill_thread(rtos, curr, threads_found, tid);\n```\n\nNow, imagine a situation when we have two targets: `target.A` and `target.B`.\nLet\u0027s assume that `target.A` is NOT examined (it could be under reset, for example).\nThen, according to the algorithm when assigning thread identifiers `target.B`\nwill be assigned tid of 1. The respected inferior on GDB side will be called\n`Thread 1`.\n\nNow, imagine that `target.A` activates and succefully examined - OpenOCD will\nre-assign thread identifiers. And now on GDB side `Thread 1` will represent\nthe state of `target.A`. Which is incorrect.\n\n*Error 2*\n\nThe reverse mapping between `threadid` and targets does not take the state\nof targets into account.\n\n```\nstatic struct target *hwthread_find_thread(struct target *target, threadid_t thread_id)\n...\n  threadid_t tid \u003d 1;\n  foreach_smp_target(head, target-\u003esmp_targets) {\n    if (thread_id \u003d\u003d tid)\n      head-\u003etarget;\n    ++tid;\n  }\n```\n\nSo the constructed mapping is incorrect. Since in example above `Thread 1` will\nget mapped to `target.A`.\n\n*Solution:*\n\nIt seems that threadids should be assigned based on position of the thread\nin an smp group disregarding the target state.\n\nChange-Id: Ib93b7ed3bb03696afdf56a105b333e22b9ec69b5\nSigned-off-by: Parshintsev Anatoly \u003canatoly.parshintsev@syntacore.com\u003e\n"}},"be31b1a63892bda5ec1c79628c408bbbe9584c39":{"kind":"NO_CODE_CHANGE","_number":2,"created":"2024-08-30 19:58:10.000000000","uploader":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"ref":"refs/changes/71/8471/2","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/71/8471/2","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/2 \u0026\u0026 git checkout -b change-8471 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/71/8471/2","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/2 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"e09bb72da50c9a9878565af23ee8d5465c11526d","subject":"target/cortex_m: add DSCSR_CDSKEY bit definition"}],"author":{"name":"Parshintsev Anatoly","email":"anatoly.parshintsev@syntacore.com","date":"2024-08-30 19:45:07.000000000","tz":180},"committer":{"name":"Parshintsev Anatoly","email":"anatoly.parshintsev@syntacore.com","date":"2024-08-30 19:56:34.000000000","tz":180},"subject":"rtos/hwthread: fix threadid generation","message":"rtos/hwthread: fix threadid generation\n\nLooks like 7f2d3e2925 introduced a regression by incorrectly assigning\nthreads. The title of the commit message says that the intention was to\n\"derive threadid from SMP index\", this is not what happens, however.\nInstead threadid is assigned based on an index of all examined targets\nin an SMP group.\n\nThis introduces two logical errors.\n\n*Error 1*\n\nHere is the code that assigns threads to harts:\n\n```\nforeach_smp_target(head, target-\u003esmp_targets) {\n  struct target *curr \u003d head-\u003etarget;\n\n  if (!target_was_examined(curr))\n    continue;\n\n  threadid_t tid \u003d threads_found + 1;\n  hwthread_fill_thread(rtos, curr, threads_found, tid);\n```\n\nNow, imagine a situation when we have two targets: `target.A` and\n`target.B`.  Let\u0027s assume that `target.A` is NOT examined (it could be\nunder reset, for example).  Then, according to the algorithm when\nassigning thread identifiers `target.B` will be assigned tid of 1. The\nrespected inferior on GDB side will be called `Thread 1`.\n\nNow, imagine that `target.A` activates and succefully examined - OpenOCD\nwill re-assign thread identifiers. And now on GDB side `Thread 1` will\nrepresent the state of `target.A`. Which is incorrect.\n\n*Error 2*\n\nThe reverse mapping between `threadid` and targets does not take the\nstate of targets into account.\n\n```\nstatic struct target *\nhwthread_find_thread(struct target *target, threadid_t thread_id)\n...\n  threadid_t tid \u003d 1;\n  foreach_smp_target(head, target-\u003esmp_targets) {\n    if (thread_id \u003d\u003d tid)\n      head-\u003etarget;\n    ++tid;\n  }\n```\n\nSo the constructed mapping is incorrect. Since in example above\n`Thread 1` will get mapped to `target.A`.\n\n*Solution:*\n\nIt seems that threadids should be assigned based on position of the\nthread in an smp group disregarding the target state.\n\nChange-Id: Ib93b7ed3bb03696afdf56a105b333e22b9ec69b5\nSigned-off-by: Parshintsev Anatoly \u003canatoly.parshintsev@syntacore.com\u003e\n"}},"f0bad430df8e9fe0ff5323756a19ad2baa52e9f6":{"kind":"REWORK","_number":3,"created":"2024-09-15 09:05:04.000000000","uploader":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"ref":"refs/changes/71/8471/3","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/71/8471/3","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/3 \u0026\u0026 git checkout -b change-8471 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/3 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/3 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/3 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/71/8471/3","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/71/8471/3 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"cbed09ee9bdbba27ca93f5883b79595f7e9d347d","subject":"tcl/target: Make sure R-Car Gen3 _targets variable is global"}],"author":{"name":"Parshintsev Anatoly","email":"anatoly.parshintsev@syntacore.com","date":"2024-08-30 19:45:07.000000000","tz":180},"committer":{"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","date":"2024-09-15 09:05:04.000000000","tz":0},"subject":"rtos/hwthread: fix threadid generation","message":"rtos/hwthread: fix threadid generation\n\nLooks like 7f2d3e2925 introduced a regression by incorrectly assigning\nthreads. The title of the commit message says that the intention was to\n\"derive threadid from SMP index\", this is not what happens, however.\nInstead threadid is assigned based on an index of all examined targets\nin an SMP group.\n\nThis introduces two logical errors.\n\n*Error 1*\n\nHere is the code that assigns threads to harts:\n\n```\nforeach_smp_target(head, target-\u003esmp_targets) {\n  struct target *curr \u003d head-\u003etarget;\n\n  if (!target_was_examined(curr))\n    continue;\n\n  threadid_t tid \u003d threads_found + 1;\n  hwthread_fill_thread(rtos, curr, threads_found, tid);\n```\n\nNow, imagine a situation when we have two targets: `target.A` and\n`target.B`.  Let\u0027s assume that `target.A` is NOT examined (it could be\nunder reset, for example).  Then, according to the algorithm when\nassigning thread identifiers `target.B` will be assigned tid of 1. The\nrespected inferior on GDB side will be called `Thread 1`.\n\nNow, imagine that `target.A` activates and succefully examined - OpenOCD\nwill re-assign thread identifiers. And now on GDB side `Thread 1` will\nrepresent the state of `target.A`. Which is incorrect.\n\n*Error 2*\n\nThe reverse mapping between `threadid` and targets does not take the\nstate of targets into account.\n\n```\nstatic struct target *\nhwthread_find_thread(struct target *target, threadid_t thread_id)\n...\n  threadid_t tid \u003d 1;\n  foreach_smp_target(head, target-\u003esmp_targets) {\n    if (thread_id \u003d\u003d tid)\n      head-\u003etarget;\n    ++tid;\n  }\n```\n\nSo the constructed mapping is incorrect. Since in example above\n`Thread 1` will get mapped to `target.A`.\n\n*Solution:*\n\nIt seems that threadids should be assigned based on position of the\nthread in an smp group disregarding the target state.\n\nChange-Id: Ib93b7ed3bb03696afdf56a105b333e22b9ec69b5\nSigned-off-by: Parshintsev Anatoly \u003canatoly.parshintsev@syntacore.com\u003e\nReviewed-on: https://review.openocd.org/c/openocd/+/8471\nReviewed-by: Antonio Borneo \u003cborneo.antonio@gmail.com\u003e\nReviewed-by: Mark Zhuang \u003cmark.zhuang@spacemit.com\u003e\nTested-by: jenkins\nReviewed-by: Evgeniy Naydanov \u003cevgeniy.naydanov@syntacore.com\u003e\n"}}},"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":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"}}]}],"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":[]}}]}
