)]}'
{"id":"openocd~master~I49bd8bb95b2f5429ec38ed016f2ad706618ae68a","project":"openocd","branch":"master","hashtags":[],"change_id":"I49bd8bb95b2f5429ec38ed016f2ad706618ae68a","subject":"cortex_m: fix command \u0027step address\u0027","status":"MERGED","created":"2021-08-13 20:53:14.000000000","updated":"2021-08-22 20:23:09.000000000","submitted":"2021-08-22 20:23:09.000000000","submitter":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"total_comment_count":0,"unresolved_comment_count":0,"has_review_started":true,"submission_id":"6434","meta_rev_id":"6440d3ea91b7b520f7fa5841c9c5168de15c3354","_number":6434,"owner":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"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"},{"value":0,"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},{"value":0,"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},{"tag":"autogenerated:gerrit:merged","value":1,"date":"2021-08-22 20:23:09.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":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"all":[{"tag":"autogenerated:gerrit:merged","value":1,"date":"2021-08-22 20:23:09.000000000","permitted_voting_range":{"min":1,"max":2},"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"tag":"autogenerated:gerrit:merged","value":0,"date":"2021-08-22 20:23:09.000000000","permitted_voting_range":{"min":0,"max":1},"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},{"tag":"autogenerated:gerrit:merged","value":2,"date":"2021-08-22 20:23:09.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},{"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":[],"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":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2021-08-13 21:26:06.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":"2021-08-14 12:39:09.000000000","updated_by":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"reviewer":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"state":"REVIEWER"},{"updated":"2021-08-15 16:55:13.000000000","updated_by":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"reviewer":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"state":"REVIEWER"}],"messages":[{"id":"102d068f3609c03723262212494ab6fbc083aebb","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":"2021-08-13 20:53:14.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"d4297f7d7e8bb15b49b475a73f4186f9b63bce8e","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2021-08-13 21:26:06.000000000","message":"Patch Set 1: Verified+1\n\nBuild Successful \n\nhttp://build.openocd.org/job/openocd-gerrit/14999/ : SUCCESS\n\nhttp://build.openocd.org/job/openocd-gerrit-build/14234/ : SUCCESS","accounts_in_message":[],"_revision_number":1},{"id":"ae3d24c015e815eafa78b88814b30e73e38b39aa","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":"2021-08-14 12:38:54.000000000","message":"Patch Set 1: Code-Review+1","accounts_in_message":[],"_revision_number":1},{"id":"e3bd655a1fd887c32e76388790989972f1d60be1","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"date":"2021-08-15 16:55:13.000000000","message":"Patch Set 1: Code-Review+2\n\nYes, it should be handled the same way as in resume.","accounts_in_message":[],"_revision_number":1},{"id":"6440d3ea91b7b520f7fa5841c9c5168de15c3354","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":"2021-08-22 20:23:09.000000000","message":"Change has been successfully cherry-picked as 6f28ac8fdef91b665b3edf5132c03f73fd4e1d1d","accounts_in_message":[],"_revision_number":2}],"current_revision":"6f28ac8fdef91b665b3edf5132c03f73fd4e1d1d","revisions":{"ef9a7eee3da0791483ad0e482b3daeaa83aa3c2f":{"kind":"REWORK","_number":1,"created":"2021-08-13 20:53:14.000000000","uploader":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"ref":"refs/changes/34/6434/1","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/34/6434/1","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/34/6434/1 \u0026\u0026 git checkout -b change-6434 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/34/6434/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/34/6434/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/34/6434/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/34/6434/1","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/34/6434/1 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"3d9534b8a85d314f82440ce0e37632571c42245a","subject":"github/workflow: upgrade libraries in windows build to latest versions"}],"author":{"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","date":"2021-08-13 16:52:20.000000000","tz":120},"committer":{"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","date":"2021-08-13 20:49:49.000000000","tz":120},"subject":"cortex_m: fix command \u0027step address\u0027","message":"cortex_m: fix command \u0027step address\u0027\n\nThe command \u0027step\u0027 accepts an optional parameter \u0027address\u0027 to run\nthe step-by-step execution from an address different from current\nprogram counter.\nWhen OpenOCD sets the new program counter value in the register\ncache, it doesn\u0027t flag it as dirty. The following call to function\narmv7m_restore_context() does not propagate the new value of the\nprogram counter to the target. This cause the target to continue\nfrom the old program counter value, ignoring the user\u0027s request.\n\nIt is hard to notice the issue if the target is halted in an idle\nloop! In fact the default mode to operate step-by-step is to set a\nbreakpoint to the following instruction and resume execution. In\nthe idle loop the CPU will pass through the breakpoint whatever\nthe resume address is. User will find the target halting at the\ninstruction following \u0027address\u0027 which is consistent with the\nexpected behaviour of command \u0027step address\u0027.\n\nTo verify the issue on an STM32F4, use a dummy code in SRAM:\n\thalt\n\tmww 0x20000000 0xbf00bf00\n\tmww 0x20000004 0xbf00bf00\n\tmww 0x20000008 0xe7fcbf00\n\tarm disassemble 0x20000000 6\n\t        0x20000000  bf00    nop\n\t        0x20000002  bf00    nop\n\t        0x20000004  bf00    nop\n\t   +--\u003e 0x20000006  bf00    nop\n\t   |    0x20000008  bf00    nop\n\t   +-\u003c- 0x2000000a  e7fc    b   #0x20000006\n\tresume 0x20000006\n\thalt\n\tstep 0x20000000\nthe target doesn\u0027t halt because it is in the loop from 0x20000006\nto 0x2000000a. The \u0027step 0x20000000\u0027 did not changed the program\ncounter so the temporary breakpoint at 0x20000002 is never hit.\nThen:\n\thalt\n\tstep 0x20000008\n\t\ttarget halted ...\n\t\t... pc: 0x2000000a\ngives the feeling that only the instruction at 0x20000008 has been\nexecuted, but actually the whole loop has been executed from the\nplace \u0027halt\u0027 stopped the execution till the breakpoint at the\ninstruction following 0x20000008.\n\nFlag the program counter cached value as \u0027valid\u0027 and \u0027dirty\u0027 to\nforce armv7m_restore_context() to update the target\u0027s register.\n\nChange-Id: I49bd8bb95b2f5429ec38ed016f2ad706618ae68a\nSigned-off-by: Antonio Borneo \u003cborneo.antonio@gmail.com\u003e\n"}},"6f28ac8fdef91b665b3edf5132c03f73fd4e1d1d":{"kind":"REWORK","_number":2,"created":"2021-08-22 20:23:09.000000000","uploader":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"ref":"refs/changes/34/6434/2","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/34/6434/2","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/34/6434/2 \u0026\u0026 git checkout -b change-6434 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/34/6434/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/34/6434/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/34/6434/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/34/6434/2","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/34/6434/2 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"044e0f8c9aec9fe94d77199e64c813fb4336984b","subject":"stlink: fix SWIM mode on stlink-v3"}],"author":{"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","date":"2021-08-13 16:52:20.000000000","tz":120},"committer":{"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","date":"2021-08-22 20:23:09.000000000","tz":0},"subject":"cortex_m: fix command \u0027step address\u0027","message":"cortex_m: fix command \u0027step address\u0027\n\nThe command \u0027step\u0027 accepts an optional parameter \u0027address\u0027 to run\nthe step-by-step execution from an address different from current\nprogram counter.\nWhen OpenOCD sets the new program counter value in the register\ncache, it doesn\u0027t flag it as dirty. The following call to function\narmv7m_restore_context() does not propagate the new value of the\nprogram counter to the target. This cause the target to continue\nfrom the old program counter value, ignoring the user\u0027s request.\n\nIt is hard to notice the issue if the target is halted in an idle\nloop! In fact the default mode to operate step-by-step is to set a\nbreakpoint to the following instruction and resume execution. In\nthe idle loop the CPU will pass through the breakpoint whatever\nthe resume address is. User will find the target halting at the\ninstruction following \u0027address\u0027 which is consistent with the\nexpected behaviour of command \u0027step address\u0027.\n\nTo verify the issue on an STM32F4, use a dummy code in SRAM:\n\thalt\n\tmww 0x20000000 0xbf00bf00\n\tmww 0x20000004 0xbf00bf00\n\tmww 0x20000008 0xe7fcbf00\n\tarm disassemble 0x20000000 6\n\t        0x20000000  bf00    nop\n\t        0x20000002  bf00    nop\n\t        0x20000004  bf00    nop\n\t   +--\u003e 0x20000006  bf00    nop\n\t   |    0x20000008  bf00    nop\n\t   +-\u003c- 0x2000000a  e7fc    b   #0x20000006\n\tresume 0x20000006\n\thalt\n\tstep 0x20000000\nthe target doesn\u0027t halt because it is in the loop from 0x20000006\nto 0x2000000a. The \u0027step 0x20000000\u0027 did not changed the program\ncounter so the temporary breakpoint at 0x20000002 is never hit.\nThen:\n\thalt\n\tstep 0x20000008\n\t\ttarget halted ...\n\t\t... pc: 0x2000000a\ngives the feeling that only the instruction at 0x20000008 has been\nexecuted, but actually the whole loop has been executed from the\nplace \u0027halt\u0027 stopped the execution till the breakpoint at the\ninstruction following 0x20000008.\n\nFlag the program counter cached value as \u0027valid\u0027 and \u0027dirty\u0027 to\nforce armv7m_restore_context() to update the target\u0027s register.\n\nChange-Id: I49bd8bb95b2f5429ec38ed016f2ad706618ae68a\nSigned-off-by: Antonio Borneo \u003cborneo.antonio@gmail.com\u003e\nReviewed-on: https://review.openocd.org/c/openocd/+/6434\nTested-by: jenkins\nReviewed-by: Tomas Vanek \u003cvanekt@fbl.cz\u003e\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":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"}}]}],"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":[]}}]}
