Difference between revisions of "IDE Window: Watch list"

From Free Pascal wiki
Jump to navigationJump to search
Line 52: Line 52:
  
 
;Expression: As described above
 
;Expression: As described above
;Repeat Count / Digits: Unimplemented
+
;Repeat Count: Unimplemented
 +
;Digits: Unimplemented
 
;Enabled: See Enable/Disable above
 
;Enabled: See Enable/Disable above
 
;Allow function calls: Not yet supported
 
;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.
 
;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.
 
;Style: How to display the data. If a style can not be applied, default will be used.
 +
 +
 +
"Repeat Count"
 +
:is implemented in Lazarus 1.1 (SVN, trunk). It 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 DynA[0]
  
 
= See Also =
 
= See Also =

Revision as of 21:47, 29 May 2012

Deutsch (de) English (en) русский (ru)


Important

You must setup the debugger and start the project to debug it. Only then this window will be useful.

Watch List

Watch List.png

The "Watch List" shows the values of variables and expressions ("watches") 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

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.
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)
debugger enable.png Enable/debugger disable.png 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.
laz delete.png Remove
Deletes the selected Watch(es)
debugger enable all.png Enable all/debugger disable all.png Disable all
Enables/Disables all watches from evaluation.
menu clean.png Delete all
Cleans the list
menu environment options.png Properties
Change the expression or properties of the current/selected watch. (Also possible by double clicking the watch)

Watch Properties

Watch Properties.png

Expression
As described above
Repeat Count
Unimplemented
Digits
Unimplemented
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.


"Repeat Count"

is implemented in Lazarus 1.1 (SVN, trunk). It 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 DynA[0]

See Also

TODO:

  • Watch-Points (Data-Breakpoints)
  • Evaluate Window
  • Debug Inspector
  • Debug History