summaryrefslogtreecommitdiff
path: root/src/target/mips_m4k.c
diff options
context:
space:
mode:
authorduane <duane@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-27 17:25:07 +0000
committerduane <duane@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-27 17:25:07 +0000
commit78c0e873d2bc9928849c18f2c605a5f2382a3980 (patch)
tree2851426f5e960f4b90c21e3ed21b2142f6236a08 /src/target/mips_m4k.c
parentf538794bf62d28f1a96ecfcbf8d01991d8530404 (diff)
downloadopenocd+libswd-78c0e873d2bc9928849c18f2c605a5f2382a3980.tar.gz
openocd+libswd-78c0e873d2bc9928849c18f2c605a5f2382a3980.tar.bz2
openocd+libswd-78c0e873d2bc9928849c18f2c605a5f2382a3980.tar.xz
openocd+libswd-78c0e873d2bc9928849c18f2c605a5f2382a3980.zip
Add Breakpoint/Watchpoint unique ID to help debug hardware debug register leakage
git-svn-id: svn://svn.berlios.de/openocd/trunk@2408 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/mips_m4k.c')
-rw-r--r--src/target/mips_m4k.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c
index 07ecb556..e1b98a2b 100644
--- a/src/target/mips_m4k.c
+++ b/src/target/mips_m4k.c
@@ -513,7 +513,8 @@ int mips_m4k_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
bp_num++;
if (bp_num >= mips32->num_inst_bpoints)
{
- LOG_DEBUG("ERROR Can not find free FP Comparator");
+ LOG_DEBUG("ERROR Can not find free FP Comparator(bpid: %d)",
+ breakpoint->unique_id );
LOG_WARNING("ERROR Can not find free FP Comparator");
exit(-1);
}
@@ -523,10 +524,13 @@ int mips_m4k_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
target_write_u32(target, comparator_list[bp_num].reg_address, comparator_list[bp_num].bp_value);
target_write_u32(target, comparator_list[bp_num].reg_address + 0x08, 0x00000000);
target_write_u32(target, comparator_list[bp_num].reg_address + 0x18, 1);
- LOG_DEBUG("bp_num %i bp_value 0x%" PRIx32 "", bp_num, comparator_list[bp_num].bp_value);
+ LOG_DEBUG("bpid: %d, bp_num %i bp_value 0x%" PRIx32 "",
+ breakpoint->unique_id,
+ bp_num, comparator_list[bp_num].bp_value);
}
else if (breakpoint->type == BKPT_SOFT)
{
+ LOG_DEBUG("bpid: %d", breakpoint->unique_id );
if (breakpoint->length == 4)
{
uint32_t verify = 0xffffffff;
@@ -598,16 +602,22 @@ int mips_m4k_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
int bp_num = breakpoint->set - 1;
if ((bp_num < 0) || (bp_num >= mips32->num_inst_bpoints))
{
- LOG_DEBUG("Invalid FP Comparator number in breakpoint");
+ LOG_DEBUG("Invalid FP Comparator number in breakpoint (bpid: %d)",
+ breakpoint->unique_id);
return ERROR_OK;
}
+ LOG_DEBUG("bpid: %d - releasing hw: %d",
+ breakpoint->unique_id,
+ bp_num );
comparator_list[bp_num].used = 0;
comparator_list[bp_num].bp_value = 0;
target_write_u32(target, comparator_list[bp_num].reg_address + 0x18, 0);
+
}
else
{
/* restore original instruction (kept in target endianness) */
+ LOG_DEBUG("bpid: %d", breakpoint->unique_id);
if (breakpoint->length == 4)
{
uint32_t current_instr;