)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1002371,"name":"Farid Khaidari","email":"f.khaydari@syntacore.com","username":"fk-sc"},"change_message_id":"df777d207779c125b18a33364daeb7b8438563fe","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"2fb1b1bd_8a5406c5","updated":"2025-03-06 12:39:56.000000000","message":"Ping","commit_id":"7ebca0ee6266fae78691871ea1246e4989fc32a9"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"9685cb36445059246d1988cd727330f86ecdc443","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"9b8642df_1620a14f","updated":"2025-02-05 20:13:47.000000000","message":"Thanks for the patch Farid. There is similar code for breakpoints which uses a `#define` in target.h. Either we make the existing one more general or add an additional one for watchpoints.\n\nAntonio, Tomas?","commit_id":"7ebca0ee6266fae78691871ea1246e4989fc32a9"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"6c5cca186a906d31fbdf1da16266b807efc6016f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"b3ba644c_df3b0206","in_reply_to":"9b8642df_1620a14f","updated":"2025-03-09 23:02:49.000000000","message":"Do you mean `ERROR_TARGET_DUPLICATE_BREAKPOINT` ?\nAdding a new one for WP is not an issue but, when possible, let\u0027s try keeping BP and WP code as similar as we can.\nError codes for should be in the same file (either in target.h or breakpoints.h) and with similar names","commit_id":"7ebca0ee6266fae78691871ea1246e4989fc32a9"},{"author":{"_account_id":1002371,"name":"Farid Khaidari","email":"f.khaydari@syntacore.com","username":"fk-sc"},"change_message_id":"7a1c39d6f505ad226a3d3b7c2fed8f260bc3969f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"ca74b944_4b0f4bb7","in_reply_to":"b3ba644c_df3b0206","updated":"2025-03-10 13:31:42.000000000","message":"Addressed","commit_id":"7ebca0ee6266fae78691871ea1246e4989fc32a9"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"2357e3005b864740242c9a1536863c7ac1967b73","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"77a2a627_e7a614c9","updated":"2025-03-30 12:23:46.000000000","message":"Is it possible to have multiple (different) watchpoints at the same address? If not please use the same behaviour and `#define` name as for breakpoints.\n\n@Antonio do you know if that\u0027s possible?","commit_id":"11c5f2af0ceb7e81e14d183168384bfe4791d9dd"},{"author":{"_account_id":1002371,"name":"Farid Khaidari","email":"f.khaydari@syntacore.com","username":"fk-sc"},"change_message_id":"3dfee0616114641f402e80fd8ddecf3995bd8f4e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"2ec237c2_5fb9c4d6","updated":"2025-03-26 16:05:20.000000000","message":"Ping","commit_id":"11c5f2af0ceb7e81e14d183168384bfe4791d9dd"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"17631c9430ac4daf82ddf045f19dbff4caeda2f5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"65f10209_01803176","in_reply_to":"54b6200b_e92992ef","updated":"2025-04-07 08:02:44.000000000","message":"Yes, I\u0027m aware of the `FIXME` comments for breakpoints.\n\nThe main question for me is: is it necessary to distinguish between exactly the same bp/wp and those that are only at the same address. I don\u0027t know if there is hardware that supports bp/wp at the same address with different parameters.\n\n@Antonio: what is your opinion here?","commit_id":"11c5f2af0ceb7e81e14d183168384bfe4791d9dd"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"4756fb13213299cbbc3909d2b0059a5b41d37969","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":5,"id":"818ab64d_55b7ca4e","in_reply_to":"65f10209_01803176","updated":"2025-04-24 15:39:27.000000000","message":"@Marc\n\n\u003e I don\u0027t know if there is hardware that supports bp/wp at the same address\n\u003e with different parameters.\n\nSure there is. AFAIK the hw bkpt / watchpoint comparators are independent so there is no problem with setting more bp / wp with different parameters on the same address.\nSo from the target hw point of view the only soft (instruction) breakpoint inserted to code RAM should avoid the addresses in use.\n\n@Farid\nThis is the reason why I would prefer `ERROR_TARGET_DUPLICATE_WATCHPOINT` over\n`_ADDRESS_IN_USE` - it is kind of misleading in the context of independent wp comparators.\nPerhaps the error could be merged with breakpoint specific one as `ERROR_TARGET_DUPLICATE_BP_WP`.\n\n\u003e The main question for me is: is it necessary to distinguish between exactly\n\u003e the same bp/wp and those that are only at the same address.\n\nI would prefer to simplify wp code according to the bp pattern: I hope we do not need to silently ignore re-creation of the exactly same wp, IMO we can refuse any wp at the same address if we return a meaningful error.","commit_id":"11c5f2af0ceb7e81e14d183168384bfe4791d9dd"},{"author":{"_account_id":1002371,"name":"Farid Khaidari","email":"f.khaydari@syntacore.com","username":"fk-sc"},"change_message_id":"3ea34889383b2ed0df4b8304bce10d7da98cde9f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"54b6200b_e92992ef","in_reply_to":"77a2a627_e7a614c9","updated":"2025-03-31 08:07:41.000000000","message":"OpenOCD silently ignores user attempts to add duplicate watchpoints. Based on the `FIXME` comments near all `ERROR_TARGET_DUPLICATE_BREAKPOINT` usages, it appears this error code is misnamed and needs renaming (e.g., to `ERROR_TARGET_BREAKPOINT_ADDRESS_IN_USE`  for accuracy). I plan to address this naming inconsistency and improve error handling in my next patch","commit_id":"11c5f2af0ceb7e81e14d183168384bfe4791d9dd"},{"author":{"_account_id":1002371,"name":"Farid Khaidari","email":"f.khaydari@syntacore.com","username":"fk-sc"},"change_message_id":"3322ecfcfda3f435935ad9fd346803b17cf54c80","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"09876ba4_30db29b4","updated":"2025-04-24 13:42:31.000000000","message":"@Antonio, could you please take a look?","commit_id":"cde1bec7c3de14e921955ef0dd04d56769ebbb54"},{"author":{"_account_id":1002371,"name":"Farid Khaidari","email":"f.khaydari@syntacore.com","username":"fk-sc"},"change_message_id":"1eb16f1cb920a7b8804584c779ccf151ccb181b2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"f038bb6c_915d0397","in_reply_to":"818ab64d_55b7ca4e","updated":"2026-06-04 15:58:18.000000000","message":"Done in PS8. Rebased onto current master and simplified the watchpoint path as you suggested: any second watchpoint at the same address is now refused with a \"Duplicate Watchpoint\" error instead of being silently ignored. Master meanwhile renamed the breakpoint code to ERROR_BREAKPOINT_DUPLICATED in breakpoints.h, so I followed that convention with a parallel ERROR_WATCHPOINT_DUPLICATED rather than a merged BP/WP code.","commit_id":"535873a2be0e2d2c1dafcad5be57be3377706850"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"36ce1669dc07dcc2c3eaedc9debf92e0e3172210","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":8,"id":"722deb68_79042119","in_reply_to":"d95f47f7_9db3b130","updated":"2026-06-29 13:06:15.000000000","message":"\u003e On Cortex-A it\u0027s possible to define overlapping watchpoints.\n\nDoes the scenario you are describing work with the current OpenOCD, or is it something you wish worked?\n\nBased on the current master branch, if the address is identical, a new watchpoint is not set. Therefore, the workflow you described does not work today, meaning no users need to rework existing scripts.\n\nCurrently, if the address matches but other watchpoint parameters differ, OpenOCD reports an error. If all parameters match exactly, no watchpoint is added and no error is reported. The purpose of this patch is to fix this silent failure.\nAdmittedly, the correct behavior here is debatable. One could argue that the pre-patch behavior (returning `ERROR_OK` when a duplicate watchpoint is requested) is acceptable because the desired watchpoint is already active. However, this contradicts how breakpoints are handled.\n\nFurthermore, allowing multiple watchpoints on the same address would require updating the removal API first. Currently, `watchpoint_remove()` identifies the watchpoint to remove solely by address, which is the same limitation breakpoints have.","commit_id":"535873a2be0e2d2c1dafcad5be57be3377706850"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"73d7fa27a242eb6a391b39605bd01db1707ea23c","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":8,"id":"d95f47f7_9db3b130","in_reply_to":"f038bb6c_915d0397","updated":"2026-06-09 09:48:24.000000000","message":"On Cortex-A it\u0027s possible to define overlapping watchpoints.\nSince the watchpoints have read/write/all flag, it\u0027s possible to ask for both:\n`wp 0x1000 4 r`\nto watch for 4 bytes read, and\n`wp 0x1000 32 w`\nto watch for 32 bytes write, both starting at the same address but doing different stuff.\n\nOf course, this case could be rewritten to avoid the start address conflict as:\n```\nwp 0x1000 4 a\nwp 0x1004 28 w\n```\nbut it\u0027s not so user friendly to ask the user to re-work the watchpoints just because OpenOCD does not support the overlap of the start address.\n\nDuplication should be detected on the full set of parameters, because it\u0027s a user error to type twice the same command (e.g. script run twice), but I would not limit the partial overlap.","commit_id":"535873a2be0e2d2c1dafcad5be57be3377706850"}],"src/target/target.c":[{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"2357e3005b864740242c9a1536863c7ac1967b73","unresolved":true,"context_lines":[{"line_number":4126,"context_line":"\tint retval \u003d watchpoint_add(target, addr, length, type,"},{"line_number":4127,"context_line":"\t\t\tdata_value, data_mask);"},{"line_number":4128,"context_line":""},{"line_number":4129,"context_line":"\tif (retval \u003d\u003d ERROR_TARGET_WATCHPOINT_ADDRESS_IN_USE)"},{"line_number":4130,"context_line":"\t\tcommand_print(CMD, \"Address \" TARGET_ADDR_FMT"},{"line_number":4131,"context_line":"\t\t\t\t\" already has watchpoint\", addr);"},{"line_number":4132,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"ef5172ab_1ee1d090","line":4129,"updated":"2025-03-30 12:23:46.000000000","message":"Please add a return statement here such that we do have only a single response.","commit_id":"11c5f2af0ceb7e81e14d183168384bfe4791d9dd"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"17631c9430ac4daf82ddf045f19dbff4caeda2f5","unresolved":false,"context_lines":[{"line_number":4126,"context_line":"\tint retval \u003d watchpoint_add(target, addr, length, type,"},{"line_number":4127,"context_line":"\t\t\tdata_value, data_mask);"},{"line_number":4128,"context_line":""},{"line_number":4129,"context_line":"\tif (retval \u003d\u003d ERROR_TARGET_WATCHPOINT_ADDRESS_IN_USE)"},{"line_number":4130,"context_line":"\t\tcommand_print(CMD, \"Address \" TARGET_ADDR_FMT"},{"line_number":4131,"context_line":"\t\t\t\t\" already has watchpoint\", addr);"},{"line_number":4132,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"f4c1ee9a_008787cb","line":4129,"in_reply_to":"c38a8754_751eb6af","updated":"2025-04-07 08:02:44.000000000","message":"Ack","commit_id":"11c5f2af0ceb7e81e14d183168384bfe4791d9dd"},{"author":{"_account_id":1002371,"name":"Farid Khaidari","email":"f.khaydari@syntacore.com","username":"fk-sc"},"change_message_id":"1d35afef7f24beced9ec03b2e1467d10063bc771","unresolved":true,"context_lines":[{"line_number":4126,"context_line":"\tint retval \u003d watchpoint_add(target, addr, length, type,"},{"line_number":4127,"context_line":"\t\t\tdata_value, data_mask);"},{"line_number":4128,"context_line":""},{"line_number":4129,"context_line":"\tif (retval \u003d\u003d ERROR_TARGET_WATCHPOINT_ADDRESS_IN_USE)"},{"line_number":4130,"context_line":"\t\tcommand_print(CMD, \"Address \" TARGET_ADDR_FMT"},{"line_number":4131,"context_line":"\t\t\t\t\" already has watchpoint\", addr);"},{"line_number":4132,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"c38a8754_751eb6af","line":4129,"in_reply_to":"ef5172ab_1ee1d090","updated":"2025-03-31 08:31:16.000000000","message":"Addressed in slightly another way","commit_id":"11c5f2af0ceb7e81e14d183168384bfe4791d9dd"},{"author":{"_account_id":1002371,"name":"Farid Khaidari","email":"f.khaydari@syntacore.com","username":"fk-sc"},"change_message_id":"1eb16f1cb920a7b8804584c779ccf151ccb181b2","unresolved":false,"context_lines":[{"line_number":4126,"context_line":"\tCOMMAND_PARSE_ADDRESS(CMD_ARGV[0], va);"},{"line_number":4127,"context_line":"\ttarget_addr_t pa;"},{"line_number":4128,"context_line":""},{"line_number":4129,"context_line":"\tstruct target *target \u003d get_current_target(CMD_CTX);"},{"line_number":4130,"context_line":"\tint retval \u003d target-\u003etype-\u003evirt2phys(target, va, \u0026pa);"},{"line_number":4131,"context_line":"\tif (retval \u003d\u003d ERROR_OK)"},{"line_number":4132,"context_line":"\t\tcommand_print(CMD, \"Physical address \" TARGET_ADDR_FMT \"\", pa);"}],"source_content_type":"text/x-csrc","patch_set":8,"id":"d43dcaa0_e929c495","line":4129,"in_reply_to":"ef5172ab_1ee1d090","updated":"2026-06-04 15:58:18.000000000","message":"Done in PS8: the wp handler now mirrors handle_bp_command — the error is logged once inside watchpoint_add() and the handler no longer prints a second generic message, so there is a single response.","commit_id":"535873a2be0e2d2c1dafcad5be57be3377706850"}]}
