)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b1bb98d86c23b631760141965ca5dc93d357359e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"42a8ac42_ab4c78cc","updated":"2025-03-09 17:00:07.000000000","message":"Thanks for this series.\nFew points on this patch:\n\n1) when a CPU armv{7,8,9}{a,r} gets halted, it\u0027s status is dirty because R0 and R1 must be used by the debugger. There is need to add a new flag `context_dirty` because the CPU status halted is enough.\n\n2) there is no need to handle the event `TARGET_EVENT_GDB_DETACH`. When gdb disconnects, OpenOCD is able to continue and keeps track of dirty registers. If gdb re-connects, everything is working as before. Only at OpenOCD exit the dirty registers must be synchronized with the target\n\n3) in OpenOCD we refuse to restart an halted target when gdb disconnects. This because gdb could crash or disconnect for networking issues, and forcing a `continue/resume` would mean loosing the precious debug status after a long session of step-by-step debug. If a user wants the \u0027magic\u0027 feature of continue at gdb disconnect, he can add in TCL script or on command line the event\n`$TARGET_NAME configure -event gdb-detach { resume }`\n\nSaid that, I agree we need to update the dirty config at OpenOCD exit, otherwise restarting OpenOCD will read the previous dirty values and use them as new correct values.","commit_id":"1c08b5d9ccd8a56737133574b9e4f5ef26340fe9"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d3a4945536f59c263f9119743647a75e57b003d1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"49c197f1_b8f500af","updated":"2025-03-16 09:28:10.000000000","message":"Thanks. just a minor improvement below","commit_id":"6bc47fceb4f34c59e11cd20b7a55574b447a8f94"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a496da71cea2e9cb717617d6f0d0f8fbb1558297","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"1bf2173d_f09353b0","updated":"2025-03-22 09:09:35.000000000","message":"Thanks!","commit_id":"739dcaa207575767441f3fdec4ca97e876d8c673"}],"src/target/aarch64.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d3a4945536f59c263f9119743647a75e57b003d1","unresolved":true,"context_lines":[{"line_number":2864,"context_line":""},{"line_number":2865,"context_line":"\tif (target-\u003estate \u003d\u003d TARGET_HALTED)"},{"line_number":2866,"context_line":"\t\t// Restore the previous state of the target (gp registers, MMU, caches, etc)"},{"line_number":2867,"context_line":"\t\taarch64_restore_one(target, true, \u0026address, false, false);"},{"line_number":2868,"context_line":""},{"line_number":2869,"context_line":"\tif (armv8-\u003edebug_ap)"},{"line_number":2870,"context_line":"\t\tdap_put_ap(armv8-\u003edebug_ap);"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"80fd9cdf_d61bab28","line":2867,"updated":"2025-03-16 09:28:10.000000000","message":"This function can return error.\nOpenOCD is going to quit, so there is no extra action we can run.\nBut we should alert the user that we have failed to restore the previous state of the CPU.\n```\nint retval \u003d aarch64_restore_one(...);\nif (retval !\u003d ERROR_OK)\n\tLOG_TARGET_ERROR(target, \"Failed to restore target state\");\n```","commit_id":"6bc47fceb4f34c59e11cd20b7a55574b447a8f94"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a496da71cea2e9cb717617d6f0d0f8fbb1558297","unresolved":false,"context_lines":[{"line_number":2864,"context_line":""},{"line_number":2865,"context_line":"\tif (target-\u003estate \u003d\u003d TARGET_HALTED)"},{"line_number":2866,"context_line":"\t\t// Restore the previous state of the target (gp registers, MMU, caches, etc)"},{"line_number":2867,"context_line":"\t\taarch64_restore_one(target, true, \u0026address, false, false);"},{"line_number":2868,"context_line":""},{"line_number":2869,"context_line":"\tif (armv8-\u003edebug_ap)"},{"line_number":2870,"context_line":"\t\tdap_put_ap(armv8-\u003edebug_ap);"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"2c17bb4c_b9cc0651","line":2867,"in_reply_to":"80fd9cdf_d61bab28","updated":"2025-03-22 09:09:35.000000000","message":"Done","commit_id":"6bc47fceb4f34c59e11cd20b7a55574b447a8f94"}]}
