2.9.1.4 Display/modify the memory contents during program execution

The Memory panel/Watch panel has the real-time display update function that can update/modify the display contents of the memory/watch-expression in real-time while executing the program.

Using the real-time display update function allows you to display/modify the value of memory/watch-expression not only while the program is stopped, but also in execution.

The real-time display update function is realized by the RRM function (reading) [IECUBE][Simulator], a RAM monitor function (reading) (other than [Simulator]) or by the DMM function (modifying). Each function has a different area that can be used for reading and writing.

 

Firstly, enable the real-time display update function by making the basic settings below on the [Debug Tool Settings] tab of the Property panel.

Table 2.7

Basic Settings for Real-time Display Update Function

Category

Property

Set Value

[Access memory while running]

[Update display during the execution]

[Yes] (default)

[Display update interval[ms]]

[Integer number between 100 and 65500]

Caution

Local variables are not subject to the real-time display update function.

(1)

RRM function (reading) [IECUBE][Simulator]

This function is used to read the contents of the memory or of watch-expressions in real-time during execution of a program.

The following area can be read by the RRM function.

Memory and watch-expressions allocated to this area can always be displayed in real-time.

Table 2.8

Target Area of RMM Function

Area

IECUBE

Simulator

Internal ROM

Note 1

 

Internal RAM (except register area)

 

 

Data flash

 

-

Emulation memory

-

 

Target memory

-

 

CPU register

Note 2

Note 3

SFR

-

Note 3

Note 1.

This refers to data that were in the cache before execution, to the values are not real-time.

Note 2.

Possible only for general-purpose registers and PC

Note 3.

Impossible during tracer/timer execution

(2)

RAM monitor function (reading) (other than [Simulator])

This function is used to read the contents of memory or a watch-expression through software emulation by briefly halting the program.

The following area can be read by the RAM monitor function.

Caution

If CPU status shifts to the standby mode (HALT/STOP/IDLE) mode, a monitor time-out error will occur.

Table 2.9

Target Area of RAM Monitor Function

Area

IECUBE

E1/E20/EZ Emulator

Internal ROM

-Note 1

-

Internal RAM (except register area)

-Note 1

 

Data flash

-Note 1

 

Emulation memory

-

-

Target memory

 

-

CPU register

 

Note 2

SFR

 

Note 3

Note 1.

When it is available, priority is given to the RRM function. That is, the RAM monitor function is not used in such cases.

Note 2.

This only applies to the general-purpose registers corresponding to the bank specification.

Note 3.

This does not apply to BCDADJ.

 

Note that to enable the RAM monitor function, the setting below is required in addition to the Basic Settings for Real-time Display Update Function.

Category

Property

Set Value

[Access memory while running]

[Access by stopping execution]

[Yes]

(3)

DMM function (modifying)

This function is used to write to the memory or watch-expressions in real-time during execution of a program.

The following area can be modified by the DMM function.

Caution

If CPU status shifts to the standby mode (HALT/STOP/IDLE) mode, a monitor time-out error will occur.

Table 2.10

Target Area of DMM Function

Area

IECUBE

E1/E20/EZ Emulator

Simulator

Internal ROM

-

-

 

Internal RAM (except register area)

 

 

 

Emulation memory

-

-

 

Target memory

 

-

 

CPU register

 

Note 1

Note 2

SFR

 

Note 3

Note 2

: Possible by briefly halting execution

: Possible without briefly halting execution

Note 1.

This only applies to the general-purpose registers corresponding to the bank specification.

Note 2.

Impossible during tracer/timer execution

Note 3.

Possible only for standard SFRs

 

To enable the DMM function, the setting below is required in addition to the Basic Settings for Real-time Display Update Function.

Debug Tool

Property

Set Value

Simulator

No setting is required.

Other than above

[Access memory while running] category
>> [Access by stopping execution]

[Yes]

Caution

When a 2-, 4-, or 8-byte variable is to be read through the RRM or RAM monitor function, the process of assigning a value to the variable may be divided into two steps.
If reading of the variable takes place between the two steps, an incorrect value may be read out because the assignment is not completed.

Example)

In the following example, if reading takes place before "(2)" is executed, the value of variable "value_a" in which only the assignment to the two lower-order bytes has been completed is read out.

 

[C source text]

long int    value_a = 0;    // Definition of a 4-byte variable
void func(void)
{
    value_a = 4000000000;   // Assignment to a 4-byte variable
}

[Assembly instructions for the assignment processing above]

MOVW    AX, #2800H
MOVW    !_value_a, AX       ;(1): Assignment to the two lower-order bytes of variable "value_a"
MOVW    AX, #0EE6BH
MOVW    !_value_a+2, AX     ;(2): Assignment to the two high-order bytes of variable "value_a"

 

On the Memory panel/Watch panel, the memory values/watch-expressions updated by the real-time display update function are highlighted in pink.

Figure 2.97

Example of Memory Display by Real-time Display Update Function

 

Moreover, on the Memory panel using IECUBE, the background color of the memory values updated by the RRM function are highlighted as follows in accordance with the access status (character colors and background colors depend on the configuration in the [General - Font and Color] category of the Option dialog box).

Access Condition

Display Example

Read

 

Write

 

Read and write

 

Figure 2.98

Example of Memory Display by Real-time Display Update Function (RRM Function) [IECUBE]