)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"9caf33f73109b0b035facf41bce4c6b008abbe34","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"f67d5159_3062095e","updated":"2025-08-03 10:26:50.000000000","message":"I see other patches from you that as side effect drop the command\u0027s output:\nhttps://review.openocd.org/c/openocd/+/9068\nhttps://review.openocd.org/c/openocd/+/8996\n\nAre these pushed for the same reason?\nShould we revisit them?","commit_id":"f8bc1923db73da2894ccb89de5ff23172da900a5"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b359231b5290a7c2a1e5ba7c8b34de85f275c4c9","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"c0554ee7_148570f9","updated":"2025-08-03 10:15:25.000000000","message":"In TCL most \"assignment\" commands return the assigned value:\n```\n$ tclsh\n% set var hello\nhello\n% lappend var 1\nhello 1\n% lappend var x\nhello 1 x\n```\nI don\u0027t find problems if an OpenOCD command returns a value, like the `cortex_m reset config` of this commit.\n\nBut the issue you report in the commit message is instead that OpenOCD prints the last result of every script or command that it runs from its command line, including standard TCL commands:\n```\n$ openocd -f board/st_nucleo_f4.cfg -c \u0027set var hello\u0027\nOpen On-Chip Debugger 0.12.0+dev-01137-g5d2f9e927 (2025-08-02-12:38)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\nsrst_only separate srst_nogate srst_open_drain connect_deassert_srst\nhello\nInfo : Listening on port 6666 for tcl connections\n```\nwhere the dumped reset configuration is from the last command in `board/st_nucleo_f4.cfg`, followed by the output of the next command line option.\n\nOnly the last command\u0027s result is printed, so:\n```\n$ openocd -f board/st_nucleo_f4.cfg -c \u0027set var hello;set var Hell\u0027\nOpen On-Chip Debugger 0.12.0+dev-01137-g5d2f9e927 (2025-08-02-12:38)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\nsrst_only separate srst_nogate srst_open_drain connect_deassert_srst\nHell\nInfo : Listening on port 6666 for tcl connections\n```\nand can be silenced with a last command that has no output:\n```\n$ openocd -f board/st_nucleo_f4.cfg -c \u0027set var hello;unset var\u0027\nOpen On-Chip Debugger 0.12.0+dev-01137-g5d2f9e927 (2025-08-02-12:38)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\nsrst_only separate srst_nogate srst_open_drain connect_deassert_srst\nInfo : Listening on port 6666 for tcl connections\n```\n\nThe command you change in this commit is just the last in your \"usual\" config file. Are you planning to change any \"last\" command in every config file?\n\nI also find annoying this extra print, but I think it should be changed somewhere else, not in each command.\n\nIt is `command_run_line()` that queues the output through `command_output_text()`.\nThen this output is printed with the initial output handler that is `configuration_output_handler()` that probably incorrectly calls `LOG_USER_N()`.\nShould the fix target this part of the code?\nSince `command_run_line()` is everywhere, probably is the initial output handler that should be addressed. To be checked which side effects we have.\n\nSaid that, let me know if you want to proceed with this patch.","commit_id":"f8bc1923db73da2894ccb89de5ff23172da900a5"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"7e7831c2bdad853a7c276ba800b08fddc4034713","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"6b7ad52f_ef1636cf","in_reply_to":"2c1e9849_9b9b3091","updated":"2025-08-09 21:20:00.000000000","message":"I don\u0027t have strong opinion on commands returning a value or not, so I\u0027m ok with the patch.\nBut the example in the commit message is misleading as it looks like fixing an issue at OpenOCD boot time while your purpose is wider.\n\nSaid that, I agree that OpenOCD Tcl commands are not consistent and any effort to rationalize them is welcome.\nIf you want to propose some guideline, please do it. Are useful for dev and reviews.\nPlease always include doc in your rationalization effort (either file openocd.texi and fields help and usage).","commit_id":"f8bc1923db73da2894ccb89de5ff23172da900a5"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"0e3aee5071c234d6d06dbdef33aaa27849a0b464","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"9fe09bd1_bfb9fb71","in_reply_to":"4bca3473_be01f877","updated":"2025-09-08 12:27:43.000000000","message":"Done","commit_id":"f8bc1923db73da2894ccb89de5ff23172da900a5"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d5129fe507ce5bab5a0f0d153b044291384b2466","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"4bca3473_be01f877","in_reply_to":"6b7ad52f_ef1636cf","updated":"2025-09-06 14:57:17.000000000","message":"Humm, plus, now it has merge conflict after https://review.openocd.org/c/openocd/+/9051","commit_id":"f8bc1923db73da2894ccb89de5ff23172da900a5"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"3dac47bde9146e291a7310f965818f88f4b05091","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"2c1e9849_9b9b3091","in_reply_to":"c0554ee7_148570f9","updated":"2025-08-05 13:10:18.000000000","message":"\u003e But the issue you report in the commit message is instead that OpenOCD prints the last result of every script or command that it runs from its command line, including standard TCL commands:\n\u003e [...]\n\u003e \n\u003e But the issue you report in the commit message is instead that OpenOCD prints the last result of every script or command that it runs from its command line, including standard TCL commands\n\u003e \n\u003e [...]\n\nThanks for the detailed explanation! Funny that we merged this patch [1] for the same reason :D\n\n\u003e In TCL most \"assignment\" commands return the assigned value\n\nYes, \"assignment\" commands in Tcl often return the assigned value. I\u0027m not very deep in Tcl, but it seems not very consistent here: `array set X {foo bar}` returns nothing, for example. Anyway, in case of \"variable assignment\" commands this may be beneficial as one can \"chain\" commands. In OpenOCD we actually do not have \"assignment\" commands, at least from my point of view, but rather \"regular\" commands like `puts`.\n\nAt the moment, the return behaviour of OpenOCD\u0027s Tcl commands is very inconsistent. Some commands return nothing or \"echo\" the input on success, some print human-readable messages, some print an error message but return `ERROR_OK`.\n\nThe goal of my \"patch series\" is to make these commands more consistent with respect to their structure (naming and command hierarchy [4,...]), return behaviour [5,6,8] and return value [2,3].\n\nI would like to have (documented) simple and easy-to-understand rules on how (new) Tcl commands should be implemented and how they should behave.\n\nOne of these rules is that if a command (including parameters) is not intended to query a value, it should not return any value except in case of an error. Neither an “everything went well” message nor the input values. This is probably not applicable to high-level (\"user\") commands, such as `program`. This means that at some point we have to make some kind of distinction between low- and high-level Tcl commands - at least in terms of documentation. [7] is one patch in this direction. In this case `mdw` would be a user / high-level command not *intended* for scripting or the RPC interface.\n\nIf you have an easier or more practical set of rules let me know. But with the \"assignment\" argument, we could also echo the input of commands like `write_register`.\n\n\u003e The command you change in this commit is just the last in your \"usual\" config file. Are you planning to change any \"last\" command in every config file?\n\nNo, of course not only every last command but all commands (see comments above).\n\n\u003e I also find annoying this extra print, but I think it should be changed somewhere else, not in each command.\n\nI have no strong opinion on whether we want to print the last command output of every executed config file. But that\u0027s definitely not the purpose of this patch (see comments above).\n\n\u003e I see other patches from you that as side effect drop the command\u0027s output:\n\u003e [...]\n\u003e Are these pushed for the same reason?\n\u003e Should we revisit them?\n\nNo, the output is dropped on purpose here (see comments above).\n\n[1] https://review.openocd.org/c/openocd/+/8217\n[2] https://review.openocd.org/c/openocd/+/9000\n[3] https://review.openocd.org/c/openocd/+/9000\n[4] https://review.openocd.org/c/openocd/+/8345\n[5] https://review.openocd.org/c/openocd/+/9068\n[6] https://review.openocd.org/c/openocd/+/8996\n[7] https://review.openocd.org/c/openocd/+/8635\n[8] https://review.openocd.org/c/openocd/+/8996","commit_id":"f8bc1923db73da2894ccb89de5ff23172da900a5"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"0e3aee5071c234d6d06dbdef33aaa27849a0b464","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"b2fee78c_2f50d16e","in_reply_to":"f67d5159_3062095e","updated":"2025-09-08 12:27:43.000000000","message":"Done","commit_id":"f8bc1923db73da2894ccb89de5ff23172da900a5"}]}
