Memory Window. freescale IDE 5.7
Advertisement
Advertisement
20
Working with Memory
This chapter explains how to work with memory in a CodeWarrior™ IDE debugging session. The following windows show various types of information about memory:
• Memory window—shows the memory that your project manipulates as it executes
• Array window—shows the contents of arrays that your project manipulates as it executes
• Registers window—shows the register contents of a processor
• Register Details window—shows a graphical representation of processor registers and explains register contents
• Cache window—shows processor or instructor cache data
• Trace window—shows collected trace information
This chapter consists of these sections:
•
•
•
•
Register Details Window (Windows OS)
Memory Window
The Memory window manipulates program memory content in various data types. Use this resizable window to perform these tasks:
• View memory
• Change individual memory bytes
• Set watchpoints
NOTE
Arbitrarily changing memory contents could degrade the stability of the IDE, another program, or the operating system itself. Understand the consequences of manipulating memory.
shows the Memory window. Table 20.1
explains the items in the window.
IDE 5.7 User’s Guide 237
Working with Memory
Memory Window
Figure 20.1 Memory Window
Table 20.1 Memory Window Items
Icon Item
Display
View
Memory Space
(for processors that support multiple memory spaces)
Previous Memory
Block
Next Memory
Block
Address
238
Explanation
Enter a symbol representing the starting address of memory to display. Valid symbols include addresses and non-evaluating expressions, such as main or x.
Select the data format in which to view memory contents.
Choose the memory space in which to view selected variables or source code.
Click to view the preceding block of memory.
Click to view the succeeding block of memory.
Displays a contiguous range of memory addresses, beginning with the address entered in the Display field.
IDE 5.7 User’s Guide
Table 20.1 Memory Window Items ( continued)
Icon Item
Hex
Ascii
Word Size
Page
(for processors that support multiple pages)
Working with Memory
Memory Window
Explanation
Displays a hexadecimal representation of the memory addresses shown in the Address pane.
Displays an ASCII representation of the memory addresses shown in the
Address pane.
Select the bit size of displayed words.
Select the memory-space page in which to view source code.
Viewing and Changing Raw Memory
Use the View Memory command to view and change the raw contents of memory.
1. Select an item or expression that resides at the memory address to be examined.
2. Choose Data > View Memory.
A new Memory window appears.
3. Select Raw data from the View list pop-up.
The contents of memory at the selected location appears in both hexadecimal and
ASCII.
Scroll through memory by selecting the Address, Hex, or ASCII pane of the Memory window and then use the up and down arrow keys. Display a different memory location by changing the expression in the Display field.
Change the word size displayed in the Memory window by using the Word Size list pop-up. The choices are 8, 16, and 32 bits.
Change the contents of a particular memory location by double-clicking on that location in either the hexadecimal or ASCII pane of the Memory window. Replace the current value by entering a hexadecimal value in the Hex pane or a string of ASCII characters in the ASCII pane.
IDE 5.7 User’s Guide 239
Working with Memory
Memory Window
Alternatively, use a contextual menu to view and change memory, as explained in
.
Table 20.2 Opening a Memory Window by Using a Contextual Menu
On this host…
Windows
Macintosh
Solaris
Linux
Do this…
Right-click the item and select View Memory.
Control-click the item and select View Memory.
Click and hold on the item, then select View Memory.
Click and hold on the item, then select View Memory.
Viewing Memory Referenced by a Pointer
Use the View Memory command to inspect memory referenced by a pointer; including an address stored in a register.
1. Select a pointer in a source window.
2. Choose Data > View Memory.
A new Memory window appears.
3. Select Raw data from the View list pop-up.
The contents of memory referenced by the pointer appears in both hexadecimal and
ASCII.
Viewing Different Memory Spaces
Use the Page list pop-up to view a particular memory space.
NOTE
This feature is available only for processors that support multiple memory spaces.
1. Select the name of a variable or function in a source window.
2. Choose Data > View Memory.
A Memory window appears.
3. Select a memory space from the Page list pop-up.
240 IDE 5.7 User’s Guide
Working with Memory
Memory Window
4. Select Raw data from the View list pop-up if inspecting a variable. Select
Disassembly, Source, or Mixed from the View list pop-up if inspecting source code.
The Memory window displays the selected memory-space page.
Setting a Watchpoint in the Memory Window
To set a Watchpoint using the Memory window, follow these steps:
1. Run/Debug your program.
2. Choose Data > View Memory.
This opens the Memory window.
3. Select a range of bytes in the Memory window.
Do not double-click the range of bytes.
4. Choose Debug > Set Watchpoint.
NOTE
A red line appears under the selected variable in the Variable window, indicating that you have set a Watchpoint. You can change the color of this line in the Display Settings panel of the IDE Preferences window (Edit > IDE
Preferences).
Clearing Watchpoints from the Memory window
To clear a Watchpoint from the Memory window, follow these steps:
1. Select a range of bytes in the Memory window.
2. Choose Debug > Clear Watchpoint.
To clear all Watchpoints from the Memory window:
1. Open the Memory window.
You do not have to select a range of bytes.
2. Choose Debug > Clear All Watchpoints.
NOTE
All Watchpoints clear automatically when the target program terminates or the debugger terminates the program. Watchpoints will reset next time the program runs.
IDE 5.7 User’s Guide 241
Download
Advertisement