Difference between revisions of "DEBUG"

From Lianjapedia
Jump to: navigation, search
 
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
Monitor programs during execution
+
Opens the specified prg file in the Debugger in the App Inspector
 
+
  
 
==Syntax==
 
==Syntax==
DEBUG <program | procedure> [WITH <parameter-list>]
+
DEBUG [<filename> [WITH <parameter-list>]]
 
+
  
 
==See Also==
 
==See Also==
[[ASSERT]], [[CANCEL]], [[DEBUG()]], [[DISPLAY BREAKPOINT]], [[DISPLAY CALLS]], [[DISPLAY MEMORY]], [[DISPLAY STATUS]], [[DISPLAY WATCHPOINT]], [[DO]], [[LIST BREAKPOINT]], [[LIST CALLS]], [[LIST WATCHPOINT]], [[QUIT]], [[RESUME]], [[SET ASSERTS]], [[SET COMPILE]], [[SET DEVELOPMENT]], [[SET HISTORY]], [[SET STEP]], [[SUSPEND]]
+
[[:Category:Command_Window_CLI|Command Window (CLI)]], [[:Category:Console_Workspace|Console Workspace]], [[Debug Tab]], [[DEBUGGER]], [[DISPLAY CALLS]], [[DISPLAY MEMORY]], [[DISPLAY STATUS]], [[DO]], [[LIST CALLS]], [[QUIT]], [[SET COMPILE]], [[SET ERRORLOGGING]]
 
+
  
 
==Description==
 
==Description==
The DEBUG command displays a pop-up debugger allowing the specified program to be monitored during execution.
+
The DEBUG command opens the specified prg file <filename> in the [[Debug Tab|Lianja/VFP Debugger]] in the [[App Inspector]].
 
+
The debugger consists of four lines of information about the current program and eighteen push buttons.  Program information consists of the following lines:
+
 
+
 
+
{| class="wikitable"
+
!width="30%"|OPERATION
+
!width="70%"|Displays DEBUG operation: STEP, BREAKPOINT or WATCHPOINT.
+
|-
+
|PROGRAM||Displays the name of the current procedure or program.
+
|-
+
|LINE&#035;||Displays the current line number.
+
|-
+
|COMMAND||Displays the next program line to be executed.
+
|-
+
|}
+
 
+
 
+
The eighteen push buttons are used to access information about the current environment and to specify memory variables and conditions to monitor during program execution.  The pop-up debugger provides the following push buttons:
+
 
+
 
+
{| class="wikitable"
+
!width="30%"|BUTTON
+
!width="70%"|EFFECT
+
|-
+
|Step||Step through a line at a time.
+
|-
+
|Suspend||Suspend the program to go to the interactive prompt, RESUME to restart.
+
|-
+
|Cancel||Cancel program execution and create error.mem.
+
|-
+
|Memory||Display currently declared memory variables.
+
|-
+
|Status||Display currently open tables (and their indexes, current record, etc.).
+
|-
+
|Calls||Show program/procedure call stack.
+
|-
+
|Watch||Set a watch point.  When Executing the program, execution will stop when the specified memory variable's value changes.
+
|-
+
|Break||Set a break point.  When Executing the program, execution will stop when the specified condition becomes true.
+
|-
+
|History||Show command history trace.
+
|-
+
|Execute||Run program without stepping until watch point or break point reached.
+
|-
+
|Wpclear||Clear all watch points.
+
|-
+
|Bpclear||Clear all break points.
+
|-
+
|Bpmark||Mark the current line as a break point.
+
|-
+
|Bpdrop||Clear a particular break point.
+
|-
+
|Wpdrop||Clear a particular watch point.
+
|-
+
|Bpshow||Show all break points.
+
|-
+
|Wpshow||Show all watch points.
+
|-
+
|Quit||Exit the program and debugger.
+
|-
+
|}
+
 
+
 
+
Use the [UP], [DOWN], [LEFT], and [RIGHT] arrow keys to navigate the push buttons, and press the [RETURN] key to select a button.  You may also type the accelerator key to select a button.  The accelerator keys are the highlighted letters in the label of each push button.
+
 
+
Debugger directives can also be hard-coded into program files.  These are ignored in normal program execution but activated when the program runs in debug mode  Debug mode is in effect when the program is called with the DEBUG command or when SET STEP is ON.  Directives start with a '//' comment prefix followed by a space, the DEBUG command, a colon (':'), and the condition.  The following debugger directives are available:
+
 
+
 
+
{| class="wikitable"
+
!DIRECTIVE||EFFECT
+
|-
+
|// DEBUG:BREAKPOINT||Acts as if a break point has been hit when it is encountered.
+
|-
+
|// DEBUG:BREAKPOINT:<expL>||Acts as if a break point has been hit when <expL> evaluates to .T. (True).
+
|-
+
|// DEBUG:WATCHPOINT:<memvar>||Sets a watch point on the specified memory variable.
+
|-
+
|}
+
 
+
 
+
Debugger directives can also be used when programs are run via the Recital Server.
+
  
 +
If the DEBUG command is included in Lianja/VFP code (e.g. in a custom delegate) the [[Debug Tab|Lianja/VFP Debugger]] will be activated when it is executed.
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
 +
////////////////////////////////////////////////////////////////
 +
// Event delegate for 'interactivechange' event
 +
proc page1_section2_ItemCost_interactivechange()
 +
debug
 +
updateTotal()
 +
endproc
 +
 +
// or, from Lianja/VFP Command Window:
 
debug main
 
debug main
 
</code>
 
</code>
  
 
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
[[Category:Error Handling and Debugging]]
+
[[Category:Error Handling]]
[[Category:Error Handling and Debugging Commands]]
+

Latest revision as of 13:21, 18 January 2018

Purpose

Opens the specified prg file in the Debugger in the App Inspector

Syntax

DEBUG [<filename> [WITH <parameter-list>]]

See Also

Command Window (CLI), Console Workspace, Debug Tab, DEBUGGER, DISPLAY CALLS, DISPLAY MEMORY, DISPLAY STATUS, DO, LIST CALLS, QUIT, SET COMPILE, SET ERRORLOGGING

Description

The DEBUG command opens the specified prg file <filename> in the Lianja/VFP Debugger in the App Inspector.

If the DEBUG command is included in Lianja/VFP code (e.g. in a custom delegate) the Lianja/VFP Debugger will be activated when it is executed.

Example

////////////////////////////////////////////////////////////////
// Event delegate for 'interactivechange' event
proc page1_section2_ItemCost_interactivechange()
	debug
	updateTotal()
endproc
 
// or, from Lianja/VFP Command Window:
debug main