Debugging with RMHost
3.1.2Background memory access
In addition to being able to access memory when your application is stopped (as with
Therefore, the memory and disassembly windows in the debugger you are using can be opened and refreshed while your application is running. You can also view the contents of
Memory can also be written to at any time. However you must be aware that read/write operations might not be atomic to the application. Therefore, if a large structure is viewed, for example, it might not be a consistent snapshot because data at the end of the structure is likely to have been read later than data at the start of the structure. The same problem exists with writes, so you must take care when updating such a structure when consistency between the elements is required.
If RMTarget has not been built with support for word accesses, for example, RMHost uses the supported access size (see RM_OPT_WRITEWORDS and RM_OPT_READWORDS in the building chapter of the ARM RMTarget Integration Guide). For byte and halfword accesses, RMTarget executes multiple
Note
This use of multiple
While executing these instructions, your application is not running, but interrupts might still be serviced. It is therefore essential that you take care when writing to variables used by interrupt service routines.
RealMonitor also uses writes to memory to set software breakpoints. It is therefore possible that when setting a breakpoint on an interrupt service routine, the routine might execute before the breakpoint is fully set, causing the routine to malfunction (without causing an undefined instruction or breakpoint). If this happens, an error message is not necessarily displayed.
To work around this situation, RMHost always uses the ExecuteCode command to ensure that writes of a single word (or halfword, if using Thumb), such as a breakpoint instruction, are always atomic. That is, they use a single STR instruction (or STRH, if using Thumb). This is not done for larger structures.
ARM DUI 0137A | Copyright © 2000 ARM Limited. All rights reserved.. All rights reserved. | 33 |