diff options
author | David Ung <davidu@nvidia.com> | 2015-04-23 13:22:13 -0700 |
---|---|---|
committer | Matthias Welwarsky <matthias.welwarsky@sysgo.com> | 2017-02-10 13:56:39 +0100 |
commit | 5ee67ce024fcbdb0292dce1384b41ac0d6f30426 (patch) | |
tree | ed6ee93a5d79fee43d1acf27d58f7c39fc5410aa | |
parent | 236c9966dd77b7d5d678a71d467492048f347a9b (diff) |
aarch64: Enable halting debug mode on breakpoint set
Ensure that we allow halting debug mode after setting breakpoint
Change-Id: I6f0d7a4a4775a93c133fb1ec31dfe3324d9f7395
Signed-off-by: David Ung <david.ung.42@gmail.com>
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
-rw-r--r-- | src/target/aarch64.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/target/aarch64.c b/src/target/aarch64.c index d991a319..c6354c2c 100644 --- a/src/target/aarch64.c +++ b/src/target/aarch64.c @@ -1247,6 +1247,7 @@ static int aarch64_set_breakpoint(struct target *target, struct aarch64_common *aarch64 = target_to_aarch64(target); struct armv8_common *armv8 = &aarch64->armv8_common; struct aarch64_brp *brp_list = aarch64->brp_list; + uint32_t dscr; if (breakpoint->set) { LOG_WARNING("breakpoint already set"); @@ -1311,6 +1312,17 @@ static int aarch64_set_breakpoint(struct target *target, breakpoint->set = 0x11; /* Any nice value but 0 */ } + retval = mem_ap_read_atomic_u32(armv8->debug_ap, + armv8->debug_base + CPUDBG_DSCR, &dscr); + /* Ensure that halting debug mode is enable */ + dscr = dscr | DSCR_HALT_DBG_MODE; + retval = mem_ap_write_atomic_u32(armv8->debug_ap, + armv8->debug_base + CPUDBG_DSCR, dscr); + if (retval != ERROR_OK) { + LOG_DEBUG("Failed to set DSCR.HDE"); + return retval; + } + return ERROR_OK; } |