Difference between revisions of "IDE Window: Watch list"
(→Watch List: Update naming to match Lazarus 2.0.10; replace outdated image) |
|||
(14 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{IDE Window: Watch list}} | {{IDE Window: Watch list}} | ||
− | |||
+ | == Navigation == | ||
− | = Important = | + | [[Main menu|Main Menu]] > [[Main menu#View|View]] > Debug Windows > Watches |
+ | |||
+ | == Important == | ||
You must [[Debugger_Setup |setup the debugger]] and start the project to debug it. Only then this window will be useful. | You must [[Debugger_Setup |setup the debugger]] and start the project to debug it. Only then this window will be useful. | ||
+ | To open Watch list press Ctrl+Alt+W. | ||
− | = | + | == Watches == |
− | [[File: | + | [[File:Watches_2_0_10.jpg|right]] |
− | The " | + | The "Watches" window shows the values of variables and expressions when the debugged application is paused. (e.g. reached a breakpoint). |
Expressions can be local or global variables, ([[GDB_Debugger_Tips#Properties|certain]]) properties, or pascal expressions (limited support, e.g. "a+1"). [[GDB_Debugger_Tips#Inspecting_Data-types_.28Watch.2FHint.29|See here for more information]] | Expressions can be local or global variables, ([[GDB_Debugger_Tips#Properties|certain]]) properties, or pascal expressions (limited support, e.g. "a+1"). [[GDB_Debugger_Tips#Inspecting_Data-types_.28Watch.2FHint.29|See here for more information]] | ||
− | == Data displayed == | + | === Data displayed === |
The display has 2 columns: | The display has 2 columns: | ||
+ | |||
*Expression: The variable or expression to be watched | *Expression: The variable or expression to be watched | ||
*Value: The current value of the expression | *Value: The current value of the expression | ||
Line 25: | Line 29: | ||
=== Scope (Stackframe, Thread, History) === | === Scope (Stackframe, Thread, History) === | ||
− | The values are evaluated according to the scope set in the Thread and Stack dialog. Default is the current Thread and top stack frame. | + | The values are evaluated according to the scope set in the [[IDE_Window:_Threads|Thread]] and [[IDE_Window:_Call_Stack|Stack]] dialog. Default is the current Thread and top stack frame. |
Both (Stack and Frame) dialog offer to change the "current" Frame/Thread. The watch window will follow this selection. | Both (Stack and Frame) dialog offer to change the "current" Frame/Thread. The watch window will follow this selection. | ||
− | It is also possible to select previously displayed values, using the History dialog. | + | It is also possible to select previously displayed values, using the [[IDE_Window:_Debug_History|History]] dialog. |
=== Special Values === | === Special Values === | ||
Line 37: | Line 41: | ||
;Error...: The value could not be evaluated. (Error in Expression or Variable not available in selected scope. | ;Error...: The value could not be evaluated. (Error in Expression or Variable not available in selected scope. | ||
− | == Interface == | + | === Interface === |
+ | <u>Toolbar</u> | ||
;[[File:debugger power.png]] Power: Enables/Disables all updates. This does not affect the enabled/disabled state of individual watches. This will freeze the current display. | ;[[File:debugger power.png]] Power: Enables/Disables all updates. This does not affect the enabled/disabled state of individual watches. This will freeze the current display. | ||
;[[File:laz add.png]] Add: Add a new expression. This will open the Watch property dialog. (It is also possible to double click an empty line in the list) | ;[[File:laz add.png]] Add: Add a new expression. This will open the Watch property dialog. (It is also possible to double click an empty line in the list) | ||
Line 47: | Line 52: | ||
;[[File:menu_environment_options.png]] Properties: Change the expression or properties of the current/selected watch. (Also possible by double clicking the watch) | ;[[File:menu_environment_options.png]] Properties: Change the expression or properties of the current/selected watch. (Also possible by double clicking the watch) | ||
− | + | <u>Context menu</u> | |
+ | [[File:Watch_List_popup.png|right]] | ||
+ | |||
+ | Additional to the above functionality the context menu allows to: | ||
+ | ;Inspect: Opens the current watch in the Debug-Inspector | ||
+ | ;Evaluate/Modify: Opens the current watch in the Evaluate/Modify window | ||
+ | ;Create Data/Watch Breakpoint: Opens the dialog to create a new watchpoint based on the current watch (stop if wachted value is changed or accessed) | ||
+ | ;Copy Name: Copies the expression to the clipboard | ||
+ | ;Copy Value: Copies the value to the clipboard | ||
− | + | == Watch Properties == | |
+ | [[File:Watch_Properties.png|right]] | ||
+ | ;Expression: An expression for which the evaluated value should be shown. Expressions can be local or global variables, ([[GDB_Debugger_Tips#Properties|certain]]) properties, or pascal expressions (limited support, e.g. "a+1"). | ||
+ | ;Repeat Count: Can be used to get array slices. The watch specifies the first element of the array "A[7]" (must have an index). With a "Repeat count" of 20, this shows A[7] to A[26]. It can also be used with a dynamic array (no index given). Then it specifies haw many elements to show, beginning with Item[0]. | ||
+ | ;Digits: Not implemented. | ||
+ | ;Enabled: See Enable/Disable above. | ||
+ | ;Allow function calls: Not yet supported. | ||
+ | ;Use Instance class type: Objects are normally shown according to the declaration of the watched expression. Watching "Sender: TObject" will only show you data that is declared on TObject. However object variables can contain objects of inherited classes. Sender may be a TForm. Using this the debugger will find the actual class of the object and display all data. | ||
+ | ;Style: How to display the data. If a style can not be applied, default will be used. | ||
− | = See | + | == See also == |
− | + | * Watch-Points (Data-[[IDE_Window:Breakpoints|Breakpoints]]) | |
− | * Watch-Points (Data-Breakpoints) | + | * [[IDE_Window:_Evaluate/Modify|Evaluate Window]] |
− | * Evaluate Window | + | * [[IDE_Window:_Variable_Inspector|Debug Inspector]] |
− | * Debug Inspector | + | * [[IDE_Window:_Debug_History|Debug History]] |
− | * Debug History |
Revision as of 09:48, 1 February 2021
│
Deutsch (de) │
English (en) │
русский (ru) │
Main Menu > View > Debug Windows > Watches
Important
You must setup the debugger and start the project to debug it. Only then this window will be useful. To open Watch list press Ctrl+Alt+W.
Watches
The "Watches" window shows the values of variables and expressions when the debugged application is paused. (e.g. reached a breakpoint).
Expressions can be local or global variables, (certain) properties, or pascal expressions (limited support, e.g. "a+1"). See here for more information
Data displayed
The display has 2 columns:
- Expression: The variable or expression to be watched
- Value: The current value of the expression
Entries can be double-clicked to edit them.
Scope (Stackframe, Thread, History)
The values are evaluated according to the scope set in the Thread and Stack dialog. Default is the current Thread and top stack frame. Both (Stack and Frame) dialog offer to change the "current" Frame/Thread. The watch window will follow this selection.
It is also possible to select previously displayed values, using the History dialog.
Special Values
- <invalid>
- Value currently not available. Can be caused, if the debugger is not active or the debugged app not currently paused.
- <evaluating>
- Value is currently retrieved. A result will be show soon
- <disabled>
- The expression is excluded from evaluation. See Disable/Enable buttons (light bulbs)
- Error...
- The value could not be evaluated. (Error in Expression or Variable not available in selected scope.
Interface
Toolbar
- Power
- Enables/Disables all updates. This does not affect the enabled/disabled state of individual watches. This will freeze the current display.
- Add
- Add a new expression. This will open the Watch property dialog. (It is also possible to double click an empty line in the list)
- Enable/ Disable
- Enables/Disables individual watches from evaluation. This can be used to prevent spending time on evaluation, if a watch is not available in the current scope.
- Remove
- Deletes the selected Watch(es)
- Enable all/ Disable all
- Enables/Disables all watches from evaluation.
- Delete all
- Cleans the list
- Properties
- Change the expression or properties of the current/selected watch. (Also possible by double clicking the watch)
Context menu
Additional to the above functionality the context menu allows to:
- Inspect
- Opens the current watch in the Debug-Inspector
- Evaluate/Modify
- Opens the current watch in the Evaluate/Modify window
- Create Data/Watch Breakpoint
- Opens the dialog to create a new watchpoint based on the current watch (stop if wachted value is changed or accessed)
- Copy Name
- Copies the expression to the clipboard
- Copy Value
- Copies the value to the clipboard
Watch Properties
- Expression
- An expression for which the evaluated value should be shown. Expressions can be local or global variables, (certain) properties, or pascal expressions (limited support, e.g. "a+1").
- Repeat Count
- Can be used to get array slices. The watch specifies the first element of the array "A[7]" (must have an index). With a "Repeat count" of 20, this shows A[7] to A[26]. It can also be used with a dynamic array (no index given). Then it specifies haw many elements to show, beginning with Item[0].
- Digits
- Not implemented.
- Enabled
- See Enable/Disable above.
- Allow function calls
- Not yet supported.
- Use Instance class type
- Objects are normally shown according to the declaration of the watched expression. Watching "Sender: TObject" will only show you data that is declared on TObject. However object variables can contain objects of inherited classes. Sender may be a TForm. Using this the debugger will find the actual class of the object and display all data.
- Style
- How to display the data. If a style can not be applied, default will be used.
See also
- Watch-Points (Data-Breakpoints)
- Evaluate Window
- Debug Inspector
- Debug History