diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2018-07-18 15:38:49 +0200 |
---|---|---|
committer | Matthias Welwarsky <matthias@welwarsky.de> | 2018-10-27 14:58:02 +0100 |
commit | cf81de70524d615aa307f94b9b326bed42d7dfc0 (patch) | |
tree | 1d0f6baccb7160f1498680c3bb0e89a02d74c141 | |
parent | 988a002a30afe4facd116c97cba88b3793841046 (diff) | |
download | riscv-openocd-cf81de70524d615aa307f94b9b326bed42d7dfc0.zip riscv-openocd-cf81de70524d615aa307f94b9b326bed42d7dfc0.tar.gz riscv-openocd-cf81de70524d615aa307f94b9b326bed42d7dfc0.tar.bz2 |
target/cortex_a: fix temporary breakpoint during step
Commit c8926d14579528bfcead1e179baf7cb846513db4 introduces the
context and hybrid breakpoint types beside existing SW and HW
types. The new field "asid" is non-zero only for these new types.
The commit above did not properly initialize "asid" to 0 for a
temporarily HW breakpoint used during single step. This causes
cortex_a_unset_breakpoint() to identify this breakpoint as of
type "hybrid".
Identified through valgrind error:
Conditional jump or move depends on uninitialised value(s)
Actually valgrind triggers a total of 10 messages about use of
uninitialized variables, but they are all caused by the first
conditional jump bases on "asid != 0".
Fixed by initializing "asid" to 0 in cortex_a_step().
Fixes: c8926d145795 ("cortex_a hybrid & context breakpoints")
Change-Id: Ib674d8457d1e02e10332fd9d73554d13719ef93d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4613
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
-rw-r--r-- | src/target/cortex_a.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c index bc4aa33..e209c80 100644 --- a/src/target/cortex_a.c +++ b/src/target/cortex_a.c @@ -1420,6 +1420,7 @@ static int cortex_a_step(struct target *target, int current, target_addr_t addre /* Setup single step breakpoint */ stepbreakpoint.address = address; + stepbreakpoint.asid = 0; stepbreakpoint.length = (arm->core_state == ARM_STATE_THUMB) ? 2 : 4; stepbreakpoint.type = BKPT_HARD; |