RAD Studio (Common)
ContentsIndex
PreviousUpNext
CPU Window

ViewDebug WindowsCPU Windows 

Displays the assembly language code for the program you are debugging. This window opens automatically when program execution stops at a location for which source code is unavailable.  

The CPU window is divided into the following panes:

Area 
Description 
Address Status (at the top of the window) 
Displays the effective address (when available) and the value stored at that address. For example, if you select an address containing an expression in brackets such as [eax+edi*4-0x0F], the location in memory being referenced and its current value is displayed.
The current thread ID is also displayed.  
Disassembly pane (upper left side) 
Displays the address, the hexadecimal representation of the machine code instructions (opcodes), and the assembly instructions for each line of source code. The address is the offset into the disassembled method.
If you are debugging managed code, the assembly instructions correspond to the native code created by the JIT compiler. The Microsoft Intermediate Language (MSIL) created by the compiler is also displayed. Note that there is not a one-to-one relationship between the native code instructions and the MSIL instructions. You can not step into or set breakpoints on the MSIL instructions.
If debug information is available, the debugger displays the source code that corresponds to the assembly instructions.
A right arrow (Execution point) to the left of an address indicates the current execution point.
When the current instruction is a transfer instruction (for example, call or jmp), either an up or down arrow after the instruction indicates the target direction for the transfer instruction. For example, if the target is located before the current instruction, an up arrow is displayed. If the target is after the current instruction, a down arrow is displayed.
For conditional transfer instructions (for example, jz or jle), an arrow is displayed only if the condition is true. For conditional set instructions (for example, seta or setz), a left arrow is displayed if the condition is true.  
Register pane (upper middle pane ) 
Displays the contents of the CPU registers of the 80386 and greater processors. These registers consist of eight 32-bit general purpose registers and the 32-bit program counter (EIP).
When debugging Win32 code, the flags (EFL) register and the six segment registers are also displayed.
After you execute an instruction, any registers that have changed value since the program was last paused are highlighted in red.  
Memory Dump pane (lower left side) 
Displayed only for unmanaged code. Displays the raw values contained in addressable areas of your program. The pane displays the memory addresses, the current values in memory, and an ASCII representation of the values in memory. The leftmost part of each line shows the starting address of the line. Following the address listing is an 8-byte hexadecimal listing of the values contained at that location in memory. Each byte in memory is represented by two hexadecimal digits. Following the hexadecimal display is an ASCII display of the memory. Non-printable values are represented with a period.
Press CTRL+LEFT ARROW or CTRL+RIGHT ARROW to shift the starting point of the display up or down one byte.  
Flags pane (upper right side) 
Displayed only for unmanaged code. Displays the current state of the flags and information bits contained in the 32-bit register EFL. After you execute an instruction, the Flags pane highlights in red any flags that have changed value since the program was last paused.
The processor uses the bits in this register to control certain operations and indicate the state of the processor after it executes certain instructions.
Pass the mouse over a flag to display the flag name.  
Machine Stack pane (lower right side) 
Displayed only for unmanaged code. Displays the raw values contained in the your program stack. The pane has three sections: the memory addresses, the current values on the stack, and an ASCII representation of the stack values. A green arrow indicates the value at the top of the call stack.  

You can now open a single pane of the CPU window (such as the Disassembly, Registers, or Stack views), from the ViewDebug Windows submenu. A single pane becomes a dockable view that you can move around inside the IDE.

If Automatically close files implicitly opened while debugging is checked on the ToolsOptionsDebugger Options window, the CPU window automatically closes when you end your debugging session. However, if the CPU window is the top window, it does not close.

Use any of the following methods to scroll the Disassembly pane:

  • Press CTRL+LEFT ARROW and CTRL+RIGHT ARROW to shift the starting point of the display up or down one byte. Changing the starting point of the display changes where the debugger begins disassembling the machine code.
  • Click above or below the vertical scrollbar to scroll up or down a screen. (Due to the high volume of information available for display in the Disassembly pane, dragging the scrollbar is disabled.)
  • Use the Goto Address, Goto Current EIP, Follow, and Previous context menu commands, as described in the following section.

The following table lists alphabetically the commands for the panes in the CPU window. Right-click CPU window to display the following context menu commands.

