)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"634b850fbf20e4797daf8a710412f4baaee28d89","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"29d8635c_29bbe3b5","updated":"2026-06-11 13:08:14.000000000","message":"Steps to reproduce:\n\n1) Have a debug-able RISC-V target at your disposal\n\nIn absence of a physical RISC-V dev board, the RISC-V Spike simulator can be used by following these instructions:\n\ni. Build Spike from source (https://github.com/riscv-software-src/riscv-isa-sim)\nii. Obtain bare-metal RISC-V toolchain (riscv64-unknown-elf-gcc)\niii. Build a simple bare-metal program to execute in Spike (e.g. `rot13` from https://github.com/riscv-software-src/riscv-isa-sim#debugging-with-gdb)\niv. Prepare a config file for OpenOCD (you can take `spike.cfg` from https://github.com/riscv-software-src/riscv-isa-sim#debugging-with-gdb)\nv. Launch Spike: `spike --rbb-port\u003d9824 -m0x10000:0x20000 rot13`\n\n2) Connect OpenOCD to your RISC-V target\n\nIn case of Spike based flow above, you can use: `path/to/openocd -f spike.cfg`\n\n3) Connect to telnet console of OpenOCD and type these commands\n\n```\nhalt\nreg a0 0x12345 ; reg a0 force\n\n# Before this patch: The written (cached) value 0x12345 is silently dropped (forgotten, lost) and a0 is re-read from the target. The user is not notified about it anyhow.\n\n# After this patch: The attempt to force-read dirty a0 causes an error printed the users, notifying users that there is a limitation in the current OpenOCD version that prevents successful force-reading of dirty registers.\n\n```","commit_id":"fa6e2726403166918432cf1413244d89fd1c2cf2"}],"src/target/target.c":[{"author":{"_account_id":1002135,"name":"Mark Zhuang","email":"mark.zhuang@spacemit.com","username":"zqb-all"},"change_message_id":"d7e5791a54d78809fcf6a17d52ffc1a3a08a9d89","unresolved":true,"context_lines":[{"line_number":4798,"context_line":"\t\t/* TODO: This is a temporary hotfix for cache issues when"},{"line_number":4799,"context_line":"\t\t * force-reading a dirty register. For detailed discussion, see:"},{"line_number":4800,"context_line":"\t\t * https://review.openocd.org/c/openocd/+/8070 */"},{"line_number":4801,"context_line":"\t\tif (force \u0026\u0026 reg-\u003evalid \u0026\u0026 reg-\u003edirty) {"},{"line_number":4802,"context_line":"\t\t\t/* We currently don\u0027t have any API to flush (write back) the register\u0027s"},{"line_number":4803,"context_line":"\t\t\t * dirty (unwritten) cached value before the force-read."},{"line_number":4804,"context_line":"\t\t\t * The force-read would destroy the unwritten value."}],"source_content_type":"text/x-csrc","patch_set":2,"id":"100589f5_da92579f","line":4801,"updated":"2026-06-14 14:11:51.000000000","message":"Looks good! Just a minor nit: this block should be moved after the `if (!reg || !reg-\u003eexist)` check below to avoid a potential NULL dereference.","commit_id":"fa6e2726403166918432cf1413244d89fd1c2cf2"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"5d6a70dc00cabbd5cb5efcab0d006c878e3aa1eb","unresolved":false,"context_lines":[{"line_number":4798,"context_line":"\t\t/* TODO: This is a temporary hotfix for cache issues when"},{"line_number":4799,"context_line":"\t\t * force-reading a dirty register. For detailed discussion, see:"},{"line_number":4800,"context_line":"\t\t * https://review.openocd.org/c/openocd/+/8070 */"},{"line_number":4801,"context_line":"\t\tif (force \u0026\u0026 reg-\u003evalid \u0026\u0026 reg-\u003edirty) {"},{"line_number":4802,"context_line":"\t\t\t/* We currently don\u0027t have any API to flush (write back) the register\u0027s"},{"line_number":4803,"context_line":"\t\t\t * dirty (unwritten) cached value before the force-read."},{"line_number":4804,"context_line":"\t\t\t * The force-read would destroy the unwritten value."}],"source_content_type":"text/x-csrc","patch_set":2,"id":"564422dc_9c54aca4","line":4801,"in_reply_to":"100589f5_da92579f","updated":"2026-06-15 05:43:36.000000000","message":"You\u0027re right. Fixed. Thanks for the catch!","commit_id":"fa6e2726403166918432cf1413244d89fd1c2cf2"}]}
