The HFL Inspector
- The HFL Inspector is an interactive command processor that allows the user to enter commands to examine data, view cell structure, and execute program statements.
- The Inspector command processor is part of the debugger (or pause) mode. For more information on how to enter the debugger, see the section on "Entering Debug mode" .
- When in debugger mode, the user enters Inspector commands at the debugger command prompt which displays as a question mark (?). The Inspector executes a single command and then displays the next command prompt.
The Debugger Inspector Commands
- The following commands are extensions of the debugger that allow the user to examine data and execute program statements. They are intended to be used in conjunction with the debugger functions to step through the execution of an HFL program.
-
- Displays a backtrace of the current call stack, showing the calling sequence up to the current statement being excuted.
- If backtrace depth specified, starts backtrace that number of level before the current statement.
- Otherwise show entire backtrace call stack.
- EXAMPLE:
-
? bt
CALL STACK:
---------------------------------------------------
make_gallery()
load($fmt, 'cache')
nav_bar? {
$navFnames = fnamesNavBeforeAfter($page_filename)
MakeNavMenuType("table")
....
}
MakeNavMenuType("table")
if ($menu_type == "table")
DisableNavbarLabel($nav_curr, "main_link_inactive", "nav_curr")
tr {
td: 1 THRU -1 {}
....
}
td: 1 THRU -1 {
szStripped = stripTrailWS("$alltext")
logP(-1, "IN DisableNavbarLabel")
if (szStripped == $nav_curr)
....
}
logP(-1, "IN DisableNavbarLabel")
---------------------------------------------------
-
- Displays the contents of the current scope stack. The scope stack has one level for each nested scope.
- Each level is numbered, and shows the cell range, scope type and scope. If depth is specified, only displays that many levels.
- EXAMPLE:
-
? sc
CURRENT SCOPE: |page make_gallery() load: nav_bar:1 MakeNavMenuType() if:$menu_type
== "table" DisableNavbarLabel() tr:1 td:1|
SCOPE STACK [9]:
---------------------------------------------------
[ 9] 106 THRU 106 tag td:1
[ 8] 112 THRU 112 tag tr:1
[ 7] 8 THRU 8 tag DisableNavbarLabel()
[ 6] 8 THRU 8 tag if:$menu_type == "table"
[ 5] 8 THRU 8 tag MakeNavMenuType()
[ 4] 8 THRU 8 tag nav_bar:1
[ 3] 2 THRU 2 tag load:
[ 2] 2 THRU 2 tag make_gallery()
[ 1] 2 THRU 2 tag page
---------------------------------------------------
- NOTE that there is often a correlation between the display results of the 'bt' backtrace command, and what is displayed for the scope stack. But they are displaying different data, and there can be differences.
-
- Displays the value of the given variable.
- EXAMPLE:
-
? x $nav_curr = "Photo Gallery"
Photo Gallery
? v $nav_curr
VAR |$nav_curr| = |Photo Gallery|
-
- Displays the value of all variables in the current scope, including globals, locals, and the special variables such as '$1'.
- This can produce a large listing.
-
- Displays the entries of the array of the array variable.
-
If the <array-var> argument does not refer to an array
it will emit the message:
- |<array-var>| IS NOT AN ARRAY
- EXAMPLE:
-
? x var $pets = ["dog", "cat", "bird"]
ARRAY(0x50ab184)
? a $pets
ARRAY |$pets|:
-----------
dog
cat
bird
-----------
-
- Parses and evaluates expression <expr>, and displays its result. You can do pretty much anything that can be done in code, such as declare variables, call functions, apply properties to scopes, load files, etc.
- EXAMPLES:
-
? x 2+3
5
? x print("The sum of 2 and 3 is "+(2+3));
The sum of 2 and 3 is 5
? x p:2{color:red;}
? x load('test.hfl')
TEST.HFL LOADED
-
- Clears the shell window.
- This helps when the displayed output is too much, or you wish to create a listing and want it to be the only thing you can see.
-
- Stops (quits) all execution of HFL and exits the compiler