)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"346ceb1df073fcb3addeb9ab3c46a8e3d518f20a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"37c76358_8f552bfe","updated":"2021-11-24 17:27:08.000000000","message":"If you are running a debugger, like OpenOCD, is because the your firmware is somehow broken.\nWhile the concept of user-defined semihosting commands is interesting, I would not feel comfortable to let a broken FW to execute arbitrary TCL commands on my PC, e.g. \"exec rm -rf /\"!\n\nIt could be safer and cleaner to extend the target\u0027s events to have a \"semihosting-extended\" or similar event, triggered by the extended semihosting request.\nThen the event handler can read the target\u0027s registers and memory and do what it wants, but it\u0027s up to the OpenOCD user, not up to the broken firmware, to decide the actions.\nAlso, changing the actions (e.g. adding some \"echo\" for logging) would be easier in OpenOCD script than in the FW.\nToday\u0027s events do not accept arguments, but could be nice to extend the semantic and then pass directly some register value to the new event. But this can be a following improvement.\nAnyway, this is just my idea, and I never used semihosting. Let\u0027s wait for other comments before changing anything.","commit_id":"caf88dd56594c73a624f633806b0a966cce3a8cd"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6d0976c95d08030d9c0880acfc12c1207852f72a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"e50a7782_98c1dd1d","in_reply_to":"37c76358_8f552bfe","updated":"2021-11-24 21:33:29.000000000","message":"I\u0027ve reconsidered the functionality, please have a look at it! \nNow only commands defined on target side can be called by the target, with extra parameters. This looks like a great general-purpose update for me.","commit_id":"caf88dd56594c73a624f633806b0a966cce3a8cd"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"1b3c9e95678223b9be55a42b506076f9bb95c744","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"40c6c2f4_1ccc7ad5","in_reply_to":"e50a7782_98c1dd1d","updated":"2021-11-24 21:36:34.000000000","message":"commands defined on host side*","commit_id":"caf88dd56594c73a624f633806b0a966cce3a8cd"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"bd8d0ea58a898e60cc9e59f66fc1e78657e45962","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":5,"id":"4f7f6bef_e6d6be47","updated":"2021-12-14 11:55:21.000000000","message":"Dear Maintainers,\n\nI would like to give you a little context for the patch.\nI\u0027ve started the implementation of this feature to make the RTT configuration procedure more seamless, but in the end, I think a general-purpose interface is made, which can be used for many applications, like batch programming and end-to-end production testing.\n\nWe are using RTT without a fixed Control Block location, so at startup, we always had to wait while the whole RAM area was scanned for the CB (if the location of the CB is changed in the new build, a new RTT setup is required)\nSo a reprogramming cycle followed the steps (from gdb terminal):\n- load\n- reset\n- mon rtt setup RAM-base-address RAM-size id\n- mon rtt start\n- continue\n\nWith this patch, the aforementioned procedure can be simplified to the minimal load and reset if (ARM M4 target, custom opcode 0x169 used):\n- The user place at openocd.cfg after init:\narm semihosting on\narm semihosting_user_op on\narm semihosting_user_op_bind 0x169 rtt\n- And in code:\n  asm\n  (\n  \"ldr r0, \u003d0x169;\"\n  \"mov r1, %[msg];\"\n  \"bkpt #0xab\"\n  : // no output\n  : [msg] \"r\" (msg)\n  : \"r0\", \"r1\", \"memory\"\n  );\n- At startup the target can lookup the exact location of the CB, so it can issue the RTT setup command from the target side, with the exact address and size.\n\nPlease note, with this solution, the danger of the erroneously issued commands is negligible because the user binds the host-side TCL operation to the opcodes. Furthermore, the enabled opcode range is reserved for user applications by ARM, and in current openocd releases, semihosting calls with these opcodes are simply ignored. \nSo this patch is backward compatible, secure, and utilizes unused resources.\n\nThank you for your time,\nZoltán","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6b6126ab9f0c7c251ddb6f327de898b08125c67a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"f0541967_13cca4c6","updated":"2021-12-01 13:51:26.000000000","message":"Gentlemen,\nPlease have a look at this beautiful patch of mine, if you have can spare some time. \nThanks in advance,\nZoltán","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c221c67c719c11fc7c50da73968099d38eaa7a95","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"13acc078_86ea7546","updated":"2021-12-17 00:06:33.000000000","message":"few comments","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"adc534da64b031b65c5e13a0e323c22e83441ce9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"0c69290e_19c0ded5","in_reply_to":"4f7f6bef_e6d6be47","updated":"2022-01-26 19:04:21.000000000","message":"Done","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6fe7492440575ead348e99cd3c4994fd8d824322","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"11d5458c_3580157c","updated":"2021-12-17 20:14:07.000000000","message":"Thank you for the comments! ","commit_id":"4372e216f612249f2eb9dc4d31a9de865d56e83e"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"873cd770d6ab982654d9b1e6cd3195d60132c1dc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"0f781650_5d982ffd","updated":"2021-12-20 23:05:49.000000000","message":"Few minor comments inline in the code.\n\nBut I would like to return to my proposal of using the existing OpenOCD events, instead of \"semihosting_user_op_bind\".\nThe reason is to minimize this change and reuse the existing code. It will help maintainers to work and maintain this new code.\nHere is my suggestion. Please check it and complain if something is incorrect or not clear. Again, I\u0027m not expert on semihosting.\n\nLet\u0027s initially restrict this patch to only few semihosting user commands, e.g. only 8 instead of covering all the 256.\nI think 8 should be enough for most of the cases and it could be expanded later.\n\nThe user commands should be registered as target events. The infrastructure already exists.\nIn src/target/target.h add the 8 events to \"enum target_event\", e.g. TARGET_EVENT_SEMIHOSTING_USER_CMD_0X100, ...\nIn src/target/target.c add the 8 events to \"static const struct jim_nvp nvp_target_event[]\", e.g. \"semihosting-user-cmd-0x100\" to \"semihosting-user-cmd-0x107\".\nThe struct only handle static event lists, it\u0027s not ready to hold an array of event names \"semihosting-user-cmd[n]\", that\u0027s why I suggest (for the moment) to limit to 8.\n\nWith this simple change you reuse all the existing commands to register and use events.\nNo need for new commands for bind/unbind.\nAnd events can be registered anytime, even before \"init\", with e.g. \"\u003ctarget_name\u003e configure -event semihosting-user-cmd-0x100 {tcl_code}\"\n\nIn the semihosting code you can call the event by running \"target_handle_event(target, event);\".\n\nThe code of the event needs to read the data passed from the target.\nSo there is the need to add one command e.g. \"semihosting read\" that returns the data.\nThe handler will run \"set data [semihosting read]\" to get the data.\nDo we need a command to send back data and result to the target? Could be added later, if needed.\nOr we can just have a command returning the target\u0027s pointer and TCL will read/write the target\u0027s memory. Don\u0027t know.\n\nI\u0027m not sure about the command enable/disable; I don\u0027t have in mind any use case.\n\n","commit_id":"d5564a5b84b1d9b47a3e93c4d7c8d79d939f7e04"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"0587e77aa481a3d33b19983042f0d7f71f84bb27","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"a9c370b0_60530366","in_reply_to":"0f781650_5d982ffd","updated":"2021-12-23 17:04:15.000000000","message":"Thank you for the suggestion, I wasn\u0027t aware of this target level event-eventhandler mechanism. I\u0027ve converted the patch to fit your proposal.\n\nTo the read-from-target-memory challenge, I\u0027ve made an easy solution: A member in the semihosting object stores the parameter string until the event handlers are running, then cleans up.","commit_id":"d5564a5b84b1d9b47a3e93c4d7c8d79d939f7e04"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"0587e77aa481a3d33b19983042f0d7f71f84bb27","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"c4bda629_0b4724d9","updated":"2021-12-23 17:04:15.000000000","message":"Hi,\nI\u0027ve converted the method to fit the proposition of Mr.Antonio Borneo. I didn\u0027t update the docs yet, I would wait for your approval for this new procedure.\n\nThanks in advance:\nZoltán","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"558ce554e5f9b488fd876e100bd40828f7a3f6de","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"eac6c926_d2e54f87","updated":"2021-12-28 17:23:40.000000000","message":"Thanks, I\u0027m really happy seeing it getting much simpler.\nFew more comments, but nothing complex nor blocking.","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"d31385d521e5d4784feb966d89df18d6425c2ba3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"3a43eddd_1c145e98","updated":"2022-01-04 18:12:07.000000000","message":"I\u0027ve updated the patch to meet the comments. Thanks for the review.\n","commit_id":"0dd1df554d82c42f0ddb5afa0f21be1a013b9cc2"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"eea92875ba85773b893a118706b7fdcadd3a1a70","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"85766d60_f896c662","updated":"2022-01-21 16:50:16.000000000","message":"Ok with this version. Only the documentation needs to be updated.","commit_id":"e6250246c63f12a326e41ee7e0ded98188b27e90"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"283504173096e9dc7108e8d558887c3f2fbd53fa","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"ee7bcff0_0d0acd08","updated":"2022-01-26 16:08:30.000000000","message":"Some other fixes.\nCan you please also edit the commit message to stay in 75 char per line?","commit_id":"93bc0ab3f0f47a7a7a20f8cafc458989d15f15db"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"adc534da64b031b65c5e13a0e323c22e83441ce9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"b4682561_74b5fe6b","in_reply_to":"ee7bcff0_0d0acd08","updated":"2022-01-26 19:04:21.000000000","message":"Oh, I thought that has 80 char per line limit too...","commit_id":"93bc0ab3f0f47a7a7a20f8cafc458989d15f15db"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"64be4e359bc9e69fe5cb37647373bda155e783f6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"2107316b_571b3b8e","updated":"2022-01-27 10:00:03.000000000","message":"I don\u0027t really understand what happened with the last jenkins build, but I\u0027ve added a space to the docs, and the build failed with some unrelated reasoning. Looks like a bug in the building environment. Can you trigger a re-build?","commit_id":"d33860062678946eb5a310f992664885fd84143c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b7cd82b669d4ec305f1bc8d785925a2f645655e6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"6060ec73_c578c335","updated":"2022-01-27 11:10:03.000000000","message":"Thanks for your patience!\nI have no idea what was wrong in the previous build. Not clear.\nI\u0027m also surprised you succeed to push patchset 17 since it is exactly the same as patchset 16, gerrit should refuse it!\nAnyway, here we are! Thanks again!\nI will like to get review from other people, otherwise I will merge this in ~2 weeks.","commit_id":"d33860062678946eb5a310f992664885fd84143c"}],"doc/openocd.texi":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"283504173096e9dc7108e8d558887c3f2fbd53fa","unresolved":true,"context_lines":[{"line_number":9264,"context_line":""},{"line_number":9265,"context_line":"When the target makes semihosting call with operation number from range 0x100-"},{"line_number":9266,"context_line":"0x107, an optional string parameter can be passed to the server. This parameter"},{"line_number":9267,"context_line":"valid during the run of the event handlers and accessible with this command."},{"line_number":9268,"context_line":"@end deffn"},{"line_number":9269,"context_line":""},{"line_number":9270,"context_line":"@section ARMv4 and ARMv5 Architecture"}],"source_content_type":"text/x-texinfo","patch_set":14,"id":"c835360e_4a277f20","line":9267,"updated":"2022-01-26 16:08:30.000000000","message":"... This parameter is valid ... and is accessible ...","commit_id":"93bc0ab3f0f47a7a7a20f8cafc458989d15f15db"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"adc534da64b031b65c5e13a0e323c22e83441ce9","unresolved":false,"context_lines":[{"line_number":9264,"context_line":""},{"line_number":9265,"context_line":"When the target makes semihosting call with operation number from range 0x100-"},{"line_number":9266,"context_line":"0x107, an optional string parameter can be passed to the server. This parameter"},{"line_number":9267,"context_line":"valid during the run of the event handlers and accessible with this command."},{"line_number":9268,"context_line":"@end deffn"},{"line_number":9269,"context_line":""},{"line_number":9270,"context_line":"@section ARMv4 and ARMv5 Architecture"}],"source_content_type":"text/x-texinfo","patch_set":14,"id":"de34b0e6_1448d9c8","line":9267,"in_reply_to":"c835360e_4a277f20","updated":"2022-01-26 19:04:21.000000000","message":"Ack","commit_id":"93bc0ab3f0f47a7a7a20f8cafc458989d15f15db"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"5c57aaec41bf0ccec9a888e66693344eb5e74f0a","unresolved":true,"context_lines":[{"line_number":9264,"context_line":""},{"line_number":9265,"context_line":"When the target makes semihosting call with operation number from range 0x100-"},{"line_number":9266,"context_line":"0x107, an optional string parameter can be passed to the server. This parameter"},{"line_number":9267,"context_line":"is valid during the run of the event handlers and isaccessible with this"},{"line_number":9268,"context_line":"command."},{"line_number":9269,"context_line":"@end deffn"},{"line_number":9270,"context_line":""}],"source_content_type":"text/x-texinfo","patch_set":15,"id":"211f216b_835774c8","line":9267,"updated":"2022-01-26 21:59:56.000000000","message":"sorry, still error: \"is accessible\"","commit_id":"df481bf28614dbac08248a1cc3586f06a8d4cc15"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"5dcdd5517883931ddb2d6a9ab879c3e36751768f","unresolved":false,"context_lines":[{"line_number":9264,"context_line":""},{"line_number":9265,"context_line":"When the target makes semihosting call with operation number from range 0x100-"},{"line_number":9266,"context_line":"0x107, an optional string parameter can be passed to the server. This parameter"},{"line_number":9267,"context_line":"is valid during the run of the event handlers and isaccessible with this"},{"line_number":9268,"context_line":"command."},{"line_number":9269,"context_line":"@end deffn"},{"line_number":9270,"context_line":""}],"source_content_type":"text/x-texinfo","patch_set":15,"id":"686a31c0_20cc2aef","line":9267,"in_reply_to":"211f216b_835774c8","updated":"2022-01-27 09:38:55.000000000","message":"Oh my...","commit_id":"df481bf28614dbac08248a1cc3586f06a8d4cc15"}],"src/target/semihosting_common.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c221c67c719c11fc7c50da73968099d38eaa7a95","unresolved":true,"context_lines":[{"line_number":185,"context_line":"\t\t\tsemihosting-\u003eresult \u003d 0;"},{"line_number":186,"context_line":"\t\t\tLOG_DEBUG(\"op\u003d0x%x is a user defined opcode, but the processing\""},{"line_number":187,"context_line":"\t\t\t\t\t\" of these opcodes are disabled. This is not an error.\","},{"line_number":188,"context_line":"\t\t\t\t\t(int)semihosting-\u003eop);"},{"line_number":189,"context_line":"\t\t\treturn ERROR_OK;"},{"line_number":190,"context_line":"\t\t}"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"34a98f65_18f6ca0e","line":188,"updated":"2021-12-17 00:06:33.000000000","message":"semihosting-\u003eop is already of type int. Why this cast?","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6fe7492440575ead348e99cd3c4994fd8d824322","unresolved":false,"context_lines":[{"line_number":185,"context_line":"\t\t\tsemihosting-\u003eresult \u003d 0;"},{"line_number":186,"context_line":"\t\t\tLOG_DEBUG(\"op\u003d0x%x is a user defined opcode, but the processing\""},{"line_number":187,"context_line":"\t\t\t\t\t\" of these opcodes are disabled. This is not an error.\","},{"line_number":188,"context_line":"\t\t\t\t\t(int)semihosting-\u003eop);"},{"line_number":189,"context_line":"\t\t\treturn ERROR_OK;"},{"line_number":190,"context_line":"\t\t}"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"a0358d99_651070ca","line":188,"in_reply_to":"34a98f65_18f6ca0e","updated":"2021-12-17 20:14:07.000000000","message":"Ack","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c221c67c719c11fc7c50da73968099d38eaa7a95","unresolved":true,"context_lines":[{"line_number":208,"context_line":"\t\t\tretval \u003d semihosting_read_fields(target, 2, fields);"},{"line_number":209,"context_line":"\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":210,"context_line":"\t\t\t\treturn retval;"},{"line_number":211,"context_line":"\t\t\t} else {"},{"line_number":212,"context_line":"\t\t\t\tuint64_t addr \u003d semihosting_get_field(target, 0, fields);"},{"line_number":213,"context_line":"\t\t\t\tsize_t len \u003d semihosting_get_field(target, 1, fields);"},{"line_number":214,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"925fccdd_e3613318","line":211,"updated":"2021-12-17 00:06:33.000000000","message":"No need for \"else\" after a \"return\"\nRemove the \"else\" and reduce the indentation of the following block of code","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6fe7492440575ead348e99cd3c4994fd8d824322","unresolved":false,"context_lines":[{"line_number":208,"context_line":"\t\t\tretval \u003d semihosting_read_fields(target, 2, fields);"},{"line_number":209,"context_line":"\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":210,"context_line":"\t\t\t\treturn retval;"},{"line_number":211,"context_line":"\t\t\t} else {"},{"line_number":212,"context_line":"\t\t\t\tuint64_t addr \u003d semihosting_get_field(target, 0, fields);"},{"line_number":213,"context_line":"\t\t\t\tsize_t len \u003d semihosting_get_field(target, 1, fields);"},{"line_number":214,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"ef442f95_3f290403","line":211,"in_reply_to":"925fccdd_e3613318","updated":"2021-12-17 20:14:07.000000000","message":"Done","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c221c67c719c11fc7c50da73968099d38eaa7a95","unresolved":true,"context_lines":[{"line_number":215,"context_line":"\t\t\t\tconst size_t command_len \u003d strlen(bound_command);"},{"line_number":216,"context_line":"\t\t\t\tassert(command_len \u003e 0);"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"\t\t\t\tif (len \u003e 0 \u0026\u0026 len \u003c SEMIHOSTING_MAX_TCL_COMMAND_PARAMS_LENGTH) {"},{"line_number":219,"context_line":"\t\t\t\t\tunsigned int full_length \u003d command_len + 1 + len;"},{"line_number":220,"context_line":"\t\t\t\t\tchar command_with_params[full_length];"},{"line_number":221,"context_line":"\t\t\t\t\tmemset(command_with_params, 0, full_length);"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"4999666f_3b1052e8","line":218,"updated":"2021-12-17 00:06:33.000000000","message":"you can use the openocd function alloc_printf() to create the command to run\nThis should simplify the code and probably drop the limit of SEMIHOSTING_MAX_TCL_COMMAND_PARAMS_LENGTH characters.","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6fe7492440575ead348e99cd3c4994fd8d824322","unresolved":false,"context_lines":[{"line_number":215,"context_line":"\t\t\t\tconst size_t command_len \u003d strlen(bound_command);"},{"line_number":216,"context_line":"\t\t\t\tassert(command_len \u003e 0);"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"\t\t\t\tif (len \u003e 0 \u0026\u0026 len \u003c SEMIHOSTING_MAX_TCL_COMMAND_PARAMS_LENGTH) {"},{"line_number":219,"context_line":"\t\t\t\t\tunsigned int full_length \u003d command_len + 1 + len;"},{"line_number":220,"context_line":"\t\t\t\t\tchar command_with_params[full_length];"},{"line_number":221,"context_line":"\t\t\t\t\tmemset(command_with_params, 0, full_length);"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"3b825456_0bda2b7d","line":218,"in_reply_to":"4999666f_3b1052e8","updated":"2021-12-17 20:14:07.000000000","message":"Ack","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c221c67c719c11fc7c50da73968099d38eaa7a95","unresolved":true,"context_lines":[{"line_number":222,"context_line":"\t\t\t\t\tmemcpy(command_with_params, bound_command, command_len);"},{"line_number":223,"context_line":"\t\t\t\t\tcommand_with_params[command_len] \u003d \u0027 \u0027;"},{"line_number":224,"context_line":"\t\t\t\t\tretval \u003d target_read_buffer(target, addr, len,"},{"line_number":225,"context_line":"\t\t\t\t\t\t\t(uint8_t *) (command_with_params + command_len + 1));"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"\t\t\t\t\tif (retval !\u003d ERROR_OK)"},{"line_number":228,"context_line":"\t\t\t\t\t\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"b270d484_7913ec8a","line":225,"updated":"2021-12-17 00:06:33.000000000","message":"remove the space between cast and value","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6fe7492440575ead348e99cd3c4994fd8d824322","unresolved":false,"context_lines":[{"line_number":222,"context_line":"\t\t\t\t\tmemcpy(command_with_params, bound_command, command_len);"},{"line_number":223,"context_line":"\t\t\t\t\tcommand_with_params[command_len] \u003d \u0027 \u0027;"},{"line_number":224,"context_line":"\t\t\t\t\tretval \u003d target_read_buffer(target, addr, len,"},{"line_number":225,"context_line":"\t\t\t\t\t\t\t(uint8_t *) (command_with_params + command_len + 1));"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"\t\t\t\t\tif (retval !\u003d ERROR_OK)"},{"line_number":228,"context_line":"\t\t\t\t\t\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"8ce83fa8_34781505","line":225,"in_reply_to":"b270d484_7913ec8a","updated":"2021-12-17 20:14:07.000000000","message":"Done","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c221c67c719c11fc7c50da73968099d38eaa7a95","unresolved":true,"context_lines":[{"line_number":232,"context_line":"\t\t\t\t\t\t\t\tcommand_with_params);"},{"line_number":233,"context_line":"\t\t\t\t\t\tLOG_DEBUG(\"Runnning tcl command from semihosting \""},{"line_number":234,"context_line":"\t\t\t\t\t\t\t\t\"(length\u003d%u): %s\","},{"line_number":235,"context_line":"\t\t\t\t\t\t\t\t(unsigned int)len, command_with_params);"},{"line_number":236,"context_line":"\t\t\t\t\t} else {"},{"line_number":237,"context_line":"\t\t\t\t\t\tsemihosting-\u003eresult \u003d -1;"},{"line_number":238,"context_line":"\t\t\t\t\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"e85857be_2723cdc4","line":235,"updated":"2021-12-17 00:06:33.000000000","message":"\"len\" is of type \"size_t\". Remove the cast and use format string \"%zd\"","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6fe7492440575ead348e99cd3c4994fd8d824322","unresolved":false,"context_lines":[{"line_number":232,"context_line":"\t\t\t\t\t\t\t\tcommand_with_params);"},{"line_number":233,"context_line":"\t\t\t\t\t\tLOG_DEBUG(\"Runnning tcl command from semihosting \""},{"line_number":234,"context_line":"\t\t\t\t\t\t\t\t\"(length\u003d%u): %s\","},{"line_number":235,"context_line":"\t\t\t\t\t\t\t\t(unsigned int)len, command_with_params);"},{"line_number":236,"context_line":"\t\t\t\t\t} else {"},{"line_number":237,"context_line":"\t\t\t\t\t\tsemihosting-\u003eresult \u003d -1;"},{"line_number":238,"context_line":"\t\t\t\t\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"dfa88bb0_7e81ed1f","line":235,"in_reply_to":"e85857be_2723cdc4","updated":"2021-12-17 20:14:07.000000000","message":"Ack","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c221c67c719c11fc7c50da73968099d38eaa7a95","unresolved":true,"context_lines":[{"line_number":247,"context_line":"\t\tsemihosting-\u003eresult \u003d 0;"},{"line_number":248,"context_line":"\t\tLOG_DEBUG(\"op\u003d0x%x is a user defined opcode, but there isn\u0027t any \""},{"line_number":249,"context_line":"\t\t\t\t\"command bound to it. This is not an error.\","},{"line_number":250,"context_line":"\t\t\t\t(int)semihosting-\u003eop);"},{"line_number":251,"context_line":"\t\treturn ERROR_OK;"},{"line_number":252,"context_line":"\t}"},{"line_number":253,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"07d7e158_44de205a","line":250,"updated":"2021-12-17 00:06:33.000000000","message":"semihosting-\u003eop is already of type \"int\"","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6fe7492440575ead348e99cd3c4994fd8d824322","unresolved":false,"context_lines":[{"line_number":247,"context_line":"\t\tsemihosting-\u003eresult \u003d 0;"},{"line_number":248,"context_line":"\t\tLOG_DEBUG(\"op\u003d0x%x is a user defined opcode, but there isn\u0027t any \""},{"line_number":249,"context_line":"\t\t\t\t\"command bound to it. This is not an error.\","},{"line_number":250,"context_line":"\t\t\t\t(int)semihosting-\u003eop);"},{"line_number":251,"context_line":"\t\treturn ERROR_OK;"},{"line_number":252,"context_line":"\t}"},{"line_number":253,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"d80b152d_d15214ea","line":250,"in_reply_to":"07d7e158_44de205a","updated":"2021-12-17 20:14:07.000000000","message":"Ack","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c221c67c719c11fc7c50da73968099d38eaa7a95","unresolved":true,"context_lines":[{"line_number":1689,"context_line":"\treturn ERROR_OK;"},{"line_number":1690,"context_line":"}"},{"line_number":1691,"context_line":""},{"line_number":1692,"context_line":"static __COMMAND_HANDLER(handle_common_semihosting_user_op_command)"},{"line_number":1693,"context_line":"{"},{"line_number":1694,"context_line":"\tstruct target *target \u003d get_current_target(CMD_CTX);"},{"line_number":1695,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"4b6a4adb_b0607910","line":1692,"updated":"2021-12-17 00:06:33.000000000","message":"We have the macro COMMAND_HANDLER that is defined a \"static __COMMAND_HANDLER\".\nPlease use it.\nThe rest of this file is incorrect. I\u0027m sending out a patch for fixing it.","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6fe7492440575ead348e99cd3c4994fd8d824322","unresolved":false,"context_lines":[{"line_number":1689,"context_line":"\treturn ERROR_OK;"},{"line_number":1690,"context_line":"}"},{"line_number":1691,"context_line":""},{"line_number":1692,"context_line":"static __COMMAND_HANDLER(handle_common_semihosting_user_op_command)"},{"line_number":1693,"context_line":"{"},{"line_number":1694,"context_line":"\tstruct target *target \u003d get_current_target(CMD_CTX);"},{"line_number":1695,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"d593bfee_148b063c","line":1692,"in_reply_to":"4b6a4adb_b0607910","updated":"2021-12-17 20:14:07.000000000","message":"Ack","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c221c67c719c11fc7c50da73968099d38eaa7a95","unresolved":true,"context_lines":[{"line_number":1721,"context_line":"\treturn ERROR_OK;"},{"line_number":1722,"context_line":"}"},{"line_number":1723,"context_line":""},{"line_number":1724,"context_line":"static __COMMAND_HANDLER(handle_common_semihosting_user_op_bind_command)"},{"line_number":1725,"context_line":"{"},{"line_number":1726,"context_line":"\tstruct target *target \u003d get_current_target(CMD_CTX);"},{"line_number":1727,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"1279b4b9_bbbd60bd","line":1724,"updated":"2021-12-17 00:06:33.000000000","message":"Not an expert on semihosting, but I expect it would be nice to bind a bunch of commands in some configuration file.\nBut target-\u003esemihosting is allocated at \"init\", so with current code organization we can\u0027t do more.\nAny idea?","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6fe7492440575ead348e99cd3c4994fd8d824322","unresolved":true,"context_lines":[{"line_number":1721,"context_line":"\treturn ERROR_OK;"},{"line_number":1722,"context_line":"}"},{"line_number":1723,"context_line":""},{"line_number":1724,"context_line":"static __COMMAND_HANDLER(handle_common_semihosting_user_op_bind_command)"},{"line_number":1725,"context_line":"{"},{"line_number":1726,"context_line":"\tstruct target *target \u003d get_current_target(CMD_CTX);"},{"line_number":1727,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"12bff1e1_02770c3e","line":1724,"in_reply_to":"1279b4b9_bbbd60bd","updated":"2021-12-17 20:14:07.000000000","message":"I don\u0027t know if it is a misuse of the interface, but I call \u0027init\u0027 in the .cfg, and place the semihosting related commands after.","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"873cd770d6ab982654d9b1e6cd3195d60132c1dc","unresolved":true,"context_lines":[{"line_number":1721,"context_line":"\treturn ERROR_OK;"},{"line_number":1722,"context_line":"}"},{"line_number":1723,"context_line":""},{"line_number":1724,"context_line":"static __COMMAND_HANDLER(handle_common_semihosting_user_op_bind_command)"},{"line_number":1725,"context_line":"{"},{"line_number":1726,"context_line":"\tstruct target *target \u003d get_current_target(CMD_CTX);"},{"line_number":1727,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"3eba9f1c_839fbec1","line":1724,"in_reply_to":"12bff1e1_02770c3e","updated":"2021-12-20 23:05:49.000000000","message":"It\u0027s not incorrect running \"init\" then other commands, but it\u0027s annoying.","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"0587e77aa481a3d33b19983042f0d7f71f84bb27","unresolved":false,"context_lines":[{"line_number":1721,"context_line":"\treturn ERROR_OK;"},{"line_number":1722,"context_line":"}"},{"line_number":1723,"context_line":""},{"line_number":1724,"context_line":"static __COMMAND_HANDLER(handle_common_semihosting_user_op_bind_command)"},{"line_number":1725,"context_line":"{"},{"line_number":1726,"context_line":"\tstruct target *target \u003d get_current_target(CMD_CTX);"},{"line_number":1727,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"fbf30644_c7078d47","line":1724,"in_reply_to":"3eba9f1c_839fbec1","updated":"2021-12-23 17:04:15.000000000","message":"With this new procedure, this problem is resolved","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c221c67c719c11fc7c50da73968099d38eaa7a95","unresolved":true,"context_lines":[{"line_number":1748,"context_line":"\t}"},{"line_number":1749,"context_line":""},{"line_number":1750,"context_line":"\tif (CMD_ARGC !\u003d 2) {"},{"line_number":1751,"context_line":"\t\tcommand_print(CMD, \"this command handles exactly two parameters\");"},{"line_number":1752,"context_line":"\t\treturn ERROR_COMMAND_SYNTAX_ERROR;"},{"line_number":1753,"context_line":"\t}"},{"line_number":1754,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"47ff5b0d_744507c2","line":1751,"updated":"2021-12-17 00:06:33.000000000","message":"when you return ERROR_COMMAND_SYNTAX_ERROR, don\u0027t use command_print because it will have no effect; the text will not be printed","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6fe7492440575ead348e99cd3c4994fd8d824322","unresolved":false,"context_lines":[{"line_number":1748,"context_line":"\t}"},{"line_number":1749,"context_line":""},{"line_number":1750,"context_line":"\tif (CMD_ARGC !\u003d 2) {"},{"line_number":1751,"context_line":"\t\tcommand_print(CMD, \"this command handles exactly two parameters\");"},{"line_number":1752,"context_line":"\t\treturn ERROR_COMMAND_SYNTAX_ERROR;"},{"line_number":1753,"context_line":"\t}"},{"line_number":1754,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"96b995d3_daf07c7c","line":1751,"in_reply_to":"47ff5b0d_744507c2","updated":"2021-12-17 20:14:07.000000000","message":"Done","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c221c67c719c11fc7c50da73968099d38eaa7a95","unresolved":true,"context_lines":[{"line_number":1807,"context_line":"\t}"},{"line_number":1808,"context_line":""},{"line_number":1809,"context_line":"\tif (CMD_ARGC !\u003d 1) {"},{"line_number":1810,"context_line":"\t\tcommand_print(CMD, \"this command handles exactly one parameter\");"},{"line_number":1811,"context_line":"\t\treturn ERROR_COMMAND_SYNTAX_ERROR;"},{"line_number":1812,"context_line":"\t}"},{"line_number":1813,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"cce16af3_af44d466","line":1810,"updated":"2021-12-17 00:06:33.000000000","message":"same here","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6fe7492440575ead348e99cd3c4994fd8d824322","unresolved":false,"context_lines":[{"line_number":1807,"context_line":"\t}"},{"line_number":1808,"context_line":""},{"line_number":1809,"context_line":"\tif (CMD_ARGC !\u003d 1) {"},{"line_number":1810,"context_line":"\t\tcommand_print(CMD, \"this command handles exactly one parameter\");"},{"line_number":1811,"context_line":"\t\treturn ERROR_COMMAND_SYNTAX_ERROR;"},{"line_number":1812,"context_line":"\t}"},{"line_number":1813,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"f77d1c61_305e4c6f","line":1810,"in_reply_to":"cce16af3_af44d466","updated":"2021-12-17 20:14:07.000000000","message":"Done","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c221c67c719c11fc7c50da73968099d38eaa7a95","unresolved":true,"context_lines":[{"line_number":1814,"context_line":"\tunsigned int op_num \u003d 0;"},{"line_number":1815,"context_line":"\tCOMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], op_num);"},{"line_number":1816,"context_line":""},{"line_number":1817,"context_line":"\tif (op_num \u003e\u003d 0x100 \u0026\u0026 op_num \u003c\u003d 0x1FF) {"},{"line_number":1818,"context_line":"\t\tchar *command \u003d semihosting-\u003ebound_user_ops[op_num - 0x100];"},{"line_number":1819,"context_line":"\t\tif (command !\u003d NULL) {"},{"line_number":1820,"context_line":"\t\t\tfree(command);"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"7ba402f6_b83e31ce","line":1817,"updated":"2021-12-17 00:06:33.000000000","message":"invert the condition, so if number not valid print error and return. The following block is out of if/then/else and you can remove one level of indentation.","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6fe7492440575ead348e99cd3c4994fd8d824322","unresolved":false,"context_lines":[{"line_number":1814,"context_line":"\tunsigned int op_num \u003d 0;"},{"line_number":1815,"context_line":"\tCOMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], op_num);"},{"line_number":1816,"context_line":""},{"line_number":1817,"context_line":"\tif (op_num \u003e\u003d 0x100 \u0026\u0026 op_num \u003c\u003d 0x1FF) {"},{"line_number":1818,"context_line":"\t\tchar *command \u003d semihosting-\u003ebound_user_ops[op_num - 0x100];"},{"line_number":1819,"context_line":"\t\tif (command !\u003d NULL) {"},{"line_number":1820,"context_line":"\t\t\tfree(command);"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"48265bfd_7133a7d2","line":1817,"in_reply_to":"7ba402f6_b83e31ce","updated":"2021-12-17 20:14:07.000000000","message":"Done","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"c221c67c719c11fc7c50da73968099d38eaa7a95","unresolved":true,"context_lines":[{"line_number":1816,"context_line":""},{"line_number":1817,"context_line":"\tif (op_num \u003e\u003d 0x100 \u0026\u0026 op_num \u003c\u003d 0x1FF) {"},{"line_number":1818,"context_line":"\t\tchar *command \u003d semihosting-\u003ebound_user_ops[op_num - 0x100];"},{"line_number":1819,"context_line":"\t\tif (command !\u003d NULL) {"},{"line_number":1820,"context_line":"\t\t\tfree(command);"},{"line_number":1821,"context_line":"\t\t\tcommand \u003d NULL;"},{"line_number":1822,"context_line":"\t\t} else {"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"40b283f9_e1bcec06","line":1819,"updated":"2021-12-17 00:06:33.000000000","message":"no comparison with NULL. and here, revert the condition so you can remove the \"else\" branch:\nif (!command) {\n  command_print(..);\n  return ERROR_FAIL;\n}\nfree(command);\ncommand \u003d NULL;","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"6fe7492440575ead348e99cd3c4994fd8d824322","unresolved":false,"context_lines":[{"line_number":1816,"context_line":""},{"line_number":1817,"context_line":"\tif (op_num \u003e\u003d 0x100 \u0026\u0026 op_num \u003c\u003d 0x1FF) {"},{"line_number":1818,"context_line":"\t\tchar *command \u003d semihosting-\u003ebound_user_ops[op_num - 0x100];"},{"line_number":1819,"context_line":"\t\tif (command !\u003d NULL) {"},{"line_number":1820,"context_line":"\t\t\tfree(command);"},{"line_number":1821,"context_line":"\t\t\tcommand \u003d NULL;"},{"line_number":1822,"context_line":"\t\t} else {"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"2aaa918d_575ea3d3","line":1819,"in_reply_to":"40b283f9_e1bcec06","updated":"2021-12-17 20:14:07.000000000","message":"Ack","commit_id":"bacd8ccd01b878e29cde09142dfd81d36aa7dc18"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"873cd770d6ab982654d9b1e6cd3195d60132c1dc","unresolved":true,"context_lines":[{"line_number":1749,"context_line":"\t}"},{"line_number":1750,"context_line":""},{"line_number":1751,"context_line":"\tif (CMD_ARGC !\u003d 2) {"},{"line_number":1752,"context_line":"\t\tLOG_ERROR(\"this command handles exactly two parameters\");"},{"line_number":1753,"context_line":"\t\treturn ERROR_COMMAND_SYNTAX_ERROR;"},{"line_number":1754,"context_line":"\t}"},{"line_number":1755,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":10,"id":"7253f246_d5e4e268","line":1752,"updated":"2021-12-20 23:05:49.000000000","message":"I\u0027m sorry, seams I wasn\u0027t clear.\nThe ERROR_COMMAND_SYNTAX_ERROR causes OpenOCD to print the \"usage\" string of the command. This should be enough to describe the syntax error; no need to add other messages.\nIf you need to print some text, then or the \"usage\" is not enough, or it\u0027s something different from syntax error (e.g. parameter N must be less than 100) and in such case you should use another ERROR_XXX.\nIn this case the message can be completely removed because \"usage\" is clear: \"\u003coperation number\u003e \u003ccommand\u003e\".","commit_id":"d5564a5b84b1d9b47a3e93c4d7c8d79d939f7e04"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"0587e77aa481a3d33b19983042f0d7f71f84bb27","unresolved":false,"context_lines":[{"line_number":1749,"context_line":"\t}"},{"line_number":1750,"context_line":""},{"line_number":1751,"context_line":"\tif (CMD_ARGC !\u003d 2) {"},{"line_number":1752,"context_line":"\t\tLOG_ERROR(\"this command handles exactly two parameters\");"},{"line_number":1753,"context_line":"\t\treturn ERROR_COMMAND_SYNTAX_ERROR;"},{"line_number":1754,"context_line":"\t}"},{"line_number":1755,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":10,"id":"9e708a80_c26711ed","line":1752,"in_reply_to":"7253f246_d5e4e268","updated":"2021-12-23 17:04:15.000000000","message":"I see now, thanks for the explanation.","commit_id":"d5564a5b84b1d9b47a3e93c4d7c8d79d939f7e04"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"873cd770d6ab982654d9b1e6cd3195d60132c1dc","unresolved":true,"context_lines":[{"line_number":1809,"context_line":"\t}"},{"line_number":1810,"context_line":""},{"line_number":1811,"context_line":"\tif (CMD_ARGC !\u003d 1) {"},{"line_number":1812,"context_line":"\t\tLOG_ERROR(\"this command handles exactly two parameters\");"},{"line_number":1813,"context_line":"\t\treturn ERROR_COMMAND_SYNTAX_ERROR;"},{"line_number":1814,"context_line":"\t}"},{"line_number":1815,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":10,"id":"ca6b17e7_0c810b0b","line":1812,"updated":"2021-12-20 23:05:49.000000000","message":"same here!","commit_id":"d5564a5b84b1d9b47a3e93c4d7c8d79d939f7e04"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"0587e77aa481a3d33b19983042f0d7f71f84bb27","unresolved":false,"context_lines":[{"line_number":1809,"context_line":"\t}"},{"line_number":1810,"context_line":""},{"line_number":1811,"context_line":"\tif (CMD_ARGC !\u003d 1) {"},{"line_number":1812,"context_line":"\t\tLOG_ERROR(\"this command handles exactly two parameters\");"},{"line_number":1813,"context_line":"\t\treturn ERROR_COMMAND_SYNTAX_ERROR;"},{"line_number":1814,"context_line":"\t}"},{"line_number":1815,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":10,"id":"a5ccaff5_8b5ecca2","line":1812,"in_reply_to":"ca6b17e7_0c810b0b","updated":"2021-12-23 17:04:15.000000000","message":"Done","commit_id":"d5564a5b84b1d9b47a3e93c4d7c8d79d939f7e04"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"558ce554e5f9b488fd876e100bd40828f7a3f6de","unresolved":true,"context_lines":[{"line_number":171,"context_line":"\tLOG_DEBUG(\"op\u003d0x%x, param\u003d0x%\" PRIx64, semihosting-\u003eop,"},{"line_number":172,"context_line":"\t\tsemihosting-\u003eparam);"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"\t/* Check if it is a user defined operation */"},{"line_number":175,"context_line":"\tif (semihosting-\u003eop \u003e\u003d 0x100 \u0026\u0026 semihosting-\u003eop \u003c\u003d 0x107) {"},{"line_number":176,"context_line":"\t\t/*"},{"line_number":177,"context_line":"\t\t * Reads the user operation parameters from target, then stores in the"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"94e60bfd_5483a80c","line":174,"updated":"2021-12-28 17:23:40.000000000","message":"Please add something like:\n/* while user cmds 0x100-0x1ff are possible, only 0x100-0x107 are currently implemented */","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"d31385d521e5d4784feb966d89df18d6425c2ba3","unresolved":false,"context_lines":[{"line_number":171,"context_line":"\tLOG_DEBUG(\"op\u003d0x%x, param\u003d0x%\" PRIx64, semihosting-\u003eop,"},{"line_number":172,"context_line":"\t\tsemihosting-\u003eparam);"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"\t/* Check if it is a user defined operation */"},{"line_number":175,"context_line":"\tif (semihosting-\u003eop \u003e\u003d 0x100 \u0026\u0026 semihosting-\u003eop \u003c\u003d 0x107) {"},{"line_number":176,"context_line":"\t\t/*"},{"line_number":177,"context_line":"\t\t * Reads the user operation parameters from target, then stores in the"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"a5793a8d_46671f03","line":174,"in_reply_to":"94e60bfd_5483a80c","updated":"2022-01-04 18:12:07.000000000","message":"Ack","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"558ce554e5f9b488fd876e100bd40828f7a3f6de","unresolved":true,"context_lines":[{"line_number":172,"context_line":"\t\tsemihosting-\u003eparam);"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"\t/* Check if it is a user defined operation */"},{"line_number":175,"context_line":"\tif (semihosting-\u003eop \u003e\u003d 0x100 \u0026\u0026 semihosting-\u003eop \u003c\u003d 0x107) {"},{"line_number":176,"context_line":"\t\t/*"},{"line_number":177,"context_line":"\t\t * Reads the user operation parameters from target, then stores in the"},{"line_number":178,"context_line":"\t\t * semihosting object. Fires the corresponding target event. When the"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"fa7ec4a2_0d6b3209","line":175,"updated":"2021-12-28 17:23:40.000000000","message":"I never realized that in OpenOCD code we already use the GCC extension for switch/case (valid for clang compiler too):\nswitch (semihosting-\u003eop) {\n  case 0x100 ... 0x107:\nYou can find it is already used by running\ngrep -rn \u0027case.*\\.\\.\\..*:\u0027 src/\n\nIt becomes more \"natural\" including this code in the switch/case just below.\n\nDefine in \"enum semihosting_operation_numbers\" the macros:\nSEMIHOSTING_USER_CMD_0x100, SEMIHOSTING_USER_CMD_0x1FF and SEMIHOSTING_USER_CMD_0x107\nbut use only\n  case SEMIHOSTING_USER_CMD_0x100 ... SEMIHOSTING_USER_CMD_0x107:","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"d31385d521e5d4784feb966d89df18d6425c2ba3","unresolved":false,"context_lines":[{"line_number":172,"context_line":"\t\tsemihosting-\u003eparam);"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"\t/* Check if it is a user defined operation */"},{"line_number":175,"context_line":"\tif (semihosting-\u003eop \u003e\u003d 0x100 \u0026\u0026 semihosting-\u003eop \u003c\u003d 0x107) {"},{"line_number":176,"context_line":"\t\t/*"},{"line_number":177,"context_line":"\t\t * Reads the user operation parameters from target, then stores in the"},{"line_number":178,"context_line":"\t\t * semihosting object. Fires the corresponding target event. When the"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"bed1dabe_b8fce687","line":175,"in_reply_to":"fa7ec4a2_0d6b3209","updated":"2022-01-04 18:12:07.000000000","message":"Done","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"558ce554e5f9b488fd876e100bd40828f7a3f6de","unresolved":true,"context_lines":[{"line_number":217,"context_line":"\t\t\treturn retval;"},{"line_number":218,"context_line":"\t\t}"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"\t\tsemihosting-\u003euser_op_params \u003d strdup(cmd_pars);"},{"line_number":221,"context_line":"\t\ttarget_handle_event(target, semihosting-\u003eop);"},{"line_number":222,"context_line":"\t\tfree(semihosting-\u003euser_op_params);"},{"line_number":223,"context_line":"\t\tsemihosting-\u003euser_op_params \u003d NULL;"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"0856142a_20e3e3f2","line":220,"updated":"2021-12-28 17:23:40.000000000","message":"possible issue: the firmware passes len that does not include the zero-termination of the string. target_read_buffer() does not put the zero termination byte in cmd_pars[]. This strdup() fails to find the end of string and copies megabytes ...\nDeclare \"cmd_pars[len+1]\" and force \"cmd_pars[len]\u003d0;\"\nThis works either len includes the zero or not.\n\nYou assume the parameter is a string; it should be reported in the documentation. Maybe in future someone could be willing to improve this to pass a binary.\n\nOther point, why duplicating the string and free() it 2 lines below?\nCan be simply here\nsemihosting-\u003euser_op_params \u003d cmd_pars;\nand remove the free()?\n\nFurther point: No need to add the field user_op_params to struct semihosting.\nThis user_op_params can be a static variable declared at the beginning of this file. It is just set here and set again to NULL after the event handling.","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"d31385d521e5d4784feb966d89df18d6425c2ba3","unresolved":false,"context_lines":[{"line_number":217,"context_line":"\t\t\treturn retval;"},{"line_number":218,"context_line":"\t\t}"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"\t\tsemihosting-\u003euser_op_params \u003d strdup(cmd_pars);"},{"line_number":221,"context_line":"\t\ttarget_handle_event(target, semihosting-\u003eop);"},{"line_number":222,"context_line":"\t\tfree(semihosting-\u003euser_op_params);"},{"line_number":223,"context_line":"\t\tsemihosting-\u003euser_op_params \u003d NULL;"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"234f3d98_24f28d8b","line":220,"in_reply_to":"0856142a_20e3e3f2","updated":"2022-01-04 18:12:07.000000000","message":"Done","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"558ce554e5f9b488fd876e100bd40828f7a3f6de","unresolved":true,"context_lines":[{"line_number":1668,"context_line":"{"},{"line_number":1669,"context_line":"\tstruct target *target \u003d get_current_target(CMD_CTX);"},{"line_number":1670,"context_line":"\tstruct semihosting *semihosting \u003d target-\u003esemihosting;"},{"line_number":1671,"context_line":""},{"line_number":1672,"context_line":"\tif (!semihosting-\u003eis_active) {"},{"line_number":1673,"context_line":"\t\tLOG_ERROR(\"semihosting not yet enabled for current target\");"},{"line_number":1674,"context_line":"\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"624ebbdc_1d13b748","line":1671,"updated":"2021-12-28 17:23:40.000000000","message":"Please also add the check for no-arguments:\nif (CMD_ARGC)\n   return ERROR_COMMAND_SYNTAX_ERROR;","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"d31385d521e5d4784feb966d89df18d6425c2ba3","unresolved":false,"context_lines":[{"line_number":1668,"context_line":"{"},{"line_number":1669,"context_line":"\tstruct target *target \u003d get_current_target(CMD_CTX);"},{"line_number":1670,"context_line":"\tstruct semihosting *semihosting \u003d target-\u003esemihosting;"},{"line_number":1671,"context_line":""},{"line_number":1672,"context_line":"\tif (!semihosting-\u003eis_active) {"},{"line_number":1673,"context_line":"\t\tLOG_ERROR(\"semihosting not yet enabled for current target\");"},{"line_number":1674,"context_line":"\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"d34fed40_4736318e","line":1671,"in_reply_to":"624ebbdc_1d13b748","updated":"2022-01-04 18:12:07.000000000","message":"Done","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"283504173096e9dc7108e8d558887c3f2fbd53fa","unresolved":true,"context_lines":[{"line_number":210,"context_line":""},{"line_number":211,"context_line":"\t\t\tsemihosting-\u003eresult \u003d delta / (CLOCKS_PER_SEC / 100);"},{"line_number":212,"context_line":"\t\t}"},{"line_number":213,"context_line":"\t\t\tbreak;"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"\t\tcase SEMIHOSTING_SYS_CLOSE:\t/* 0x02 */"},{"line_number":216,"context_line":"\t\t\t/*"}],"source_content_type":"text/x-csrc","patch_set":14,"id":"2d8144f3_f1f02d14","line":213,"updated":"2022-01-26 16:08:30.000000000","message":"I haven\u0027t noticed this before. This change breaks the indentation, please revert it.","commit_id":"93bc0ab3f0f47a7a7a20f8cafc458989d15f15db"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"adc534da64b031b65c5e13a0e323c22e83441ce9","unresolved":false,"context_lines":[{"line_number":210,"context_line":""},{"line_number":211,"context_line":"\t\t\tsemihosting-\u003eresult \u003d delta / (CLOCKS_PER_SEC / 100);"},{"line_number":212,"context_line":"\t\t}"},{"line_number":213,"context_line":"\t\t\tbreak;"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"\t\tcase SEMIHOSTING_SYS_CLOSE:\t/* 0x02 */"},{"line_number":216,"context_line":"\t\t\t/*"}],"source_content_type":"text/x-csrc","patch_set":14,"id":"55709691_f8bd23fa","line":213,"in_reply_to":"2d8144f3_f1f02d14","updated":"2022-01-26 19:04:21.000000000","message":"I did it, but as I see in every other case the brake has a greater indentation than its case.","commit_id":"93bc0ab3f0f47a7a7a20f8cafc458989d15f15db"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"283504173096e9dc7108e8d558887c3f2fbd53fa","unresolved":true,"context_lines":[{"line_number":1319,"context_line":"\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":1320,"context_line":"\t\t\t\tLOG_ERROR(\"Failed to read from target, semihosting op\u003d0x%x\","},{"line_number":1321,"context_line":"\t\t\t\t\t\tsemihosting-\u003eop);"},{"line_number":1322,"context_line":"\t\t\t\treturn retval;"},{"line_number":1323,"context_line":"\t\t\t}"},{"line_number":1324,"context_line":""},{"line_number":1325,"context_line":"\t\t\ttarget_handle_event(target, semihosting-\u003eop);"}],"source_content_type":"text/x-csrc","patch_set":14,"id":"5422870c_0ef7bd58","line":1322,"updated":"2022-01-26 16:08:30.000000000","message":"Memory leak. Before return with error,\nfree(semihosting_user_op_params);\nsemihosting_user_op_params \u003d NULL;\nDon\u0027t know if you also need:\nsemihosting-\u003eresult \u003d 0;","commit_id":"93bc0ab3f0f47a7a7a20f8cafc458989d15f15db"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"adc534da64b031b65c5e13a0e323c22e83441ce9","unresolved":false,"context_lines":[{"line_number":1319,"context_line":"\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":1320,"context_line":"\t\t\t\tLOG_ERROR(\"Failed to read from target, semihosting op\u003d0x%x\","},{"line_number":1321,"context_line":"\t\t\t\t\t\tsemihosting-\u003eop);"},{"line_number":1322,"context_line":"\t\t\t\treturn retval;"},{"line_number":1323,"context_line":"\t\t\t}"},{"line_number":1324,"context_line":""},{"line_number":1325,"context_line":"\t\t\ttarget_handle_event(target, semihosting-\u003eop);"}],"source_content_type":"text/x-csrc","patch_set":14,"id":"f73223f5_485ae96d","line":1322,"in_reply_to":"5422870c_0ef7bd58","updated":"2022-01-26 19:04:21.000000000","message":"True! I think the -1 for semihosting-\u003eresult is accurate, to indicate there was an error.","commit_id":"93bc0ab3f0f47a7a7a20f8cafc458989d15f15db"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"5c57aaec41bf0ccec9a888e66693344eb5e74f0a","unresolved":false,"context_lines":[{"line_number":1319,"context_line":"\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":1320,"context_line":"\t\t\t\tLOG_ERROR(\"Failed to read from target, semihosting op\u003d0x%x\","},{"line_number":1321,"context_line":"\t\t\t\t\t\tsemihosting-\u003eop);"},{"line_number":1322,"context_line":"\t\t\t\treturn retval;"},{"line_number":1323,"context_line":"\t\t\t}"},{"line_number":1324,"context_line":""},{"line_number":1325,"context_line":"\t\t\ttarget_handle_event(target, semihosting-\u003eop);"}],"source_content_type":"text/x-csrc","patch_set":14,"id":"9a432eaf_b855794d","line":1322,"in_reply_to":"f73223f5_485ae96d","updated":"2022-01-26 21:59:56.000000000","message":"You are right! I haven\u0027t seen it is already initialized at line 166.","commit_id":"93bc0ab3f0f47a7a7a20f8cafc458989d15f15db"}],"src/target/semihosting_common.h":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"873cd770d6ab982654d9b1e6cd3195d60132c1dc","unresolved":true,"context_lines":[{"line_number":77,"context_line":"\tSEMIHOSTING_SYS_WRITE0 \u003d 0x04,"},{"line_number":78,"context_line":"};"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"/** Maxmium allowed Tcl command segment length in bytes*/"},{"line_number":81,"context_line":"#define SEMIHOSTING_MAX_TCL_COMMAND_FIELD_LENGTH 512"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"/*"}],"source_content_type":"text/x-csrc","patch_set":10,"id":"1b5913bd_34b01ed0","line":80,"updated":"2021-12-20 23:05:49.000000000","message":"missed this typo: Maximum","commit_id":"d5564a5b84b1d9b47a3e93c4d7c8d79d939f7e04"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"0587e77aa481a3d33b19983042f0d7f71f84bb27","unresolved":false,"context_lines":[{"line_number":77,"context_line":"\tSEMIHOSTING_SYS_WRITE0 \u003d 0x04,"},{"line_number":78,"context_line":"};"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"/** Maxmium allowed Tcl command segment length in bytes*/"},{"line_number":81,"context_line":"#define SEMIHOSTING_MAX_TCL_COMMAND_FIELD_LENGTH 512"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"/*"}],"source_content_type":"text/x-csrc","patch_set":10,"id":"88f65aeb_8e73523a","line":80,"in_reply_to":"1b5913bd_34b01ed0","updated":"2021-12-23 17:04:15.000000000","message":"Done","commit_id":"d5564a5b84b1d9b47a3e93c4d7c8d79d939f7e04"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"558ce554e5f9b488fd876e100bd40828f7a3f6de","unresolved":true,"context_lines":[{"line_number":78,"context_line":"};"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"/** Maximum allowed Tcl command segment length in bytes*/"},{"line_number":81,"context_line":"#define SEMIHOSTING_MAX_TCL_COMMAND_FIELD_LENGTH 512"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"/*"},{"line_number":84,"context_line":" * Codes used by SEMIHOSTING_SYS_EXIT (formerly"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"4bacc60e_b4ceadde","line":81,"updated":"2021-12-28 17:23:40.000000000","message":"where this limit comes from? from TCL? from ARM semihosting document?","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"adc534da64b031b65c5e13a0e323c22e83441ce9","unresolved":false,"context_lines":[{"line_number":78,"context_line":"};"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"/** Maximum allowed Tcl command segment length in bytes*/"},{"line_number":81,"context_line":"#define SEMIHOSTING_MAX_TCL_COMMAND_FIELD_LENGTH 512"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"/*"},{"line_number":84,"context_line":" * Codes used by SEMIHOSTING_SYS_EXIT (formerly"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"217d2e4d_cf3b2f36","line":81,"in_reply_to":"037bdeea_01dd7d4c","updated":"2022-01-26 19:04:21.000000000","message":"Done","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"d31385d521e5d4784feb966d89df18d6425c2ba3","unresolved":true,"context_lines":[{"line_number":78,"context_line":"};"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"/** Maximum allowed Tcl command segment length in bytes*/"},{"line_number":81,"context_line":"#define SEMIHOSTING_MAX_TCL_COMMAND_FIELD_LENGTH 512"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"/*"},{"line_number":84,"context_line":" * Codes used by SEMIHOSTING_SYS_EXIT (formerly"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"037bdeea_01dd7d4c","line":81,"in_reply_to":"4bacc60e_b4ceadde","updated":"2022-01-04 18:12:07.000000000","message":"This is an artificial limit that prevents erroneous allocations. I\u0027ve raised the limit to a sane one.","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"}],"src/target/target.h":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"558ce554e5f9b488fd876e100bd40828f7a3f6de","unresolved":true,"context_lines":[{"line_number":295,"context_line":""},{"line_number":296,"context_line":"\tTARGET_EVENT_TRACE_CONFIG,"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"\tTARGET_EVENT_SEMIHOSTING_USER_CMD_0x100 \u003d 0x100,"},{"line_number":299,"context_line":"\tTARGET_EVENT_SEMIHOSTING_USER_CMD_0x101 \u003d 0x101,"},{"line_number":300,"context_line":"\tTARGET_EVENT_SEMIHOSTING_USER_CMD_0x102 \u003d 0x102,"},{"line_number":301,"context_line":"\tTARGET_EVENT_SEMIHOSTING_USER_CMD_0x103 \u003d 0x103,"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"99a7033e_5ffa7581","line":298,"updated":"2021-12-28 17:23:40.000000000","message":"could be useful adding a comment like\n/* semihosting allows user cmds till 0x1ff */","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"},{"author":{"_account_id":1001939,"name":"zedudi","display_name":"Zoltán Dudás","email":"zedudi@gmail.com","username":"zedudi"},"change_message_id":"d31385d521e5d4784feb966d89df18d6425c2ba3","unresolved":false,"context_lines":[{"line_number":295,"context_line":""},{"line_number":296,"context_line":"\tTARGET_EVENT_TRACE_CONFIG,"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"\tTARGET_EVENT_SEMIHOSTING_USER_CMD_0x100 \u003d 0x100,"},{"line_number":299,"context_line":"\tTARGET_EVENT_SEMIHOSTING_USER_CMD_0x101 \u003d 0x101,"},{"line_number":300,"context_line":"\tTARGET_EVENT_SEMIHOSTING_USER_CMD_0x102 \u003d 0x102,"},{"line_number":301,"context_line":"\tTARGET_EVENT_SEMIHOSTING_USER_CMD_0x103 \u003d 0x103,"}],"source_content_type":"text/x-csrc","patch_set":11,"id":"d2200bfc_e7500458","line":298,"in_reply_to":"99a7033e_5ffa7581","updated":"2022-01-04 18:12:07.000000000","message":"Done","commit_id":"b249400429dfa32df02e6c8a1affecc6618126e3"}]}
