)]}'
{"id":"openocd~master~I12aa6e202bf12bedcbb888ab595751a2a2518a24","project":"openocd","branch":"master","attention_set":{},"removed_from_attention_set":{"1000853":{"account":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"last_update":"2023-01-11 17:02:25.000000000","reason":"Change was submitted"},"1000021":{"account":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"last_update":"2023-01-02 14:44:26.000000000","reason":"Antonio Borneo replied on the change"},"1002107":{"account":{"_account_id":1002107,"name":"Marcin Niestroj","email":"m.niestroj@emb.dev","username":"mniestroj"},"last_update":"2023-01-11 17:02:25.000000000","reason":"Change was submitted"}},"hashtags":[],"change_id":"I12aa6e202bf12bedcbb888ab595751a2a2518a24","subject":"rtt: fix corner-cases of finding control block","status":"MERGED","created":"2023-01-02 08:00:03.000000000","updated":"2023-01-11 17:02:25.000000000","submitted":"2023-01-11 17:02:25.000000000","submitter":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"total_comment_count":4,"unresolved_comment_count":1,"has_review_started":true,"submission_id":"7429","meta_rev_id":"9855f3b33b80b1b6f18f5903d539afbda4eaf0c2","_number":7429,"owner":{"_account_id":1002107,"name":"Marcin Niestroj","email":"m.niestroj@emb.dev","username":"mniestroj"},"actions":{},"labels":{"Verified":{"approved":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"all":[{"value":0,"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"tag":"autogenerated:gerrit:merged","value":1,"date":"2023-01-11 17:02:25.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}],"values":{"-1":"Fails"," 0":"No score","+1":"Verified"},"description":"","default_value":0},"Code-Review":{"approved":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"all":[{"tag":"autogenerated:gerrit:merged","value":2,"date":"2023-01-11 17:02:25.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"value":0,"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}],"values":{"-2":"This shall not be merged","-1":"I would prefer this is not merged as is"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me, approved"},"description":"","default_value":0}},"removable_reviewers":[{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"}],"reviewers":{"REVIEWER":[{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2023-01-02 08:57:13.000000000","updated_by":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"reviewer":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"state":"REVIEWER"},{"updated":"2023-01-02 13:51:50.000000000","updated_by":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"reviewer":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"state":"CC"},{"updated":"2023-01-02 13:53:44.000000000","updated_by":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"reviewer":{"_account_id":1000853,"name":"zapb","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"state":"REVIEWER"},{"updated":"2023-01-02 14:44:26.000000000","updated_by":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"reviewer":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"state":"REVIEWER"}],"messages":[{"id":"f01a7067c867c616a9494ae86fdfec7bdc12f521","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1002107,"name":"Marcin Niestroj","email":"m.niestroj@emb.dev","username":"mniestroj"},"real_author":{"_account_id":1002107,"name":"Marcin Niestroj","email":"m.niestroj@emb.dev","username":"mniestroj"},"date":"2023-01-02 08:00:03.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"2072409bbc9aa8d906b170fc6df3ee633e45c29e","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2023-01-02 08:57:13.000000000","message":"Patch Set 1: Verified+1\n\nBuild Successful \n\nhttps://build.openocd.org/job/openocd-gerrit/17282/ : SUCCESS\n\nhttps://build.openocd.org/job/openocd-gerrit-build/16484/ : SUCCESS","accounts_in_message":[],"_revision_number":1},{"id":"45703de60c20e7d7435d5816523d234e79a39290","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2023-01-02 13:51:50.000000000","message":"Patch Set 1:\n\n(1 comment)","accounts_in_message":[],"_revision_number":1},{"id":"e433caf546ff292f7883f116b284bfbb0b3351af","author":{"_account_id":1002107,"name":"Marcin Niestroj","email":"m.niestroj@emb.dev","username":"mniestroj"},"real_author":{"_account_id":1002107,"name":"Marcin Niestroj","email":"m.niestroj@emb.dev","username":"mniestroj"},"date":"2023-01-02 14:14:12.000000000","message":"Patch Set 1:\n\n(1 comment)","accounts_in_message":[],"_revision_number":1},{"id":"100b1dccfee00e64087d7a75b05c954a163702c2","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2023-01-02 14:44:26.000000000","message":"Patch Set 1: Code-Review+1\n\n(2 comments)","accounts_in_message":[],"_revision_number":1},{"id":"2abf64b9286faeead7b1abc6e8a385fb338cb893","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2023-01-11 17:02:12.000000000","message":"Patch Set 1: Code-Review+2","accounts_in_message":[],"_revision_number":1},{"id":"9855f3b33b80b1b6f18f5903d539afbda4eaf0c2","tag":"autogenerated:gerrit:merged","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2023-01-11 17:02:25.000000000","message":"Change has been successfully cherry-picked as 7dd5b6a4645cf0ce9c635a7fc8b140575385c827","accounts_in_message":[],"_revision_number":2}],"current_revision":"7dd5b6a4645cf0ce9c635a7fc8b140575385c827","revisions":{"7dd5b6a4645cf0ce9c635a7fc8b140575385c827":{"kind":"NO_CODE_CHANGE","_number":2,"created":"2023-01-11 17:02:25.000000000","uploader":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"ref":"refs/changes/29/7429/2","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/29/7429/2","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/29/7429/2 \u0026\u0026 git checkout -b change-7429 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/29/7429/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/29/7429/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/29/7429/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/29/7429/2","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/29/7429/2 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"dfe57baa16cdbc0dc2ae7182b5b3831028637223","subject":"Restore +dev suffix"}],"author":{"name":"Marcin Niestroj","email":"m.niestroj@emb.dev","date":"2023-01-02 07:04:06.000000000","tz":60},"committer":{"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","date":"2023-01-11 17:02:25.000000000","tz":0},"subject":"rtt: fix corner-cases of finding control block","message":"rtt: fix corner-cases of finding control block\n\nThis patch fixes two corner-cases of finding RTT control block.\n\nThe first one is when there was a partial match (even single byte) at\nthe end of loaded buffer (uint8_t buf[1024]), but this was not part of\nfull match. In that case `cb_offset` was not updated correctly and the\nreturned `*address` was lower by the legth of the partial match. In case\nof searched \u0027SEGGER RTT\u0027 (the default control block ID) string, it was\nenough to match `buf[1023] \u003d\u003d \u0027S\u0027`, which is quite likely to happen, and\nthe `*address` was offset by 1 (e.g. it was 0x20000fff instead of\n0x20010000).\n\nUpdating (or even maintaining) `cb_offset` is not needed, as start\naddress of control block can be calculated based on memory address that\nwas loaded into `uint8_t buf[1024]`, the offset within this buffer and\nthe length of expected string.\n\nThe second issue is when control block is prepended with a byte that\nmatches first ID character, e.g. there is `SEGGER RTT` control block ID\nis prepended by another `S`, making memory contents be `SSEGGER RTT`. In\nthat case there was no match found.\n\nFix that issue by making sure that tested byte is always compared with\nfirst byte of expected control block ID.\n\nWhile at it, change names of local variables to better describe their\nmeaning.\n\nSigned-off-by: Marcin Niestroj \u003cm.niestroj@emb.dev\u003e\nChange-Id: I12aa6e202bf12bedcbb888ab595751a2a2518a24\nReviewed-on: https://review.openocd.org/c/openocd/+/7429\nTested-by: jenkins\nReviewed-by: Antonio Borneo \u003cborneo.antonio@gmail.com\u003e\n"}},"2225b9c1ac139f9b2a580816a3df679499293cc3":{"kind":"REWORK","_number":1,"created":"2023-01-02 08:00:03.000000000","uploader":{"_account_id":1002107,"name":"Marcin Niestroj","email":"m.niestroj@emb.dev","username":"mniestroj"},"ref":"refs/changes/29/7429/1","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/29/7429/1","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/29/7429/1 \u0026\u0026 git checkout -b change-7429 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/29/7429/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/29/7429/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/29/7429/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/29/7429/1","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/29/7429/1 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"dfe57baa16cdbc0dc2ae7182b5b3831028637223","subject":"Restore +dev suffix"}],"author":{"name":"Marcin Niestroj","email":"m.niestroj@emb.dev","date":"2023-01-02 07:04:06.000000000","tz":60},"committer":{"name":"Marcin Niestroj","email":"m.niestroj@emb.dev","date":"2023-01-02 07:44:01.000000000","tz":60},"subject":"rtt: fix corner-cases of finding control block","message":"rtt: fix corner-cases of finding control block\n\nThis patch fixes two corner-cases of finding RTT control block.\n\nThe first one is when there was a partial match (even single byte) at\nthe end of loaded buffer (uint8_t buf[1024]), but this was not part of\nfull match. In that case `cb_offset` was not updated correctly and the\nreturned `*address` was lower by the legth of the partial match. In case\nof searched \u0027SEGGER RTT\u0027 (the default control block ID) string, it was\nenough to match `buf[1023] \u003d\u003d \u0027S\u0027`, which is quite likely to happen, and\nthe `*address` was offset by 1 (e.g. it was 0x20000fff instead of\n0x20010000).\n\nUpdating (or even maintaining) `cb_offset` is not needed, as start\naddress of control block can be calculated based on memory address that\nwas loaded into `uint8_t buf[1024]`, the offset within this buffer and\nthe length of expected string.\n\nThe second issue is when control block is prepended with a byte that\nmatches first ID character, e.g. there is `SEGGER RTT` control block ID\nis prepended by another `S`, making memory contents be `SSEGGER RTT`. In\nthat case there was no match found.\n\nFix that issue by making sure that tested byte is always compared with\nfirst byte of expected control block ID.\n\nWhile at it, change names of local variables to better describe their\nmeaning.\n\nSigned-off-by: Marcin Niestroj \u003cm.niestroj@emb.dev\u003e\nChange-Id: I12aa6e202bf12bedcbb888ab595751a2a2518a24\n"}}},"requirements":[],"submit_records":[{"status":"CLOSED","labels":[{"label":"Verified","status":"OK","applied_by":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}},{"label":"Code-Review","status":"OK","applied_by":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"}}]}],"submit_requirements":[{"name":"Verified","status":"SATISFIED","is_legacy":true,"submittability_expression_result":{"expression":"label:Verified\u003dCustom-Rule","fulfilled":true,"status":"PASS","passing_atoms":["label:Verified\u003dCustom-Rule"],"failing_atoms":[]}},{"name":"Code-Review","status":"SATISFIED","is_legacy":true,"submittability_expression_result":{"expression":"label:Code-Review\u003dCustom-Rule","fulfilled":true,"status":"PASS","passing_atoms":["label:Code-Review\u003dCustom-Rule"],"failing_atoms":[]}}]}
