)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"925c5049c84fe9e841773a691c48a880ce953c83","unresolved":true,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If multiple targets are specified as -rtos \u003crtos_type\u003e, the"},{"line_number":10,"context_line":"rtos_update_threads was called only if the last target was specified as"},{"line_number":11,"context_line":"rtos, which is inconcistent with other checks of whether or not smp target"},{"line_number":12,"context_line":"is an rtos one."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Signed-off-by: Evgeniy Naydanov \u003cevgeniy.naydanov@syntacore.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"f6e27686_7284213d","line":11,"updated":"2022-11-25 22:31:43.000000000","message":"typo s/inconcistent/inconsistent/","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"955e334de62e969fae447a240bc9c9fa594a84ac","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If multiple targets are specified as -rtos \u003crtos_type\u003e, the"},{"line_number":10,"context_line":"rtos_update_threads was called only if the last target was specified as"},{"line_number":11,"context_line":"rtos, which is inconcistent with other checks of whether or not smp target"},{"line_number":12,"context_line":"is an rtos one."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Signed-off-by: Evgeniy Naydanov \u003cevgeniy.naydanov@syntacore.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"e01d2f6a_70d4082c","line":11,"in_reply_to":"f6e27686_7284213d","updated":"2022-11-28 09:08:55.000000000","message":"Done","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"071c7284135cdf193da22f8680127b5273ab05a6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"3bee51f5_2a51c6eb","updated":"2022-10-05 17:30:40.000000000","message":"Do I understand correctly that the actual fix is on lines 6488-6491 and the rest is just refactor?\n\nCould you please provide here a .cfg file that allows to test this change (for example against Spike ISS)? This will help other people to review and approve this change.\n\nThank you.","commit_id":"2d1c18d81932efa0bb78e7b56e4c9c7a590607cf"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"679927293c4db713fc6665968c57698d62205008","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d08d4f4b_14932c92","in_reply_to":"3bee51f5_2a51c6eb","updated":"2022-10-19 15:31:51.000000000","message":"\u003e Do I understand correctly that the actual fix is on lines 6488-6491 and the rest is just refactor?\n\nYes, you are right. Originally, my changes were part of a PR to riscv-openocd (https://github.com/riscv/riscv-openocd/pull/734). It affects (meaning it fixes a bug) some code in\nbreakpoint_add which is yet to be merged into openocd mainline (See this commit: https://github.com/riscv/riscv-openocd/commit/52ca5d198e3b4a0565e810ff4b5545dfac39cec9).\n\n\u003e Could you please provide here a .cfg file that allows to test this change (for example against Spike ISS)? This will help other people to review and approve this change.\n\n1-st config: An example of counterintuitive behavior prior to suggested changes.\n```\n#For this config, rtos_smp_init is not called in jim_target_smp, because the last target in target smp is not specified as -rtos, but further, this smp target is considered rtos (See this commit: https://github.com/riscv/riscv-openocd/commit/52ca5d198e3b4a0565e810ff4b5545dfac39cec9).\n\nproc init_targets {} {\n\tadapter speed 2000\n\treset_config trst_and_srst\n\n\tset _CHIPNAME riscv\n\tjtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x10e31913\n\n\tset _TARGETNAME_0 $_CHIPNAME.cpu0\n\tset _TARGETNAME_1 $_CHIPNAME.cpu1\n\tset _TARGETNAME_2 $_CHIPNAME.cpu2\n\tset _TARGETNAME_3 $_CHIPNAME.cpu3\n\n\ttarget create $_TARGETNAME_0 riscv -chain-position $_CHIPNAME.cpu -coreid 0 -rtos hwthread\n\ttarget create $_TARGETNAME_1 riscv -chain-position $_CHIPNAME.cpu -coreid 1\n\ttarget create $_TARGETNAME_2 riscv -chain-position $_CHIPNAME.cpu -coreid 2\n\ttarget create $_TARGETNAME_3 riscv -chain-position $_CHIPNAME.cpu -coreid 3\n\n\ttarget smp $_TARGETNAME_0 $_TARGETNAME_1 $_TARGETNAME_2 $_TARGETNAME_3\n\n\tgdb_report_data_abort enable\n\tgdb_report_register_access_error enable\n}\n```\nOnce this patch is applied smp target is identified as an rtos target.\n\n2-nd config: An example of counterintuitive behavior prior to suggested changes. \n```\n#For this config, rtos_smp_init is called in jim_target_smp, because the last target in target smp is specified as -rtos, but further, this smp target is not considered rtos (See this commit: https://github.com/riscv/riscv-openocd/commit/52ca5d198e3b4a0565e810ff4b5545dfac39cec9).\n\nproc init_targets {} {\n\tadapter speed 2000\n\treset_config trst_and_srst\n\n\tset _CHIPNAME riscv\n\tjtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x10e31913\n\n\tset _TARGETNAME_0 $_CHIPNAME.cpu0\n\tset _TARGETNAME_1 $_CHIPNAME.cpu1\n\tset _TARGETNAME_2 $_CHIPNAME.cpu2\n\tset _TARGETNAME_3 $_CHIPNAME.cpu3\n\n\ttarget create $_TARGETNAME_0 riscv -chain-position $_CHIPNAME.cpu -coreid 0\n\ttarget create $_TARGETNAME_1 riscv -chain-position $_CHIPNAME.cpu -coreid 1\n\ttarget create $_TARGETNAME_2 riscv -chain-position $_CHIPNAME.cpu -coreid 2\n\ttarget create $_TARGETNAME_3 riscv -chain-position $_CHIPNAME.cpu -coreid 3 -rtos hwthread\n\n\ttarget smp $_TARGETNAME_0 $_TARGETNAME_1 $_TARGETNAME_2 $_TARGETNAME_3\n\n\tgdb_report_data_abort enable\n\tgdb_report_register_access_error enable\n}\n```\nOnce this patch is applied smp target is not identified as an rtos target.","commit_id":"2d1c18d81932efa0bb78e7b56e4c9c7a590607cf"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"679927293c4db713fc6665968c57698d62205008","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"b0b13623_32dfba5d","updated":"2022-10-19 15:31:51.000000000","message":"I have added second patchset. It changes the behavior, so it is the same in both situations (1-st and 2-nd config), which seems to be more comprehensive.","commit_id":"66a133d89e14354d3558528dab1d907cf872221c"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"6331bf9cc86c04f1ea202bc9d0ecfe970e08561f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"d3c80ae5_ddfb3bdf","updated":"2022-11-23 08:44:22.000000000","message":"Could you please review my changes?","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"925c5049c84fe9e841773a691c48a880ce953c83","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"a3bb2e1b_fd92e877","updated":"2022-11-25 22:31:43.000000000","message":"Thanks for the patch.\nAgree, I also get mad on where to put -rtos\nI have few minor comments inline.\n\nBy the way, I noticed that the command \u0027target smp\u0027 has some other issue:\n- if one of the target names is incorrect (e.g. miss-spelled), the command simply skip it and goes ahead creating the SMP node without it. User don\u0027t get any info, until it get mad using the SMP node. I think the command should not create the node and return error.\n- if one target was already part of a SMP node, adding it by mistake to another SMP node makes mess: The target is added in the new node and only points to it, but the other targets in the previous node still keep it in their list. Targets should tested for !target-\u003esmp_targets, or for target-\u003esmp\u003d\u003d0.\n\nWould you be interested/motivated at fixing the two cases above in new patches?\n","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"3531955b6b9bb43d7082c363e825e27c43023aaa","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"a8a4358f_52f84a5a","in_reply_to":"a3bb2e1b_fd92e877","updated":"2022-11-28 09:08:25.000000000","message":"Yes, sure, I\u0027ll be glad to do it, although it can take some time","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"3531955b6b9bb43d7082c363e825e27c43023aaa","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"f4c0a998_ae656f46","updated":"2022-11-28 09:08:25.000000000","message":"Thank you for the review. Fixed all the issues","commit_id":"c9aa4d41465a7f44c0450613a50c9ff156f80de3"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"9c2210bd3a6ebf36179de375b8ec9880e8b9280e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"11b8b55c_7253b9c1","updated":"2022-11-28 23:55:10.000000000","message":"With this patch we have to put -rtos to the first target or to all targets.\nThis is in line with the existing cfg files in OpenOCD.\nJan, any comment?","commit_id":"c9aa4d41465a7f44c0450613a50c9ff156f80de3"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"6c31adfbc6a709c2631415c9c625c6cb61dd4106","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"e69aa4e4_7166c04d","in_reply_to":"11b8b55c_7253b9c1","updated":"2022-11-30 11:43:33.000000000","message":"You ain\u0027t quite right. Actually, it is possible to specify any number of targets in `target smp` as `-rtos`, as long as the rtos specified is the same one (e.g. the 2-nd and 3-rd is specified as `-rtos hwthread` and the 1-st and the 2-nd don\u0027t have an `-rtos` specifyer)","commit_id":"c9aa4d41465a7f44c0450613a50c9ff156f80de3"}],"src/target/target.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"925c5049c84fe9e841773a691c48a880ce953c83","unresolved":true,"context_lines":[{"line_number":6456,"context_line":"static int get_target_with_common_rtos_type(struct list_head *lh, struct target **result)"},{"line_number":6457,"context_line":"{"},{"line_number":6458,"context_line":"\tstruct target_list *first \u003d list_first_entry(lh, typeof(*first), lh);"},{"line_number":6459,"context_line":"\tstruct target *target \u003d first-\u003etarget;"},{"line_number":6460,"context_line":"\tstruct target_list *curr;"},{"line_number":6461,"context_line":"\tforeach_smp_target(curr, lh) {"},{"line_number":6462,"context_line":"\t\tstruct rtos *curr_rtos \u003d curr-\u003etarget-\u003ertos;"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"8e73e288_ef22b534","line":6459,"updated":"2022-11-25 22:31:43.000000000","message":"the first target is used twice.\nPut here\nstruct target *target \u003d NULL\nand below ...","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"3531955b6b9bb43d7082c363e825e27c43023aaa","unresolved":false,"context_lines":[{"line_number":6456,"context_line":"static int get_target_with_common_rtos_type(struct list_head *lh, struct target **result)"},{"line_number":6457,"context_line":"{"},{"line_number":6458,"context_line":"\tstruct target_list *first \u003d list_first_entry(lh, typeof(*first), lh);"},{"line_number":6459,"context_line":"\tstruct target *target \u003d first-\u003etarget;"},{"line_number":6460,"context_line":"\tstruct target_list *curr;"},{"line_number":6461,"context_line":"\tforeach_smp_target(curr, lh) {"},{"line_number":6462,"context_line":"\t\tstruct rtos *curr_rtos \u003d curr-\u003etarget-\u003ertos;"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"828c9c68_a95bf0ed","line":6459,"in_reply_to":"8e73e288_ef22b534","updated":"2022-11-28 09:08:25.000000000","message":"Done","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"925c5049c84fe9e841773a691c48a880ce953c83","unresolved":true,"context_lines":[{"line_number":6461,"context_line":"\tforeach_smp_target(curr, lh) {"},{"line_number":6462,"context_line":"\t\tstruct rtos *curr_rtos \u003d curr-\u003etarget-\u003ertos;"},{"line_number":6463,"context_line":"\t\tif (curr_rtos) {"},{"line_number":6464,"context_line":"\t\t\tif (target-\u003ertos \u0026\u0026 target-\u003ertos-\u003etype !\u003d curr_rtos-\u003etype) {"},{"line_number":6465,"context_line":"\t\t\t\tLOG_ERROR(\"Different rtos types in members of one smp target!\");"},{"line_number":6466,"context_line":"\t\t\t\treturn JIM_ERR;"},{"line_number":6467,"context_line":"\t\t\t}"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"d1bc57d5_ee1703e6","line":6464,"updated":"2022-11-25 22:31:43.000000000","message":"... add test on target as first\nif (target \u0026\u0026 target-\u003ertos \u0026\u0026 target-\u003ertos-\u003etype !\u003d curr_rtos-\u003etype) {","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"3531955b6b9bb43d7082c363e825e27c43023aaa","unresolved":false,"context_lines":[{"line_number":6461,"context_line":"\tforeach_smp_target(curr, lh) {"},{"line_number":6462,"context_line":"\t\tstruct rtos *curr_rtos \u003d curr-\u003etarget-\u003ertos;"},{"line_number":6463,"context_line":"\t\tif (curr_rtos) {"},{"line_number":6464,"context_line":"\t\t\tif (target-\u003ertos \u0026\u0026 target-\u003ertos-\u003etype !\u003d curr_rtos-\u003etype) {"},{"line_number":6465,"context_line":"\t\t\t\tLOG_ERROR(\"Different rtos types in members of one smp target!\");"},{"line_number":6466,"context_line":"\t\t\t\treturn JIM_ERR;"},{"line_number":6467,"context_line":"\t\t\t}"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"32976624_a7563939","line":6464,"in_reply_to":"d1bc57d5_ee1703e6","updated":"2022-11-28 09:08:25.000000000","message":"Done","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"925c5049c84fe9e841773a691c48a880ce953c83","unresolved":true,"context_lines":[{"line_number":6468,"context_line":"\t\t\ttarget \u003d curr-\u003etarget;"},{"line_number":6469,"context_line":"\t\t}"},{"line_number":6470,"context_line":"\t}"},{"line_number":6471,"context_line":"\tassert(result);"},{"line_number":6472,"context_line":"\t*result \u003d target;"},{"line_number":6473,"context_line":"\treturn JIM_OK;"},{"line_number":6474,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"f2e41d9e_0f2bf4de","line":6471,"updated":"2022-11-25 22:31:43.000000000","message":"I think you can remove this assert()\nThe only caller already provides it and if in future another caller would not provide it, OpenOCD will crash at next line; not so different as assert()","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"3531955b6b9bb43d7082c363e825e27c43023aaa","unresolved":false,"context_lines":[{"line_number":6468,"context_line":"\t\t\ttarget \u003d curr-\u003etarget;"},{"line_number":6469,"context_line":"\t\t}"},{"line_number":6470,"context_line":"\t}"},{"line_number":6471,"context_line":"\tassert(result);"},{"line_number":6472,"context_line":"\t*result \u003d target;"},{"line_number":6473,"context_line":"\treturn JIM_OK;"},{"line_number":6474,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"7d53408e_1bfd68b1","line":6471,"in_reply_to":"f2e41d9e_0f2bf4de","updated":"2022-11-28 09:08:25.000000000","message":"Done","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"925c5049c84fe9e841773a691c48a880ce953c83","unresolved":true,"context_lines":[{"line_number":6480,"context_line":""},{"line_number":6481,"context_line":"\tif (argc \u003d\u003d 1) {"},{"line_number":6482,"context_line":"\t\tLOG_DEBUG(\"Empty SMP target\");"},{"line_number":6483,"context_line":"\t\treturn retval;"},{"line_number":6484,"context_line":"\t}"},{"line_number":6485,"context_line":"\tLOG_DEBUG(\"%d\", argc);"},{"line_number":6486,"context_line":"\t/* argv[1] \u003d target to associate in smp"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"b6eba25d_6f271f30","line":6483,"updated":"2022-11-25 22:31:43.000000000","message":"directly\nreturn JIM_OK;\nRemove the declaration and initialization of retval on top and ...","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"3531955b6b9bb43d7082c363e825e27c43023aaa","unresolved":false,"context_lines":[{"line_number":6480,"context_line":""},{"line_number":6481,"context_line":"\tif (argc \u003d\u003d 1) {"},{"line_number":6482,"context_line":"\t\tLOG_DEBUG(\"Empty SMP target\");"},{"line_number":6483,"context_line":"\t\treturn retval;"},{"line_number":6484,"context_line":"\t}"},{"line_number":6485,"context_line":"\tLOG_DEBUG(\"%d\", argc);"},{"line_number":6486,"context_line":"\t/* argv[1] \u003d target to associate in smp"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"3e2f856c_cba3540d","line":6483,"in_reply_to":"b6eba25d_6f271f30","updated":"2022-11-28 09:08:25.000000000","message":"Done","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"925c5049c84fe9e841773a691c48a880ce953c83","unresolved":true,"context_lines":[{"line_number":6510,"context_line":"\tsmp_group++;"},{"line_number":6511,"context_line":""},{"line_number":6512,"context_line":"\tstruct target *rtos_target;"},{"line_number":6513,"context_line":"\tretval \u003d get_target_with_common_rtos_type(lh, \u0026rtos_target);"},{"line_number":6514,"context_line":"\tif (retval \u003d\u003d JIM_OK \u0026\u0026 rtos_target)"},{"line_number":6515,"context_line":"\t\tretval \u003d rtos_smp_init(rtos_target);"},{"line_number":6516,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":7,"id":"c122028a_15edd6ff","line":6513,"updated":"2022-11-25 22:31:43.000000000","message":"... here directly\nint retval \u003d get_...","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"3531955b6b9bb43d7082c363e825e27c43023aaa","unresolved":false,"context_lines":[{"line_number":6510,"context_line":"\tsmp_group++;"},{"line_number":6511,"context_line":""},{"line_number":6512,"context_line":"\tstruct target *rtos_target;"},{"line_number":6513,"context_line":"\tretval \u003d get_target_with_common_rtos_type(lh, \u0026rtos_target);"},{"line_number":6514,"context_line":"\tif (retval \u003d\u003d JIM_OK \u0026\u0026 rtos_target)"},{"line_number":6515,"context_line":"\t\tretval \u003d rtos_smp_init(rtos_target);"},{"line_number":6516,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":7,"id":"3fa73902_26162afd","line":6513,"in_reply_to":"c122028a_15edd6ff","updated":"2022-11-28 09:08:25.000000000","message":"Done","commit_id":"fcad2bfa0a7dd2a0c3aa28257b2cace69a08b30f"}]}
