)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"7fdd74b8a4d159eb67cf0d1a4bbcfc7f5e801e5f","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Marc Schink \u003cdev@zapb.de\u003e"},{"line_number":5,"context_line":"CommitDate: 2023-03-19 13:22:39 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"arget/arm_adi_v5: Fix integer underflow and segfault"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When reading from memory fails, the current code returns to the caller"},{"line_number":10,"context_line":"the successfully read data. However, this code fails if the memory"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"415a855c_61a6b5be","line":7,"updated":"2023-03-19 14:37:03.000000000","message":"t?","commit_id":"117b5a8f843a1dc1531c4613cded21a6bf9f02c3"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"6370005c46c5688c23fff5e7d8f18c377b4135da","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Marc Schink \u003cdev@zapb.de\u003e"},{"line_number":5,"context_line":"CommitDate: 2023-03-19 13:22:39 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"arget/arm_adi_v5: Fix integer underflow and segfault"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When reading from memory fails, the current code returns to the caller"},{"line_number":10,"context_line":"the successfully read data. However, this code fails if the memory"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"c57e8ee9_1ceb0de5","line":7,"in_reply_to":"415a855c_61a6b5be","updated":"2023-03-19 17:58:16.000000000","message":"Done","commit_id":"117b5a8f843a1dc1531c4613cded21a6bf9f02c3"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"7fdd74b8a4d159eb67cf0d1a4bbcfc7f5e801e5f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"a5ff033d_63375c30","updated":"2023-03-19 14:37:03.000000000","message":"Good catch indeed!","commit_id":"117b5a8f843a1dc1531c4613cded21a6bf9f02c3"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"e6420c4baa343eae8ffa62215b8b6280f015a088","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"6d5db81a_381e8aa1","updated":"2023-03-30 15:12:10.000000000","message":"Marc,\nI analysed little bit more the partial data return in case of error.\nNow I think we can drop this feature. What do you think?","commit_id":"78635725c0202d2399b0fe5d0220966cf6deb6af"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b88fe871d2259d73c4179aa5a4eeb1ef388dcbbf","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"d6f4ab43_f04a8e50","in_reply_to":"507cd82d_f3d65764","updated":"2023-04-10 13:45:55.000000000","message":"No objections. It\u0027s broken and not used. If someone starts using it, will consider adding a clean implementation.","commit_id":"78635725c0202d2399b0fe5d0220966cf6deb6af"},{"author":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"94e45a4cfb26cd89001f0714dce05638f350f2bd","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"507cd82d_f3d65764","in_reply_to":"6d5db81a_381e8aa1","updated":"2023-04-09 13:40:02.000000000","message":"I agree, I don\u0027t see a use case for returning partial data in case of an error. In this case I will adapt the patch and remove the feature. Okay?\n\n@Antonio: any objections from your side?","commit_id":"78635725c0202d2399b0fe5d0220966cf6deb6af"}],"src/target/arm_adi_v5.c":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"e6420c4baa343eae8ffa62215b8b6280f015a088","unresolved":true,"context_lines":[{"line_number":554,"context_line":"\t}"},{"line_number":555,"context_line":""},{"line_number":556,"context_line":"\tif (retval \u003d\u003d ERROR_OK)"},{"line_number":557,"context_line":"\t\tretval \u003d dap_run(dap);"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"\t/* Restore state */"},{"line_number":560,"context_line":"\taddress \u003d adr;"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"1a29063d_f279caee","line":557,"updated":"2023-03-30 15:12:10.000000000","message":"The error returned here most probably happened in data read but there is also a small probability of a random communication error in setting TAR or before it - in this case the later reading TAR does not give any clue where the error happened.","commit_id":"78635725c0202d2399b0fe5d0220966cf6deb6af"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"e6420c4baa343eae8ffa62215b8b6280f015a088","unresolved":true,"context_lines":[{"line_number":568,"context_line":"\t\tif (mem_ap_read_tar(ap, \u0026tar) \u003d\u003d ERROR_OK) {"},{"line_number":569,"context_line":"\t\t\t/* TAR is incremented after failed transfer on some devices (eg Cortex-M4) */"},{"line_number":570,"context_line":"\t\t\tLOG_ERROR(\"Failed to read memory at \" TARGET_ADDR_FMT, tar);"},{"line_number":571,"context_line":"\t\t\tif (nbytes \u003e tar - address)"},{"line_number":572,"context_line":"\t\t\t\tnbytes \u003d ALIGN_DOWN(tar - address, size);"},{"line_number":573,"context_line":"\t\t} else {"},{"line_number":574,"context_line":"\t\t\tLOG_ERROR(\"Failed to read memory and, additionally, failed to find out where\");"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"5344d37a_99fcded5","line":571,"updated":"2023-03-30 15:12:10.000000000","message":"Anyway I\u0027m not aware of any caller which consumes the returned data in the case of error - the caller has no information how many bytes/words was read before the read failed. Considering this we should not bother with the partial data return, just show TAR value for user convenience and set nbytes \u003d 0 in case of any error.","commit_id":"78635725c0202d2399b0fe5d0220966cf6deb6af"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"e6420c4baa343eae8ffa62215b8b6280f015a088","unresolved":true,"context_lines":[{"line_number":580,"context_line":"\twhile (nbytes \u003e 0) {"},{"line_number":581,"context_line":"\t\tuint32_t this_size \u003d size;"},{"line_number":582,"context_line":""},{"line_number":583,"context_line":"\t\tif (addrinc \u0026\u0026 ap-\u003epacked_transfers \u0026\u0026 nbytes \u003e\u003d 4"},{"line_number":584,"context_line":"\t\t\t\t\u0026\u0026 max_tar_block_size(ap-\u003etar_autoincr_block, address) \u003e\u003d 4) {"},{"line_number":585,"context_line":"\t\t\tthis_size \u003d 4;"},{"line_number":586,"context_line":"\t\t}"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"532f1af7_e7a27735","line":583,"range":{"start_line":583,"start_character":41,"end_line":583,"end_character":52},"updated":"2023-03-30 15:12:10.000000000","message":"Decreasing nbytes according to TAR value may force reading the last up to 3 bytes/1 halfword before the error as if they were not packed, resulting in getting wrong values from (probably uninitialized) buffer instead of returning the last reads before the error. We should keep packed/unpacked logic intact.","commit_id":"78635725c0202d2399b0fe5d0220966cf6deb6af"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"cbff3c37938523fa53cd7008f866f63e89134f8b","unresolved":true,"context_lines":[{"line_number":558,"context_line":""},{"line_number":559,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":560,"context_line":"\t\tLOG_ERROR(\"Failed to read memory at \" TARGET_ADDR_FMT, address);"},{"line_number":561,"context_line":"\t\tfree(read_buf);"},{"line_number":562,"context_line":"\t\treturn retval;"},{"line_number":563,"context_line":"\t}"},{"line_number":564,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":4,"id":"1de01ab1_4b83c4e5","line":561,"updated":"2023-11-07 10:41:06.000000000","message":"I wrote some time ago:\n\n\u003e we should not bother with the partial data return, just show TAR value\n\u003e for user convenience ...\n\nWe can discuss if the message should go only to LOG_DEBUG or LOG_INFO\nI\u0027d like to keep this info for sake of easier fault diagnostic.","commit_id":"609143643e54d6536ff61e5827a7c55b3e294685"}]}
