ARM Technical Support Knowledge Articles

PC incorrect after hitting a watchpoint

Applies to: ARM Firmware Suite, RealMonitor

Answer

This is fixed in AFS 1.4.
There is an error in RMTarget 1.0 that causes the PC to contain an incorrect value when a watchpoint is hit. To fix this, you must perform the following steps:

1) In the Sources/rm_asm.s file, locate the following text in the RM_DataAbortHandler function:

      IF RM_OPT_HARDWATCHPOINT
; If we do support hardware watchpoints then create a packet header
; with the opcode set to RM_MSG_HARDWATCH.
RM_DEBUG_READ_MOE a4, ip
CMP a4, #RM_MOE_HARDWATCH
MOVEQ a4, #RM_MSG_HARDWATCH
MOVNE a4, #RM_MSG_DATAABORT
ELSE

2) Insert two additional instructions immediately before the ELSE statement as follows:

      IF RM_OPT_HARDWATCHPOINT
; If we do support hardware watchpoints then create a packet header
; with the opcode set to RM_MSG_HARDWATCH.
      RM_DEBUG_READ_MOE a4, ip
CMP a4, #RM_MOE_HARDWATCH
MOVEQ a4, #RM_MSG_HARDWATCH
MOVNE a4, #RM_MSG_DATAABORT
      ADDEQ   lr, lr, #4      ; change lr to point to the next instruction
STREQ lr, [sp, #12] ; overwrite lr on the stack with the new value
ELSE

(DE 57614)

Article last edited on: 2009-01-22 10:08:31

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential