)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"48647b7e41035b5129df37abbda9953cfae4a9bf","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"052b9eb5_8cee74dd","updated":"2023-10-18 19:28:53.000000000","message":"That looks right to me.","commit_id":"57f785e0d1d7c51fd020ef79f88694238b0f963c"},{"author":{"_account_id":1002152,"name":"Kirill Radkin","email":"kirill.radkin@syntacore.com","username":"kr-sc"},"change_message_id":"d76f0a480036cb048c0e67cd785799f9bfb83c58","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"54d791d6_250d1bf7","updated":"2023-10-18 16:16:13.000000000","message":"Unfortunately, found another issue in patch https://review.openocd.org/c/openocd/+/7738.","commit_id":"57f785e0d1d7c51fd020ef79f88694238b0f963c"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"c057a3757c1f057566dc8a1af069a0e9c1f7eb11","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"ea508df2_ccb18f46","updated":"2023-10-24 05:08:19.000000000","message":"Looks good, thank you.","commit_id":"4d4c71a47779adf113e6f6cae5e2543986850a8e"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"e6ec98003bcdd20172af62cabf6acac8d4a1014a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"bdd55d2e_adb834d5","updated":"2023-11-13 16:57:05.000000000","message":"Approved again? I don\u0027t understand why it says there\u0027s something for me to do here.","commit_id":"3ff1f2acd176da4bd68632a1862caee1636843e5"}],"src/target/breakpoints.c":[{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"ec3301fc6de08ef3388e6d05b98b7133ea827e24","unresolved":true,"context_lines":[{"line_number":474,"context_line":"\twhile (target-\u003ebreakpoints) {"},{"line_number":475,"context_line":"\t\tint status \u003d breakpoint_free(target, target-\u003ebreakpoints);"},{"line_number":476,"context_line":"\t\tif (status !\u003d ERROR_OK)"},{"line_number":477,"context_line":"\t\t\treturn retval;"},{"line_number":478,"context_line":"\t}"},{"line_number":479,"context_line":""},{"line_number":480,"context_line":"\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"5df487a2_f4582b54","line":477,"updated":"2023-10-19 05:41:34.000000000","message":"Thank you for spotting this bug.\n\nA drawback of your proposed solution is that the breakpoint removal ends on the first breakpoint that fails to get removed.\n\nI recommend to continue removing everything -- even if a failure is encountered. Something along these lines:\n\n```\nstruct breakpoint *bp;\nstruct breakpoint *next_bp \u003d target-\u003ebreakpoints;\n\nunsigned total_bp_count \u003d 0;\nunsigned not_removed_bp_count \u003d 0;\n\nwhile (next_bp) {\n    bp \u003d next_bp;\n    next_bp \u003d bp-\u003enext;\n    \n    total_bp_count++;\n    \n    int status \u003d breakpoint_free(target, bp);\n    if (status !\u003d ERROR_OK)\n        not_removed_bp_count++;\n}\n\nif (not_removed_bps \u003e 0) {\n    LOG_TARGET_ERROR(target, \"Could not remove %u of %u breakpoints on this target\", not_removed_bp_count, total_bp_count);\n    return ERROR_FAIL;\n}\n\nreturn ERROR_OK;\n```","commit_id":"57f785e0d1d7c51fd020ef79f88694238b0f963c"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"c057a3757c1f057566dc8a1af069a0e9c1f7eb11","unresolved":false,"context_lines":[{"line_number":474,"context_line":"\twhile (target-\u003ebreakpoints) {"},{"line_number":475,"context_line":"\t\tint status \u003d breakpoint_free(target, target-\u003ebreakpoints);"},{"line_number":476,"context_line":"\t\tif (status !\u003d ERROR_OK)"},{"line_number":477,"context_line":"\t\t\treturn retval;"},{"line_number":478,"context_line":"\t}"},{"line_number":479,"context_line":""},{"line_number":480,"context_line":"\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"253718cc_7bf437ac","line":477,"in_reply_to":"5df487a2_f4582b54","updated":"2023-10-24 05:08:19.000000000","message":"Done","commit_id":"57f785e0d1d7c51fd020ef79f88694238b0f963c"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"ec3301fc6de08ef3388e6d05b98b7133ea827e24","unresolved":true,"context_lines":[{"line_number":666,"context_line":"\twhile (target-\u003ewatchpoints) {"},{"line_number":667,"context_line":"\t\tint status \u003d watchpoint_free(target, target-\u003ewatchpoints);"},{"line_number":668,"context_line":"\t\tif (status !\u003d ERROR_OK)"},{"line_number":669,"context_line":"\t\t\treturn status;"},{"line_number":670,"context_line":"\t}"},{"line_number":671,"context_line":""},{"line_number":672,"context_line":"\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"76c43e36_91072cbd","line":669,"updated":"2023-10-19 05:41:34.000000000","message":"The same suggestion applies to watchpoints, too.","commit_id":"57f785e0d1d7c51fd020ef79f88694238b0f963c"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"c057a3757c1f057566dc8a1af069a0e9c1f7eb11","unresolved":false,"context_lines":[{"line_number":666,"context_line":"\twhile (target-\u003ewatchpoints) {"},{"line_number":667,"context_line":"\t\tint status \u003d watchpoint_free(target, target-\u003ewatchpoints);"},{"line_number":668,"context_line":"\t\tif (status !\u003d ERROR_OK)"},{"line_number":669,"context_line":"\t\t\treturn status;"},{"line_number":670,"context_line":"\t}"},{"line_number":671,"context_line":""},{"line_number":672,"context_line":"\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"2b6a69ea_f66eea4d","line":669,"in_reply_to":"76c43e36_91072cbd","updated":"2023-10-24 05:08:19.000000000","message":"Done","commit_id":"57f785e0d1d7c51fd020ef79f88694238b0f963c"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"546148d292bfb5fcf40c9f0774e380e6c2568940","unresolved":true,"context_lines":[{"line_number":326,"context_line":""},{"line_number":327,"context_line":"static int breakpoint_remove_all_internal(struct target *target)"},{"line_number":328,"context_line":"{"},{"line_number":329,"context_line":"\tLOG_DEBUG(\"Delete all breakpoints for target: %s\","},{"line_number":330,"context_line":"\t\ttarget_name(target));"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"\tstruct breakpoint *breakpoint \u003d target-\u003ebreakpoints;"},{"line_number":333,"context_line":"\tint retval \u003d ERROR_OK;"},{"line_number":334,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"2fbe798d_290a7b75","line":331,"range":{"start_line":329,"start_character":0,"end_line":331,"end_character":0},"updated":"2023-10-24 15:13:28.000000000","message":"Use LOG_TARGET_DEBUG() instead, for more consistent message format. E.g.\nLOG_TARGET_DEBUG(target, \"Delete all breakpoints.\");","commit_id":"4d4c71a47779adf113e6f6cae5e2543986850a8e"},{"author":{"_account_id":1002152,"name":"Kirill Radkin","email":"kirill.radkin@syntacore.com","username":"kr-sc"},"change_message_id":"ec3629c81c285eeaca51a87461ae79556a0cd67c","unresolved":true,"context_lines":[{"line_number":326,"context_line":""},{"line_number":327,"context_line":"static int breakpoint_remove_all_internal(struct target *target)"},{"line_number":328,"context_line":"{"},{"line_number":329,"context_line":"\tLOG_DEBUG(\"Delete all breakpoints for target: %s\","},{"line_number":330,"context_line":"\t\ttarget_name(target));"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"\tstruct breakpoint *breakpoint \u003d target-\u003ebreakpoints;"},{"line_number":333,"context_line":"\tint retval \u003d ERROR_OK;"},{"line_number":334,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"5107133d_1e7ca356","line":331,"range":{"start_line":329,"start_character":0,"end_line":331,"end_character":0},"in_reply_to":"2fbe798d_290a7b75","updated":"2023-10-25 14:45:31.000000000","message":"Addressed","commit_id":"4d4c71a47779adf113e6f6cae5e2543986850a8e"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"cbe8ed39deb157a2a5225901ae8e1eb778e398c2","unresolved":false,"context_lines":[{"line_number":326,"context_line":""},{"line_number":327,"context_line":"static int breakpoint_remove_all_internal(struct target *target)"},{"line_number":328,"context_line":"{"},{"line_number":329,"context_line":"\tLOG_DEBUG(\"Delete all breakpoints for target: %s\","},{"line_number":330,"context_line":"\t\ttarget_name(target));"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"\tstruct breakpoint *breakpoint \u003d target-\u003ebreakpoints;"},{"line_number":333,"context_line":"\tint retval \u003d ERROR_OK;"},{"line_number":334,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"26d0fa8b_3d6b5f37","line":331,"range":{"start_line":329,"start_character":0,"end_line":331,"end_character":0},"in_reply_to":"5107133d_1e7ca356","updated":"2023-10-26 07:25:06.000000000","message":"Done","commit_id":"4d4c71a47779adf113e6f6cae5e2543986850a8e"}]}
