)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"9b6925e1c5f4e86a3a461031d1b4dce9e0a4bd3d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"c55e77e5_dfad8d28","updated":"2024-09-16 12:43:01.000000000","message":"Antonio, I believe there is a misunderstanding. Please, take a look once again.","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"3a882a43d479471415c1240aabd3c445712bcb13","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"06f3ec1f_db401a48","updated":"2025-08-26 11:17:12.000000000","message":"Antonio, could you please revisit this? AFAIU there was a misunderstanding -- I\u0027m not moving the removal to `target init`, I\u0027m moving it to the default `gdb-attach` handler.","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"9453fa00b575b4f8509e5a6127fef0cddf4a185e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"f29d3f81_90bb325c","updated":"2025-08-30 14:04:50.000000000","message":"Evgeniy, please make the minor doc update and rebase the patch to the current master to ensure it still compiles cleanly.\n\nI sent a direct mail asking Antonio to respond here. If he will not I\u0027m ready to approve and merge the patch.","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a3136d6e0f536ced33fa9e226bae977f85d275c8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"0eca513f_03b90f93","updated":"2024-09-14 12:47:36.000000000","message":"I have not analyzed all the possible targets but, at least on Cortex-M OpenOCD erases all HW breakpoints at start.\nOf course, no way to know if there were any SW BP added by a previous run of OpenOCD and never removed; knowledge of these BP got lost in the memory of the previous OpenOCD.\n\nThe code of `target init` is for OpenOCD start.\nThe code in `gdb_new_connection()` for a new GDB connection.\n\nImagine that you are running a debug session, GDB has set some BP and then GDB detaches or crashes without clearing the BP. You restart GDB, but the new GDB has no idea about the BP already set before.\n\nMoving the code to `target init` has no sense as it is useless there:\n- the OpenOCD start code should already remove HW BP and cannot remove SW BP;\n- this code is not called between two GDB connections.\n\nThis let me add -1.\n\nRegarding the issue you report, I fully agree, the current code is not correct as it expects to remove SW and HW BP before the target is halted.\nIt could be moved few lines below \u0027after\u0027\n`target_call_event_callbacks(target, TARGET_EVENT_GDB_ATTACH);`\nthat in current \u0027GDB stop mode\u0027 is in charge of halting the target.\n\nBut also in this case it\u0027s possible that the core is not halted (`halt` error or event handler reworked). So it\u0027s should be up to the target\u0027s code to detect it\u0027s unable to remove the BP on a target not halted and return error that in this case should be ignored.","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"796ed482e7e47227ab5b964a64a4773a16391198","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"9909f66c_f48916fc","updated":"2024-12-20 13:51:34.000000000","message":"IMO both this patch and Antonio\u0027s proposed move of `breakpoint_clear_target()` and `watchpoint_clear_target()` after `target_call_event_callbacks(target, TARGET_EVENT_GDB_ATTACH)` should solve the problem of removing bp/wp from running target.\n\nI would prefer this patch because if an user for whatever reason wants to keep bp/wp on gdb attach he can simply reconfigure the event (and take the responsibility of manual removing dangling bp/wp after gdb crash).\n\nIt\u0027s little bit off topic, but can anybody explain why we have `breakpoint_clear_target()` and `breakpoint_remove_all()` ? The two different code paths seem to do exactly the same. Similarly `watchpoint_clear_target()` and `watchpoint_remove_all()` Looks like Marc didn\u0027t noticed it in 4915: target: Add function to remove all breakpoints | https://review.openocd.org/c/openocd/+/4915 and Antonio and me approved it. Or am I wrong?","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"change_message_id":"752e12aa18f9ef01c26c765c5caa3d0c530f6a42","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"946e3408_0f12947f","updated":"2024-09-16 15:29:52.000000000","message":"It looks like the above motivates an introduction of another customization point:\n\n- `gdb-attach-init` - the task of this function is to cleanup target state (for example, here we can remove all the stale breakpoints or boot up the system).\n\n- `gdb-attach` - here you do all the custom functionality you need.\n\n\nHaving two customization points will preserve backwards compatibility and may address more usage scenarios.\n\nAntonio, do you have any objections?","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"6e570bce85c8e866045b7cc7fe08248bdc98e67f","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"e58d72d9_0df203d4","updated":"2025-09-23 15:54:10.000000000","message":"No progress here, let\u0027s merge conflicting\n9086: target/breakpoints: drop duplicate breakpoint/watchpoint \"clear_target\" functions | https://review.openocd.org/c/openocd/+/9086\nfirst.","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"39ddc2e4235906b2be20959027155a328247887f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"24d50567_4602de52","updated":"2024-12-20 09:18:02.000000000","message":"Ping","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"7baeb59cd9ef539b1f142bf736905acf0648c907","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"0f28c03e_59bfde6b","updated":"2025-08-30 16:18:32.000000000","message":"We also should not forget to adjust ~20 gdb-attach redefines in tcl/board and tcl/target scripts","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"9b6925e1c5f4e86a3a461031d1b4dce9e0a4bd3d","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"043497fc_3e6f231a","in_reply_to":"0eca513f_03b90f93","updated":"2024-09-16 12:43:01.000000000","message":"I\u0027m not sure I understand your argument correctly:\n1. I\u0027m not moving the removal of `BP/WP` to `target init`, I\u0027m moving it to the default handler of `gdb-attach` event.\n2. In regard to the solution you\u0027ve suggested: I think moving the code to the handler of `gdb-attach` is more flexible.\nE.g.:\n* A user wishes to set-up GDB connection as described in `20.5 Using GDB as a non-intrusive memory inspector` of the docs.\n* The memory is readable but is not writable when the target is running (removal of SW BPs will fail).\n\nThe solution you\u0027ve suggested will still generate errors in such case.\n\nRemoving BPs/WPs in `gdb-attach` handler allows for greater flexibility.","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"06fcb8509940af9c34ab8ffa63e0bb2dc2f3cb15","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"9e7d74e3_ed461815","in_reply_to":"0f28c03e_59bfde6b","updated":"2025-08-31 08:40:47.000000000","message":"I like the idea to move more logic into the Tcl / scripting world. The only thing that concerns me is that it breaks  compatibility with custom configs that use the `gdb-attach` event.","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"3f214de42428e3b45b883e9374272779af29647d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"a861b76d_7eabbc27","in_reply_to":"14068593_32766471","updated":"2025-10-02 09:39:14.000000000","message":"Done","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"06fcb8509940af9c34ab8ffa63e0bb2dc2f3cb15","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"5dfccae5_2465cd11","in_reply_to":"4f307d54_234380d2","updated":"2025-08-31 08:40:47.000000000","message":"\u003e Looks like Marc didn\u0027t noticed it in 4915 [...]\n\nUps!","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"3f214de42428e3b45b883e9374272779af29647d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"426e50dd_20c5b1fb","in_reply_to":"5206319e_abb22bc4","updated":"2025-10-02 09:39:14.000000000","message":"Ack","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"3f214de42428e3b45b883e9374272779af29647d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"69c7a960_9bef8acf","in_reply_to":"5dfccae5_2465cd11","updated":"2025-10-02 09:39:14.000000000","message":"Done","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"06fcb8509940af9c34ab8ffa63e0bb2dc2f3cb15","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"cba95643_84621b6f","in_reply_to":"946e3408_0f12947f","updated":"2025-08-31 08:40:47.000000000","message":"\u003e Having two customization points will preserve backwards compatibility and may address more usage scenarios.\n\nI think this should be better solved more general (not in this patch). For example to give the possibility to prepend/append a new handler to existing event handlers or replace it (as in the current implementation).","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"3a882a43d479471415c1240aabd3c445712bcb13","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"c8e40dc0_74bdcddc","in_reply_to":"9909f66c_f48916fc","updated":"2025-08-26 11:17:12.000000000","message":"\u003e It\u0027s little bit off topic\n\nTomas, AFAIU 9086 addresses this [1].\n\n1: https://review.openocd.org/c/openocd/+/9086","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"fe7901d17bc1fb7125f962c8af0b3d3238f5044e","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"14068593_32766471","in_reply_to":"9e7d74e3_ed461815","updated":"2025-10-01 13:06:00.000000000","message":"\u003e We also should not forget to adjust ~20 gdb-attach redefines in tcl/board and tcl/target scripts\n\nDone in https://review.openocd.org/c/openocd/+/9158","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1001803,"name":"Samuel Obuch","email":"samuel.obuch@espressif.com","username":"sobuch"},"change_message_id":"f96c7ce2e471c4cbdd3755682b9f3cf98a50e61d","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"4f307d54_234380d2","in_reply_to":"c8e40dc0_74bdcddc","updated":"2025-08-27 08:12:39.000000000","message":"`watchpoint_clear_target` is actually not the same as `watchpoint_remove_all` now, which was causing issues in our tests. But I dont think thats intentional.\n\nI would also prefer this version because of the added flexibility. Although for people already overriding the default handler this could cause issues with break/watch points, unless they notice this change and update their handlers.","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"8418e02c8d54d74463cf0ed754838c87c03841aa","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"5206319e_abb22bc4","in_reply_to":"cba95643_84621b6f","updated":"2025-08-31 09:04:50.000000000","message":"\u003e \u003e Having two customization points will preserve backwards compatibility and may address more usage scenarios.\n\u003e \n\u003e I think this should be better solved more general (not in this patch). For example to give the possibility to prepend/append a new handler to existing event handlers or replace it (as in the current implementation).\n\nThis is interesting idea! On the other hand I would fear of the complexity of the resulting handler.\nNevertheless the simplest and somewhat limited way to allow both prepending/appending is to define the default handler as a Tcl proc and use it in the redefined handler.","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"3f214de42428e3b45b883e9374272779af29647d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d4ed2cbe_1eea4e12","in_reply_to":"e58d72d9_0df203d4","updated":"2025-10-02 09:39:14.000000000","message":"Done","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"738bab4425552c9299ce82a0f853c00b8f4851f2","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":4,"id":"bd999419_6c8b440b","updated":"2025-10-19 14:06:12.000000000","message":"My initial comment was not fully relevant, sorry.\nI also missed returning to this patch, sorry again.\n\nI still find simpler moving the BP/WP removal after the call to gdb-attach.\nIt would prevent modifying all the scripts upstream and will not introduce issue to users that overrides the event in their scripts. This modification could be easily missed by users; I don\u0027t know how to make it more visible.\n\nTomas is already instrumenting the code to verify if BP/WP can be removed at target running (9131 and following), so it should be ok keeping these operations in the code when gdb-attach does not halt the CPU; no memory access failure would be triggered.","commit_id":"7f65575fb6173bfa5576971b28d51580f8a6d929"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"3f214de42428e3b45b883e9374272779af29647d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"94550c97_3f753082","updated":"2025-10-02 09:39:14.000000000","message":"Thanks!","commit_id":"7f65575fb6173bfa5576971b28d51580f8a6d929"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"1eff6901d268774ed0b17d91acfb14ad8cbe3187","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":4,"id":"cd3aa9bc_a748cff7","in_reply_to":"9d041a3f_cffd6d83","updated":"2025-10-23 10:45:48.000000000","message":"Antonio, there is another reason for configurable BP/WP removal: as Evgeniy pointed in 9158 most targets does not handle correctly soft BP removal after core reset. There are boards which issue `reset init` in gdb-attach handler (I suspect it\u0027s wrong usage, but not having the board I cannot be sure)\nOn such board we need to issue\n```\nhalt\nrbp all; rwp all\nreset init\n```","commit_id":"7f65575fb6173bfa5576971b28d51580f8a6d929"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f9de7fa1ee38f41b360e03d8fae744cf81896082","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":4,"id":"9d041a3f_cffd6d83","in_reply_to":"bd999419_6c8b440b","updated":"2025-10-19 15:27:43.000000000","message":"\u003e I still find simpler moving the BP/WP removal after the call to gdb-attach.\n\nYes, it is simpler. But it hardwires the operation which may be totally unwanted in some (advanced) use cases - imagine some BP/WP are prepared in Tcl scripts and should be kept after gdb attach, or one wants to keep the target running at gdb attach. That\u0027s why I strongly prefer to make both halt and BP/WP removal configurable/optional.\n\n\u003e It would prevent modifying all the scripts upstream and will not introduce issue to users that overrides the event in their scripts. This modification could be easily missed by users; I don\u0027t know how to make it more visible.\n\nYes, it can happen. But the consequences will not be catastrophic. Both OpenOCD and gdb will work as usual. Just in the case gdb dies the dangling breakpoints in OpenOCD may make an unwanted surprise. After OpenOCD restart all will work again. So I wouldn\u0027t pay too much care on removing BPs - it\u0027s good mainly for ordinary users, who barely know that some OpenOCD works under their favourite IDE.\n\n\u003e Tomas is already instrumenting the code to verify if BP/WP can be removed at target running (9131 and following), so it should be ok keeping these operations in the code when gdb-attach does not halt the CPU; no memory access failure would be triggered.\n\nMy work you\u0027re referring changes the conditions checks for adding a BP.\nSurprisingly the removal of BP/WP never checked target halted at the general target level (unlike adding BP/WP which does so). So depending on target ability and implementation the removal may emit some errors but should not break the attach itself - no matter if called directly or in Tcl event.","commit_id":"7f65575fb6173bfa5576971b28d51580f8a6d929"}],"doc/openocd.texi":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"9453fa00b575b4f8509e5a6127fef0cddf4a185e","unresolved":true,"context_lines":[{"line_number":5485,"context_line":"starts. GDB expects the target is halted during attachment."},{"line_number":5486,"context_line":"@xref{gdbmeminspect,,GDB as a non-intrusive memory inspector}, how to"},{"line_number":5487,"context_line":"connect GDB to running target."},{"line_number":5488,"context_line":"Default handler also removes all breakpoints and watchpoints."},{"line_number":5489,"context_line":"The event can be also used to set up the target so it is possible to probe flash."},{"line_number":5490,"context_line":"Probing flash is necessary during GDB connect if you want to use"},{"line_number":5491,"context_line":"@pxref{programmingusinggdb,,programming using GDB}."}],"source_content_type":"text/x-texinfo","patch_set":1,"id":"c42cd170_9ee52d3b","line":5488,"updated":"2025-08-30 14:04:50.000000000","message":"Please describe the reason doing so","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"3f214de42428e3b45b883e9374272779af29647d","unresolved":false,"context_lines":[{"line_number":5485,"context_line":"starts. GDB expects the target is halted during attachment."},{"line_number":5486,"context_line":"@xref{gdbmeminspect,,GDB as a non-intrusive memory inspector}, how to"},{"line_number":5487,"context_line":"connect GDB to running target."},{"line_number":5488,"context_line":"Default handler also removes all breakpoints and watchpoints."},{"line_number":5489,"context_line":"The event can be also used to set up the target so it is possible to probe flash."},{"line_number":5490,"context_line":"Probing flash is necessary during GDB connect if you want to use"},{"line_number":5491,"context_line":"@pxref{programmingusinggdb,,programming using GDB}."}],"source_content_type":"text/x-texinfo","patch_set":1,"id":"a0c91eee_7a008e5c","line":5488,"in_reply_to":"0722e8b5_bf468da5","updated":"2025-10-02 09:39:14.000000000","message":"Done","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"fe7901d17bc1fb7125f962c8af0b3d3238f5044e","unresolved":true,"context_lines":[{"line_number":5485,"context_line":"starts. GDB expects the target is halted during attachment."},{"line_number":5486,"context_line":"@xref{gdbmeminspect,,GDB as a non-intrusive memory inspector}, how to"},{"line_number":5487,"context_line":"connect GDB to running target."},{"line_number":5488,"context_line":"Default handler also removes all breakpoints and watchpoints."},{"line_number":5489,"context_line":"The event can be also used to set up the target so it is possible to probe flash."},{"line_number":5490,"context_line":"Probing flash is necessary during GDB connect if you want to use"},{"line_number":5491,"context_line":"@pxref{programmingusinggdb,,programming using GDB}."}],"source_content_type":"text/x-texinfo","patch_set":1,"id":"0722e8b5_bf468da5","line":5488,"in_reply_to":"c42cd170_9ee52d3b","updated":"2025-10-01 13:06:00.000000000","message":"Done","commit_id":"1fc7e21c61d774e58bf8766c9a54375b9f1a673c"}],"src/target/startup.tcl":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"59e2a5822ae1195766331e8b0a516762ff4c55f3","unresolved":true,"context_lines":[{"line_number":213,"context_line":"\t\tset_default_target_event $t gdb-flash-write-end \"reset halt\""},{"line_number":214,"context_line":"\t\tset_default_target_event $t gdb-attach {"},{"line_number":215,"context_line":"\t\t\thalt 1000"},{"line_number":216,"context_line":"\t\t\ttry {rbp all} finally {rwp all}"},{"line_number":217,"context_line":"\t\t}"},{"line_number":218,"context_line":"\t}"},{"line_number":219,"context_line":"}"}],"source_content_type":"text/x-tcl","patch_set":3,"id":"29f71141_10a20b56","line":216,"range":{"start_line":216,"start_character":3,"end_line":216,"end_character":34},"updated":"2025-10-01 09:31:25.000000000","message":"Sorry I didn\u0027t noticed before.\n`try finally` block ensures both `rbp` and `rwp` commands run however it does not prevent returning the error code from any of them. I think that message\n```\n[xxx.cpu] Execution of event gdb-attach failed:\n```\nfollowed by text error code from `rbp` or `rwp` is not appropriate in this case. I would prefer to simply use\n```\ncatch { rbp all }\ncatch { rwp all }\n```\n\nAlso while you work on this, please define `proc _default_gdb_attach`\nand use it for the handler. It would make justifications of configs redefining `gdb-attach` event easier and cleaner.","commit_id":"9f9c4fd4cf236837433bb80de9f75b635aaed544"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"fe7901d17bc1fb7125f962c8af0b3d3238f5044e","unresolved":true,"context_lines":[{"line_number":213,"context_line":"\t\tset_default_target_event $t gdb-flash-write-end \"reset halt\""},{"line_number":214,"context_line":"\t\tset_default_target_event $t gdb-attach {"},{"line_number":215,"context_line":"\t\t\thalt 1000"},{"line_number":216,"context_line":"\t\t\ttry {rbp all} finally {rwp all}"},{"line_number":217,"context_line":"\t\t}"},{"line_number":218,"context_line":"\t}"},{"line_number":219,"context_line":"}"}],"source_content_type":"text/x-tcl","patch_set":3,"id":"8af36d3a_62012619","line":216,"range":{"start_line":216,"start_character":3,"end_line":216,"end_character":34},"in_reply_to":"29f71141_10a20b56","updated":"2025-10-01 13:06:00.000000000","message":"\u003e try finally block ensures both rbp and rwp commands run however it does not prevent returning the error code from any of them\n\nThanks for the catch! Addressed.\n\nI\u0027d like to avoid ` _default_gdb_attach`. Please, take a look at `prepend_default_handler` in https://review.openocd.org/c/openocd/+/9158.","commit_id":"9f9c4fd4cf236837433bb80de9f75b635aaed544"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"3f214de42428e3b45b883e9374272779af29647d","unresolved":false,"context_lines":[{"line_number":213,"context_line":"\t\tset_default_target_event $t gdb-flash-write-end \"reset halt\""},{"line_number":214,"context_line":"\t\tset_default_target_event $t gdb-attach {"},{"line_number":215,"context_line":"\t\t\thalt 1000"},{"line_number":216,"context_line":"\t\t\ttry {rbp all} finally {rwp all}"},{"line_number":217,"context_line":"\t\t}"},{"line_number":218,"context_line":"\t}"},{"line_number":219,"context_line":"}"}],"source_content_type":"text/x-tcl","patch_set":3,"id":"4232e5d7_3791be9c","line":216,"range":{"start_line":216,"start_character":3,"end_line":216,"end_character":34},"in_reply_to":"8af36d3a_62012619","updated":"2025-10-02 09:39:14.000000000","message":"Done","commit_id":"9f9c4fd4cf236837433bb80de9f75b635aaed544"}]}
