The Debug Inspector lets you inspect data elements by automatically formatting the type of data it is displaying. The Debug Inspector is especially useful for examining compound data objects, such as arrays and linked lists. Because you can inspect individual items displayed in the Debug Inspector, you can perform a walkthrough of compound data objects by opening a Debug Inspector on a component of the compound object.
Note: The Debug Inspector
is only available when the process is stopped in the debugger.
To inspect a data element directly from the Code Editor
- In the Code Editor, place the insertion point on the data element that you want to inspect.
- Right-click and choose DebugInspect to display the Debug Inspector.
To inspect a data element from the menu
- Choose RunInspect to display the Inspect dialog box.
- In the Inspect dialog box, type the expression you want to inspect.
- Click OK. The Debug Inspector is displayed.
Unlike watch expressions, the scope of a data element in the Debug Inspector
is fixed at the time you evaluate it. If you use the Inspect command from the Code Editor
, the debugger uses the location of the insertion point to determine the scope of the expression you are inspecting. This makes it possible to inspect data elements that are not within the current scope of the execution point.
If you use RunInspect, the data element is evaluated within the scope of the execution point.
If the execution point is in the scope of the expression you are inspecting, the value appears in the Debug Inspector. If the execution point is outside the scope of the expression, the value is undefined and the Debug Inspector becomes blank.
To view members of the object you are inspecting
- Click the Data tab to view strings, boolean values, and other values for such things as variable name, expression, and owner.
Tip: If you want to see the hexadecimal representation of a string, sub-inspect the string value in the Debug Inspector.
- Click the Methods tab to view all of the methods that are members of the object's class.
Tip: If you want to see the return type for any method, select the method and look at the status bar of the Debug Inspector, where the syntax line for the method, including the return type is displayed.
- Click the Properties tab to view all of the properties for the active object.
- Click any property name to see its type displayed in the status bar of the Debug Inspector.
- Click the question mark (?) icon to see the actual value for that property at this point of the execution of the application.
To change the value of a data element
- In the Debug Inspector, select a data element that has an ellipsis (…) next to it. The ellipsis indicates that the data element can be modified.
- Click the ellipsis (…), or right-click the element and choose Change.
- Type a new value, then click OK.
To inspect local variable values
- While running in Debug mode, double-click any variable that appears in the Local Variables window. This displays the Debug Inspector for that local variable.
- Inspect the variable's value. Change the value by clicking the button with an ellipsis (…) on it.