)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1001874,"name":"Andrzej Sierżęga","email":"asier70@gmail.com","username":"asier70"},"change_message_id":"4c3aa915d9beda81917a0e02bf1f5d46ac9c119b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"b7108276_bfd79e9a","updated":"2025-08-13 09:18:40.000000000","message":"Building latest version of openocd I updated jimtcl to the newest\nJim Tcl v0.83+\nCompilation failed so I used your patch that helped me.\nOpenocd works but using \"end\" command at the end of my cfg file (used for batch programming) generates this error:\n\nsoftdevice.cfg:23: Error: wrong # args: should be \"exit ...\"\nTraceback (most recent call last):\n  File \"softdevice.cfg\", line 23, in script\n  \nAdding parameter like \"exit 0\" or using \"shutdown\" doesn\u0027t help.\n\nUsing Jim Tcl v0.83, compiled openocd works fine.\nI am on windows, compilation in ubuntu wsl2.","commit_id":"368e3adc19a65c2ffc38212bfbc8fecd2488976c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f17e8e89cf0b2d1c903ebcb943be60739863bb6a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"56defb14_cac47984","updated":"2025-08-07 13:05:51.000000000","message":"Commit message updated, as the change is now in jimtcl master branch.\nThis patch should be in OpenOCD v1.0.0","commit_id":"368e3adc19a65c2ffc38212bfbc8fecd2488976c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f06fc513ba2384239a69cd3155271a91d6acfd1c","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"ef4be61c_20ebc75f","in_reply_to":"07947f51_0aadfeb5","updated":"2025-08-13 12:13:32.000000000","message":"Actually there is a proposal in Tcl upstream for \u0027info help\u0027.\nIt is dated 29-Apr-2004 and I don\u0027t understand if it would be considered for next Tcl 9.1\nhttps://core.tcl-lang.org/tips/doc/trunk/tip/193.md\nBut the proposed syntax differs from the new commit on jimtcl","commit_id":"368e3adc19a65c2ffc38212bfbc8fecd2488976c"},{"author":{"_account_id":1001874,"name":"Andrzej Sierżęga","email":"asier70@gmail.com","username":"asier70"},"change_message_id":"852979eb2b30734cd82f1bbd2f6f79ace3e64eb8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"846b8c03_1b770341","in_reply_to":"0d6f0d29_2529f9d7","updated":"2025-08-19 13:31:42.000000000","message":"\u003e Please check the new changes\n\u003e https://review.openocd.org/c/openocd/+/9083\n\u003e https://review.openocd.org/c/openocd/+/9084\n\u003e I hope I have covered all the special error codes.\n\nI tested all 3 patches and openocd compiles and works well using the newest and older jimtcl.","commit_id":"368e3adc19a65c2ffc38212bfbc8fecd2488976c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"284c7d2163e3c7acad945a092dfc1f62dd33ad4a","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"07947f51_0aadfeb5","in_reply_to":"27aa7bd3_993f8a2f","updated":"2025-08-13 12:01:35.000000000","message":"So, the same jimtcl huge commit [1], linked in the commit message, that triggers this patch is also responsible for the issue reported by Andrzej.\nBefore that commit the function JimInvokeCommand() returned directly the value returned by OpenOCD commands. We abused of that, returning positive JIM_ERR and similar jimtcl values, or returning negative ERROR_FAIL and similar OpenOCD codes. Bad choice!\nAfter the commit, JimInvokeCommand() calls JimCallNative() that considers negative values as \"argument error\", so it prints\n`wrong # args: should be \\\"%#s\\\"`\nand returns JIM_ERR.\n\nIn the case of OpenOCD command \"exit\", we return the special value `ERROR_COMMAND_CLOSE_CONNECTION` that is `(-600)`.\nThe new jimtcl reports it as an \"argument error\" and prints that.\nSince the command \"exit\" is registered with the old API `Jim_CreateCommand()`, jimtcl has no idea about the command syntax and the adds \"...\" at the end, returning the string\n`wrong # args: should be \"exit ...\"`\n\nConclusions:\n- the OpenOCD commands we register with `Jim_CreateCommand()` cannot anymore return a negative OpenOCD error code. We need an alternative way to return it!\n\n- every OpenOCD command that returns a special OpenOCD error code that is later interpreted by OpenOCD (`ERROR_COMMAND_CLOSE_CONNECTION`, `ERROR_COMMAND_SYNTAX_ERROR`, ...) will not get the special code detected anymore by OpenOCD!\n\n- the new jimtcl API `Jim_RegisterCommand()` is supposed to replace `Jim_CreateCommand()`. It has the new arguments `minargs` and `maxargs` to check the syntax, and `usage` and `help` to printout some message on syntax error and with the new jimtcl commands `info help ...` and `info usage ...`. While these could be interesting to reduce the load on OpenOCD commands `help` and `usage`, the new `info ...` are apparently not standard Tcl commands! (See https://www.tcl-lang.org/man/tcl9.0/TclCmd/info.html ). I\u0027m not willing to get lock with such not standard stuff!","commit_id":"368e3adc19a65c2ffc38212bfbc8fecd2488976c"},{"author":{"_account_id":1001874,"name":"Andrzej Sierżęga","email":"asier70@gmail.com","username":"asier70"},"change_message_id":"23d9473365f33794dc8259e7a997ce0fc5e889a7","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"27aa7bd3_993f8a2f","in_reply_to":"3248ed20_61659322","updated":"2025-08-13 10:18:01.000000000","message":"\u003e I believe you mean \"exit\" command, not \"end\".\n\nSorry for the typo. I meant to write \"exit\", of course.\n\"shutdown\" is also affected.","commit_id":"368e3adc19a65c2ffc38212bfbc8fecd2488976c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"7ce5da64a66c51c57f4407062f594bee47d4c3a1","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"3248ed20_61659322","in_reply_to":"b7108276_bfd79e9a","updated":"2025-08-13 10:07:07.000000000","message":"\u003e Openocd works but using \"end\" command at the end of my cfg file (used for batch programming) generates this error:\n\nI believe you mean \"exit\" command, not \"end\".\n\n\u003e softdevice.cfg:23: Error: wrong # args: should be \"exit ...\"\n\nI can reproduce simply by\n`openocd -c exit`\n\nThere is some weird overlap between the native Tcl command `exit` and the override done by OpenOCD with the exit in `telnet_server.c`\nOverriding commands is allowed by Tcl, and we have few of them.\nI need more time to find out what the issue is.\nAnyway, the fix would be in a separate patch.\nThanks for reporting it.","commit_id":"368e3adc19a65c2ffc38212bfbc8fecd2488976c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"60d21c6a39a5c5e44de27ce1dd8ccdb411d51ac8","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"0d6f0d29_2529f9d7","in_reply_to":"ef4be61c_20ebc75f","updated":"2025-08-15 14:28:40.000000000","message":"Please check the new changes\nhttps://review.openocd.org/c/openocd/+/9083\nhttps://review.openocd.org/c/openocd/+/9084\nI hope I have covered all the special error codes.","commit_id":"368e3adc19a65c2ffc38212bfbc8fecd2488976c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"9b914580deea157fc1f08f55ce57eb1942927b3d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"15ad5f4d_a5122287","updated":"2025-08-15 15:52:00.000000000","message":"I rebased it by mistake, loosing the previous +2","commit_id":"5fb503865ade3a53baf971ef353bcc2f4ffbe6e2"}]}
