)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b93fa5749fb1bcab156f5faf3948dcce2d42df95","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"6215aaa1_d7183a65","updated":"2023-05-30 22:10:19.000000000","message":"I have added Erhan that could be interested in extending this for expressif","commit_id":"72418f26693fc96446c06c4923585d74e3f84a79"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"173ce9cf6940b33064cc51f3c6db07b58eb04ed4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"3e1e8464_fd499239","updated":"2023-06-18 22:55:41.000000000","message":"ok for me. Tarek, do you agree?","commit_id":"834be26d51af45dc940d8ea8e65be34c58d5719f"}],"src/target/semihosting_common.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b93fa5749fb1bcab156f5faf3948dcce2d42df95","unresolved":true,"context_lines":[{"line_number":294,"context_line":" */"},{"line_number":295,"context_line":"static char *semihosting_user_op_params;"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"const char *semihosting_opcode_to_str(const uint64_t opcode)"},{"line_number":298,"context_line":"{"},{"line_number":299,"context_line":"\tswitch (opcode) {"},{"line_number":300,"context_line":"\t\tcase SEMIHOSTING_SYS_CLOSE:"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"ef5226b3_ace9633f","line":297,"updated":"2023-05-30 22:10:19.000000000","message":"Why you export it through the .h if it\u0027s only used locally in this file?\nShould it be \"static\"?","commit_id":"72418f26693fc96446c06c4923585d74e3f84a79"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"173ce9cf6940b33064cc51f3c6db07b58eb04ed4","unresolved":false,"context_lines":[{"line_number":294,"context_line":" */"},{"line_number":295,"context_line":"static char *semihosting_user_op_params;"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"const char *semihosting_opcode_to_str(const uint64_t opcode)"},{"line_number":298,"context_line":"{"},{"line_number":299,"context_line":"\tswitch (opcode) {"},{"line_number":300,"context_line":"\t\tcase SEMIHOSTING_SYS_CLOSE:"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"8d77d155_523944b6","line":297,"in_reply_to":"bc340315_cee792da","updated":"2023-06-18 22:55:41.000000000","message":"ok, then.\nBut I often run a search for exported symbols that are not use outside the file.\nDon\u0027t wait too long to reuse this function, or I will forget this discussione and drop it.","commit_id":"72418f26693fc96446c06c4923585d74e3f84a79"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"5f89ead8c23428970fbf63355b689f3aa1916e51","unresolved":false,"context_lines":[{"line_number":294,"context_line":" */"},{"line_number":295,"context_line":"static char *semihosting_user_op_params;"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"const char *semihosting_opcode_to_str(const uint64_t opcode)"},{"line_number":298,"context_line":"{"},{"line_number":299,"context_line":"\tswitch (opcode) {"},{"line_number":300,"context_line":"\t\tcase SEMIHOSTING_SYS_CLOSE:"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"bc340315_cee792da","line":297,"in_reply_to":"ef5226b3_ace9633f","updated":"2023-05-31 05:32:25.000000000","message":"We have discussed that very same point with Marek internally :) We\u0027d like to later use the function in the \"riscv\" target, hence it is made available also outside of this module. \n\nI am marking this as \"resolved\", but please feel free to re-open if you have different opinion on this.","commit_id":"72418f26693fc96446c06c4923585d74e3f84a79"},{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"033fed2afc1ec1b66996dc57b7b9ce256bb1d8fb","unresolved":true,"context_lines":[{"line_number":346,"context_line":"\t\tcase SEMIHOSTING_SYS_WRITE0:"},{"line_number":347,"context_line":"\t\t\treturn \"WRITE0\";"},{"line_number":348,"context_line":"\t\tcase SEMIHOSTING_USER_CMD_0X100 ... SEMIHOSTING_USER_CMD_0X1FF:"},{"line_number":349,"context_line":"\t\t\treturn \"USER_CMD\";"},{"line_number":350,"context_line":"\t\tdefault:"},{"line_number":351,"context_line":"\t\t\treturn \"\u003cunknown\u003e\";"},{"line_number":352,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"a5c6be42_319b04ac","line":349,"updated":"2023-05-30 19:49:10.000000000","message":"here you lose precision on which user command\nI prefer that precise the user cmd opcode, sthg like USER_CMD_0x101","commit_id":"72418f26693fc96446c06c4923585d74e3f84a79"},{"author":{"_account_id":1002143,"name":"Marek Vrbka","email":"marek.vrbka@codasip.com","username":"MarekVCodasip"},"change_message_id":"f809c1e894cfbfbb3f0babe832589e3a982f6835","unresolved":true,"context_lines":[{"line_number":346,"context_line":"\t\tcase SEMIHOSTING_SYS_WRITE0:"},{"line_number":347,"context_line":"\t\t\treturn \"WRITE0\";"},{"line_number":348,"context_line":"\t\tcase SEMIHOSTING_USER_CMD_0X100 ... SEMIHOSTING_USER_CMD_0X1FF:"},{"line_number":349,"context_line":"\t\t\treturn \"USER_CMD\";"},{"line_number":350,"context_line":"\t\tdefault:"},{"line_number":351,"context_line":"\t\t\treturn \"\u003cunknown\u003e\";"},{"line_number":352,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"b6d165f9_73acdb1a","line":349,"in_reply_to":"51dd6e4a_ffef04a0","updated":"2023-05-31 07:16:33.000000000","message":"I thought among the same lines when implementing it. There are also two more cases where the opcode is printed in the semihosting_common.c, but those directly mention that it is a user command.\n\nAlso, thanks for the quick reviews.","commit_id":"72418f26693fc96446c06c4923585d74e3f84a79"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b93fa5749fb1bcab156f5faf3948dcce2d42df95","unresolved":true,"context_lines":[{"line_number":346,"context_line":"\t\tcase SEMIHOSTING_SYS_WRITE0:"},{"line_number":347,"context_line":"\t\t\treturn \"WRITE0\";"},{"line_number":348,"context_line":"\t\tcase SEMIHOSTING_USER_CMD_0X100 ... SEMIHOSTING_USER_CMD_0X1FF:"},{"line_number":349,"context_line":"\t\t\treturn \"USER_CMD\";"},{"line_number":350,"context_line":"\t\tdefault:"},{"line_number":351,"context_line":"\t\t\treturn \"\u003cunknown\u003e\";"},{"line_number":352,"context_line":"\t}"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"51dd6e4a_ffef04a0","line":349,"in_reply_to":"a5c6be42_319b04ac","updated":"2023-05-30 22:10:19.000000000","message":"It is always printed with \"op\u003d0x%x (%s)\", so it would be printed\nop\u003d0x101 (USER_CMD)\nthat doesn\u0027t look that bad.","commit_id":"72418f26693fc96446c06c4923585d74e3f84a79"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"5f89ead8c23428970fbf63355b689f3aa1916e51","unresolved":true,"context_lines":[{"line_number":348,"context_line":"\t\tcase SEMIHOSTING_USER_CMD_0X100 ... SEMIHOSTING_USER_CMD_0X1FF:"},{"line_number":349,"context_line":"\t\t\treturn \"USER_CMD\";"},{"line_number":350,"context_line":"\t\tdefault:"},{"line_number":351,"context_line":"\t\t\treturn \"\u003cunknown\u003e\";"},{"line_number":352,"context_line":"\t}"},{"line_number":353,"context_line":"}"},{"line_number":354,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":1,"id":"bf327bff_71853bf9","line":351,"updated":"2023-05-31 05:32:25.000000000","message":"In the switch, we can cover also this range of opcodes (per https://developer.arm.com/documentation/dui0471/i/semihosting/the-semihosting-interface?lang\u003den):\n\n```\ncase SEMIHOSTING_ARM_RESERVED_START ... SEMIHOSTING_ARM_RESERVED_END: // 0x32 .. 0xFF\n\treturn \"ARM_RESERVED_CMD\";\n```","commit_id":"72418f26693fc96446c06c4923585d74e3f84a79"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b93fa5749fb1bcab156f5faf3948dcce2d42df95","unresolved":true,"context_lines":[{"line_number":348,"context_line":"\t\tcase SEMIHOSTING_USER_CMD_0X100 ... SEMIHOSTING_USER_CMD_0X1FF:"},{"line_number":349,"context_line":"\t\t\treturn \"USER_CMD\";"},{"line_number":350,"context_line":"\t\tdefault:"},{"line_number":351,"context_line":"\t\t\treturn \"\u003cunknown\u003e\";"},{"line_number":352,"context_line":"\t}"},{"line_number":353,"context_line":"}"},{"line_number":354,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":1,"id":"85b312f3_5b5d601b","line":351,"updated":"2023-05-30 22:10:19.000000000","message":"we have target extensions of semihosting and it would be nice to have them printed too. See\nhttps://review.openocd.org/6889\nhttps://review.openocd.org/7074\nThe only extension list, so far, is in src/target/espressif/esp_semihosting.h for espressif\nMaybe we need to add, in parallel to target-\u003esemihosting-\u003euser_command_extension\na new target-\u003esemihosting-\u003euser_command_ext_opcode_to_str ?","commit_id":"72418f26693fc96446c06c4923585d74e3f84a79"},{"author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"change_message_id":"5f89ead8c23428970fbf63355b689f3aa1916e51","unresolved":true,"context_lines":[{"line_number":348,"context_line":"\t\tcase SEMIHOSTING_USER_CMD_0X100 ... SEMIHOSTING_USER_CMD_0X1FF:"},{"line_number":349,"context_line":"\t\t\treturn \"USER_CMD\";"},{"line_number":350,"context_line":"\t\tdefault:"},{"line_number":351,"context_line":"\t\t\treturn \"\u003cunknown\u003e\";"},{"line_number":352,"context_line":"\t}"},{"line_number":353,"context_line":"}"},{"line_number":354,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":1,"id":"fd35fe7b_ac176b05","line":351,"in_reply_to":"85b312f3_5b5d601b","updated":"2023-05-31 05:32:25.000000000","message":"My recommendation would be to not extend the semihosting struct with a new callback just to convert the semihosting opcode to a string -- to keep things simple. \n\nIdentifying the custom opcode as USER_CMD in the log seems good enough to me. The target can print any details of the custom operations (name of the operation, parameters, and any additional info) while it is handling it.","commit_id":"72418f26693fc96446c06c4923585d74e3f84a79"},{"author":{"_account_id":1002143,"name":"Marek Vrbka","email":"marek.vrbka@codasip.com","username":"MarekVCodasip"},"change_message_id":"f809c1e894cfbfbb3f0babe832589e3a982f6835","unresolved":false,"context_lines":[{"line_number":348,"context_line":"\t\tcase SEMIHOSTING_USER_CMD_0X100 ... SEMIHOSTING_USER_CMD_0X1FF:"},{"line_number":349,"context_line":"\t\t\treturn \"USER_CMD\";"},{"line_number":350,"context_line":"\t\tdefault:"},{"line_number":351,"context_line":"\t\t\treturn \"\u003cunknown\u003e\";"},{"line_number":352,"context_line":"\t}"},{"line_number":353,"context_line":"}"},{"line_number":354,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":1,"id":"bae3dfd2_3af6e726","line":351,"in_reply_to":"bf327bff_71853bf9","updated":"2023-05-31 07:16:33.000000000","message":"Done","commit_id":"72418f26693fc96446c06c4923585d74e3f84a79"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"173ce9cf6940b33064cc51f3c6db07b58eb04ed4","unresolved":false,"context_lines":[{"line_number":348,"context_line":"\t\tcase SEMIHOSTING_USER_CMD_0X100 ... SEMIHOSTING_USER_CMD_0X1FF:"},{"line_number":349,"context_line":"\t\t\treturn \"USER_CMD\";"},{"line_number":350,"context_line":"\t\tdefault:"},{"line_number":351,"context_line":"\t\t\treturn \"\u003cunknown\u003e\";"},{"line_number":352,"context_line":"\t}"},{"line_number":353,"context_line":"}"},{"line_number":354,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":1,"id":"fe7a6fbf_548d4219","line":351,"in_reply_to":"fd35fe7b_ac176b05","updated":"2023-06-18 22:55:41.000000000","message":"ok","commit_id":"72418f26693fc96446c06c4923585d74e3f84a79"}]}