Item 
Description 
Breakpoint Properties 
Displays the Address Breakpoint Properties dialog box.  
Caller 
Positions the Disassembly pane to the instruction past the one that called the current interrupt or subroutine. If the current interrupt routine has pushed data items onto the stack, the debugger might not be able to determine where the routine was called from.
Caller works best when you turn on Stack frames option under Code Generation (on the ProjectOptionsCompiler page).  
Change 
Lets you modify the bytes located at the current cursor location and prompts you for an item of the current display type.  
Change register 
Displays the Change Register dialog box where you enter a new value for the register. You can make full use of the expression evaluator to enter new values. Be sure to precede hexadecimal values with $.  
Change thread 
Displays the Select a Thread dialog box, where you can select the thread you want to debug from the threads listed. When you choose a new thread from the Flags pane, all panes in the CPU window reflect the state of the CPU for that thread.  
Copy 
Copies all selected instructions to the clipboard. From the disassembly pane, you can select a single instruction or you can use the SHIFT key to select multiple instructions. In all other panes, you can only select a single item to copy.  
Decrement register 
Subtracts 1 from the value in the currently highlighted register. This option lets you test “off-by-one” bugs by making small adjustments to the register values.  
Display as 
Formats the data listed in the Machine Stack pane of the CPU window. Choose from the following formats:
Data type displays format.
Bytes displays data in hexadecimal bytes.
Words displays data in 2-byte hexadecimal numbers.
DWords displays data in 4-byte hexadecimal numbers.
Singles displays data in 4-byte floating-point numbers using scientific notation.  
Enabled 
Available only when right-clicking a breakpoint. Toggles the breakpoint between enabled and disabled.  
Follow  
Positions the pane at the destination address of the currently instruction highlighted.  
Goto Address 
Displays the Enter Address to Position dialog box where you can enter a symbol or, for managed code, an address in just in time (JIT) compiler format.  
Goto Current EIP 
Positions the CPU window to the location of the current program counter (the location indicated by the EIP register). This location indicates the next instruction to be executed by your program.  
Increment register 
Adds 1 to the value in the currently highlighted register. This option lets you test "off-by-one” bugs by making small adjustments to the register values.  
Mixed IL Code 
When debugging managed code, toggles the display to include MSIL instructions.  
Mixed Source  
Toggles the display between assembly instructions only and assembly instructions and their corresponding source code (if debug information is available).  
New EIP 
Changes the location of the instruction pointer (the value of EIP register) to the line currently highlighted in the Disassembly pane. Use this command when you want to skip certain machine instructions. When you resume program execution, execution starts at this address.
This command is not the same as stepping through instructions; the debugger does not execute any instructions that you might skip.
Use this command with extreme care; it is easy to place your system in an unstable state when you skip over program instructions.  
Next 
Finds the next occurrence of the item you last searched for in the Memory Dump pane.  
Previous 
Restores the CPU window to the display it had before the last Follow command.  
Run to Current 
Runs your program at full speed to the instruction that you have selected in the CPU window. After your program is paused, you can use this command to resume debugging at a specific program instruction.  
Search 
Displays the Enter Search Bytes dialog box where you can search forward in the CPU window for an expression or byte list (click Help on the Enter Search Bytes dialog box for details).  
Show addresses 
Includes instruction addresses.  
Show opcodes 
Includes instruction opcodes. Choices are Auto, Always, and Never. Auto is the default value and causes opcodes to be shown whenever the window is wide enough to contain the opcode column.  
Toggle Breakpoint 
Set or removes a breakpoint at the currently selected address.  
Toggle flag 
The flag and information bits in the Flags pane can each hold a binary value of 0 or 1. This command toggles the selected flag or bit between these two binary values.  
Top of stack 
Positions the Machine Stack pane at the address of the stack pointer (the address held in the ESP register).  
View FPU 
Available only when debugging Win32 code. Displays the FPU view, which displays the floating-point registers, MMX registers, and SSE registers.  
View Source 
Activates the Code Editor and positions the insertion point at the source code line that most closely corresponds to the disassembled instruction selected in the CPU window. If there is no corresponding source code, this command has no effect.  
Zero register 
Sets the value of the currently highlighted register to 0.  
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!