)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"d5835b1bdac8bd0bd58893b1204c5f1dd1594e70","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"rtos/hwthread: derive threadid from SMP index"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"As defined in `target/target.h`, `coreid` is the index of the target on"},{"line_number":10,"context_line":"the TAP, so, if an SMP group includes targets from multiple TAPs, it can"},{"line_number":11,"context_line":"not be used as the base for `threadid`."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: Ied7cfa42197aaf4908ef6628c6436f28d4856ebe"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"725a4c6a_2053bc29","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":7},"updated":"2024-01-12 18:17:14.000000000","message":"The comment in target.h reads:\n`/* which device on the TAP? */`\nKind of vague wording, author missed the possibility of SMP cores on multiple TAPs. I wouldn\u0027t interpret the comment it as you did.\n\nUnfortunately `target create/configure -coreid` documentation is missing.\n\nIn fact coreid setting fully depends on the target config file.\nOne can easily index over multiple TAPs.\n\nDo we need this patch? I don\u0027t think so.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"24e9ed6f5ab83b4d5e98d8fd4fe1bde4095897c6","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"rtos/hwthread: derive threadid from SMP index"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"As defined in `target/target.h`, `coreid` is the index of the target on"},{"line_number":10,"context_line":"the TAP, so, if an SMP group includes targets from multiple TAPs, it can"},{"line_number":11,"context_line":"not be used as the base for `threadid`."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: Ied7cfa42197aaf4908ef6628c6436f28d4856ebe"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"4ff335ca_53997b69","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":7},"in_reply_to":"725a4c6a_2053bc29","updated":"2024-01-13 09:41:15.000000000","message":"Thank you for the review!\n\nAs you\u0027ve mentioned, there is no clear definition of the `-coreid` parameter.\nThe issue is, the use in `hwthread` RTOS is not the only use-case in the code base. E.g.: RISC-V cores are accessed via a debug module (DM). Each TAP can have multiple DMs on it. The value of `coreid` parameter is used to select the target on the DM. This use-case breaks if `coreid` is unique across multiple TAPs.\n\nI would like to know what is the definition you would suggest, that would be OK to use in `hwthread`? The only thing I came up with is something along the lines of: unique numerical identifier of a target. However, then it\u0027s unclear why should it be user-configurable -- one can just use the index in the list of all targets for this purpose. Moreover, in that case one should verify the user-specified parameter is actually unique. There is one more issue -- this could result in sparce thread numbers for GDB. I don\u0027t expect this to be an issue, apart from the confusion it might cause.\n\nMoreover, IMHO this is worthwhile to minimize the amount of configuration required from a user, as each such parameter should be properly documented and verified. This patch would allow to use `hwthread` RTOS without specifying `coreid`. I\u0027m open to an alternative: I can create a patch with documentation and constrains for the `coreid` parameter, with the appropriate verification. But I would need your ideas on what are these constrains.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"b670eb04781d52199ff3935b7c81efa15e64a6e1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"bbff84c2_f4065f42","updated":"2024-01-12 14:26:39.000000000","message":"Antonio, Tomas, can you please take a look or recommend someone who I should ask to review this change?","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"161f408a48a5365125125f262e98bc4e12fc6b4e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"514738e5_787efa1e","updated":"2024-01-14 22:56:32.000000000","message":"Looking in git history, \u0027coreid\u0027 was initially introduced to help searching for Cortex-A9 SMP cores on a single arm AP.\nCommit aea22bdbd14c (\"Add \u0027-coreid\u0027 target option to support multiple cores per TAP.\")\nCommit c34e69cb10bb (\"cortex_a9: add source files for Cortex A9 support.\")\nIn fact the \u0027target create\u0027 command either receives directly -dbgbase, or uses -coreid to search in the ROM table for the value dbgbase.\nToday coreid is still used for this.\n\nLater on, this same \u0027coreid\u0027 has been re-used as SMP index, but this is incorrect!\n\nPossible issues:\nIn a config file that only uses -dbgbase and does not specify -coreid, all the cores will have codeid\u003d0.\nFor SMP cores spread on two or more AP, what will coreid mean? Index on AP or SMP index?\nTomas has recently introduced Cortex-M SMP and tcl/target/rp2040.cfg use it. Here the two Cortex-M are on different AP and also use different coreid. But this is possible because the code for Cortex-M ignores the coreid while searching the core. This will not work for two Cortex-R or two Cortex-A on separate AP.\n\nAlso the code of psoc6 abuses of coreid to determine which core should run the flashing algorithm. Again coreid not to find the core, not for SMP. Look for coreid in\nsrc/flash/nor/psoc6.c\ntcl/target/psoc6.cfg\n\nI think we should split these use cases and properly document them.\n- Keep -coreid in \u0027target create\u0027 only for the search in the AP (or TAP)\n- Identify an index for the SMP. The position in the command \u0027target smp\u0027 could be a good candidate. This patch goes in the right direction but I see too much code smp related that still relies on target-\u003ecoreid. We need more cleanup. And we should guarantee backward compatibility in the config files, so we should probably reorder the list of commands \u0027target smp\u0027 so the order matches the old coreid.\n- Find the other cases where coreid is used (like psoc6) and fix them.\n\nThere is some work ongoing on psoc6 driver\nhttps://review.openocd.org/c/openocd/+/7983\nIt could be the right moment to drop the dependency from coreid in this file.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"34e04785ca5276a088701b41b46026d2451fb6ec","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"0e230f5d_2ba5f697","updated":"2024-06-09 16:41:13.000000000","message":"Looks good, just a minor safety recommendation","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1002143,"name":"Marek Vrbka","email":"marek.vrbka@codasip.com","username":"MarekVCodasip"},"change_message_id":"2e471cdf041e89d74e25bd337300f706347a106f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"532b6cce_bf985676","updated":"2023-11-09 17:07:44.000000000","message":"Thanks for the patch.\n\nI do raise a small question which is likely worth considering, please take a look.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"984d4d83b2a287ba53be8632e948b596bfa6660a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"911fb1ba_dd4ce588","updated":"2024-04-27 09:14:53.000000000","message":"Tomas, Antonio, can this one be merged or is there something I need to do?","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"8844880bb7603ddbb20ead26e213ffae66c9efa6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"4856b583_9799bd0c","updated":"2024-05-30 16:30:21.000000000","message":"Tomas, Antonio, can this patch be merged or is there something I need to do?","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"a88310793a68faadd9dc36bb178148686cef11d7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"7c1e177b_ed533ea3","in_reply_to":"514738e5_787efa1e","updated":"2024-01-15 09:37:04.000000000","message":"Evgeniy, Antonio, thanks for clarification.\n\n\u003e In fact the \u0027target create\u0027 command either receives directly -dbgbase, or uses -coreid to search in the ROM table for the value dbgbase.\n\nI missed that it\u0027s still used as dap_lookup_cs_component() index, I had wrong feeling that config files now always define dbgbase.\n\n\u003e Later on, this same \u0027coreid\u0027 has been re-used as SMP index, but this is incorrect!\n\nHowever it is simple, intuitive and works except the SMP cores spread on two or more AP.\n\n\u003e Possible issues:\n\u003e In a config file that only uses -dbgbase and does not specify -coreid, all the cores will have codeid\u003d0.\n\nWe can regard this case as the configuration error (if the doc improves)\n\n\u003e For SMP cores spread on two or more AP, what will coreid mean? Index on AP or SMP index?\n\nYes, in that case we obviously need per TAP coreid for RiscV set_hartsel() or Cortex-A/AArch64 dap_lookup_cs_component() independent from SMP coreid.\n\nCould you give some examples of such SoCs and how they are organised?\n\n\u003e Also the code of psoc6 abuses of coreid to determine which core should run the flashing algorithm. Again coreid not to find the core, not for SMP.\n\nAgain it\u0027s fully compliant with the variable name (until its usage is narrowed by the documentation).\n \n\u003e I think we should split these use cases and properly document them.\n\u003e - Keep -coreid in \u0027target create\u0027 only for the search in the AP (or TAP)\n\u003e - Identify an index for the SMP. The position in the command \u0027target smp\u0027 could be a good candidate. This patch goes in the right direction but I see too much code smp related that still relies on target-\u003ecoreid. We need more cleanup. And we should guarantee backward compatibility in the config files, so we should probably reorder the list of commands \u0027target smp\u0027 so the order matches the old coreid.\n\nMostly agree.\n\nsrc/target/smp.c uses coreid as a local variable in the deprecated code. Maybe it\u0027s the right time to drop the hack using gdb maint packet j, jc and J\n\nsrc/target/espressif/esp_xtensa_smp.c uses coreid to distinguish the service core for reset. Undoubtedly a legitimate request, but how to make it compatible with SMP spread on more cores?\nAlso very suspicious getting of cores_max_id\n\nIt looks that only rtos/hwthread.c and rtos/linux.c use coreid in the SMP meaning.\n\nMy concern:\n`target create -coreid` allows arbitrary numbering. If some core numbers are left out for whatever reason on an ordinary SoC with all cores on one TAP, we get confusing hwthread numbers different than configured coreid. Is it likely to happen? Should we tolerate it? Otherwise we should first verify if coreids are unique and if not, switch to the smp list index.\n\n\u003e There is some work ongoing on psoc6 driver\n\u003e https://review.openocd.org/c/openocd/+/7983\n\u003e It could be the right moment to drop the dependency from coreid in this file.\n\nUnfortunately 7983 is full of crap from the Cypress fork.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"9f4464f02fc22e391ecb4acc1c837fb1730fadfa","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"e9cfd483_394d9930","in_reply_to":"5de26fc8_68c1c3b7","updated":"2024-02-01 09:42:58.000000000","message":"\u003e \u003e Could you give some examples of such SoCs and how they are organised?\n\u003e \n\u003e I have searched, but I haven\u0027t found. Apart for RP2040.\n\nJust to clarify the history and role of `-coreid` in rp2040.cfg\nThe option was used in the original config created by RPi guys\nhttps://github.com/raspberrypi/openocd/commit/c33cb2bfc4cbb4a5e70f35cc72c9f9421b439fc3\n\nI copied it as it makes no harm and in believe hwthread needs it. There is no use of coreid in the Cortex-M SMP implementation.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"4ba6b36ca13a7a865780821b9c9afd5de2a6c3d9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"5de26fc8_68c1c3b7","in_reply_to":"7c1e177b_ed533ea3","updated":"2024-01-31 23:21:40.000000000","message":"\u003e Could you give some examples of such SoCs and how they are organised?\n\nI have searched, but I haven\u0027t found. Apart for RP2040.\nI thought about the big devices from Ampere Computing, but they have all the cores on the same AP.\n\nI plan to drop the deprecated smp code after v0.13.0 because they were deprecated between v0.11.0 and v0.12.0.\n\nI\u0027m also looking for an easy way to use hwthread rtos automatically with smp, possibly together with another real rtos awareness (e.g. linux + hwthread).\n\nI have quickly tested the current Linux rtos and I\u0027m quite disappointed.\nI\u0027m now looking at how kgdb works and trying to get a similar user experience.\nKgdb uses a 32bit unsigned for thread ID, with values 1,2,3,... for the real Linux threads and 0xffff_ffff (-1),0xffff_fffe (-2),... for the hwthreads/core-ID. Kgdb shows a link between the hwthread and the real thread, to easily track what is running on the real CPUs.\nIt could be interesting to use a progressive positive SMP index for hwthreads alone, and changing its sign to negative when hwthreads is used (when it would be possible to use it) together with a real rtos.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1002135,"name":"Mark Zhuang","email":"mark.zhuang@spacemit.com","username":"zqb-all"},"change_message_id":"c654c9654e0ce0db65bc58dc4646e24d4263fa01","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"5af47ff2_7e49f316","in_reply_to":"911fb1ba_dd4ce588","updated":"2024-05-11 08:35:11.000000000","message":"Evgeniy, thanks for the patch, we have a RISC-V chip with multiple DMs and need this patch to work properly. \nTomas, Antonio, thanks for the review, we also want to know if this patch can be merged.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b3cfb686dda16077dcf3a138e2f63b6d3e672071","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"4a91c8f7_d4294ee6","in_reply_to":"e9cfd483_394d9930","updated":"2024-02-03 21:43:25.000000000","message":"\u003e I missed that it\u0027s still used as dap_lookup_cs_component() index, I had wrong feeling that config files now always define dbgbase.\n\nThese are the config files that use coreid instead of dbgbase\ntcl/target/ampere_emag.cfg\ntcl/target/ampere_qs_mq.cfg\ntcl/target/cavium_cn61xx.cfg\ntcl/target/hi3798.cfg\ntcl/target/hi6220.cfg\ntcl/target/marvell/cn9130.cfg\ntcl/target/rk3308.cfg","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"3ff69e62e09f1491726c827dfa015e09a1cb3dde","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"987d0181_b16c387c","updated":"2024-06-24 09:29:12.000000000","message":"Sorry for taking so long to address this. Please, take a look.","commit_id":"c3a9c81a49dec61841c819a345ab5afcd3ebc0a2"},{"author":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"change_message_id":"a350c6f2fa81fcc45dab72109de3a5e8d94cb59f","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"800bb66d_74aef19a","updated":"2024-08-30 20:32:01.000000000","message":"It looks like this patch has a bug - it does not look like threadid is assigned correctly. I\u0027ve tried to describe the issue in a greater detail and suggested a possible solution here: https://review.openocd.org/c/openocd/+/8471 .","commit_id":"7f2d3e2925833c952ee73fb178c8fdee637c844e"}],"src/rtos/hwthread.c":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"34e04785ca5276a088701b41b46026d2451fb6ec","unresolved":true,"context_lines":[{"line_number":41,"context_line":"\t\t\tbreak;"},{"line_number":42,"context_line":"\t\t++threadid;"},{"line_number":43,"context_line":"\t}"},{"line_number":44,"context_line":"\treturn threadid;"},{"line_number":45,"context_line":"}"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"const struct rtos_type hwthread_rtos \u003d {"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"05b6cac0_a7408f3a","line":44,"updated":"2024-06-09 16:41:13.000000000","message":"In the corner case the target is not found in smp list it silently returns the number of threads + 1. Wouldn\u0027t be better to log an error?","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"13510f489ce9b4fb3694ac0e406f5119632ba4a8","unresolved":true,"context_lines":[{"line_number":41,"context_line":"\t\t\tbreak;"},{"line_number":42,"context_line":"\t\t++threadid;"},{"line_number":43,"context_line":"\t}"},{"line_number":44,"context_line":"\treturn threadid;"},{"line_number":45,"context_line":"}"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"const struct rtos_type hwthread_rtos \u003d {"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"06ff88b0_ace115ce","line":44,"in_reply_to":"04a93d4b_d2e13095","updated":"2024-06-26 22:55:05.000000000","message":"I don\u0027t like the assert() because:\n- the text does not go in the log (see command ``log_output``), nor to the telnet console, nor to GDB console;\n- the assert() disappears while compiling with -DNDEBUG;\n- a sudden quit of the OpenOCD started inside an IDE makes debugging the issue much harder (mainly if the log does not report anything, as told before);\n- static checker ``sparse`` complains about the test containing ``bool \u0026 const char *`` (I don\u0027t remember the error message).\n\nLet\u0027s keep it here, but we need to find a better way to handle these cases.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1002135,"name":"Mark Zhuang","email":"mark.zhuang@spacemit.com","username":"zqb-all"},"change_message_id":"48aab6b682742f7b955b1867396b22efe000db65","unresolved":true,"context_lines":[{"line_number":41,"context_line":"\t\t\tbreak;"},{"line_number":42,"context_line":"\t\t++threadid;"},{"line_number":43,"context_line":"\t}"},{"line_number":44,"context_line":"\treturn threadid;"},{"line_number":45,"context_line":"}"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"const struct rtos_type hwthread_rtos \u003d {"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"ede23f0f_9069ba21","line":44,"in_reply_to":"05b6cac0_a7408f3a","updated":"2024-06-24 03:07:12.000000000","message":"Evgeniy, could you spare some time to update this patch? Or if you don\u0027t mind, I can try adding this log to help the patch merge.\nWe have a riscv chip that needs this patch and plan to submit the cfg file after this patch is merged.\nThank you.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"3ff69e62e09f1491726c827dfa015e09a1cb3dde","unresolved":true,"context_lines":[{"line_number":41,"context_line":"\t\t\tbreak;"},{"line_number":42,"context_line":"\t\t++threadid;"},{"line_number":43,"context_line":"\t}"},{"line_number":44,"context_line":"\treturn threadid;"},{"line_number":45,"context_line":"}"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"const struct rtos_type hwthread_rtos \u003d {"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"04a93d4b_d2e13095","line":44,"in_reply_to":"ede23f0f_9069ba21","updated":"2024-06-24 09:29:12.000000000","message":"You are right. Though I\u0027ve added an assertion instead of a `LOG_ERROR` since IMHO it\u0027s a critical issue if a hart is not found in it\u0027s own SMP group.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1002143,"name":"Marek Vrbka","email":"marek.vrbka@codasip.com","username":"MarekVCodasip"},"change_message_id":"2e471cdf041e89d74e25bd337300f706347a106f","unresolved":true,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":"\trtos-\u003ethread_count \u003d threads_found;"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"\t/* we found an interesting thread, set it as current */"},{"line_number":199,"context_line":"\tif (current_thread !\u003d 0)"},{"line_number":200,"context_line":"\t\trtos-\u003ecurrent_thread \u003d current_thread;"},{"line_number":201,"context_line":"\telse if (rtos-\u003ecurrent_threadid !\u003d 0)"},{"line_number":202,"context_line":"\t\trtos-\u003ecurrent_thread \u003d rtos-\u003ecurrent_threadid;"},{"line_number":203,"context_line":"\telse"},{"line_number":204,"context_line":"\t\trtos-\u003ecurrent_thread \u003d threadid_from_target(target);"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"\tLOG_DEBUG(\"%s current_thread\u003d%i\", __func__, (int)rtos-\u003ecurrent_thread);"},{"line_number":207,"context_line":"\treturn 0;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"a9240525_720eb3b2","line":204,"range":{"start_line":198,"start_character":1,"end_line":204,"end_character":54},"updated":"2023-11-09 17:07:44.000000000","message":"Is the case when current_thread \u003d\u003d 0 even possible at this point?\n\nIf not, I would put in an assert that current_thread !\u003d 0, just in case.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1002143,"name":"Marek Vrbka","email":"marek.vrbka@codasip.com","username":"MarekVCodasip"},"change_message_id":"7c739ed72b7540bd28754704ffe332120e10e39a","unresolved":false,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":"\trtos-\u003ethread_count \u003d threads_found;"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"\t/* we found an interesting thread, set it as current */"},{"line_number":199,"context_line":"\tif (current_thread !\u003d 0)"},{"line_number":200,"context_line":"\t\trtos-\u003ecurrent_thread \u003d current_thread;"},{"line_number":201,"context_line":"\telse if (rtos-\u003ecurrent_threadid !\u003d 0)"},{"line_number":202,"context_line":"\t\trtos-\u003ecurrent_thread \u003d rtos-\u003ecurrent_threadid;"},{"line_number":203,"context_line":"\telse"},{"line_number":204,"context_line":"\t\trtos-\u003ecurrent_thread \u003d threadid_from_target(target);"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"\tLOG_DEBUG(\"%s current_thread\u003d%i\", __func__, (int)rtos-\u003ecurrent_thread);"},{"line_number":207,"context_line":"\treturn 0;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"77db014c_2a89086b","line":204,"range":{"start_line":198,"start_character":1,"end_line":204,"end_character":54},"in_reply_to":"18a68630_5e6b8299","updated":"2023-11-16 07:32:06.000000000","message":"Thanks for the reply.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"551edcfb8f1976dcabdd28205e0e020acfb7cede","unresolved":true,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":"\trtos-\u003ethread_count \u003d threads_found;"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"\t/* we found an interesting thread, set it as current */"},{"line_number":199,"context_line":"\tif (current_thread !\u003d 0)"},{"line_number":200,"context_line":"\t\trtos-\u003ecurrent_thread \u003d current_thread;"},{"line_number":201,"context_line":"\telse if (rtos-\u003ecurrent_threadid !\u003d 0)"},{"line_number":202,"context_line":"\t\trtos-\u003ecurrent_thread \u003d rtos-\u003ecurrent_threadid;"},{"line_number":203,"context_line":"\telse"},{"line_number":204,"context_line":"\t\trtos-\u003ecurrent_thread \u003d threadid_from_target(target);"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"\tLOG_DEBUG(\"%s current_thread\u003d%i\", __func__, (int)rtos-\u003ecurrent_thread);"},{"line_number":207,"context_line":"\treturn 0;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"18a68630_5e6b8299","line":204,"range":{"start_line":198,"start_character":1,"end_line":204,"end_character":54},"in_reply_to":"a9240525_720eb3b2","updated":"2023-11-15 12:04:38.000000000","message":"Yes, `current_thread \u003d\u003d 0` is possible, since some `DBG_REASONS_*` of a target in an SMP group do not overwrite `current_thread` (`DBG_REASON_WPTANDBKPT`, `DBG_REASON_NOTHALTED`,`DBG_REASON_EXIT`, `DBG_REASON_EXC_CATCH`). If all the targets in the group have one of these reasons, `current_thread` will still be zero here.","commit_id":"7b132bc3d9dbce8a9009bc80407d503ee6a86e74"}]}
