fglrun
The fglrun tool is the runtime system program that executes p-code programs.
Syntax 1: Executing programs
fglrun [
exec-options]
program [
argument [...]
]
- In this form, fglrun executes the program.
- exec-options can be execution options as well as trace options.
- program is a .42r program, or a
.42m p-code module containing the
MAIN
definition. This can be a simple base name, or a filename including the path to the program file. - argument is an argument passed to the program.
Syntax 2: Starting the debugger
fglrun -d [
exec-options]
program
- In this form, fglrun starts the program in debug mode.
- exec-options can be execution options (trace options are not supported).
- program is a .42r program, or a
.42m p-code module containing the
MAIN
definition. This can be a simple base name, or a filename including the path to the program file.
Syntax 3: Linking programs or libraries
fglrun -l -o outfile{
.42r|
.42x}
[
link-options]
file-list
- In this form, fglrun links a program or library.
- link-options are described in Table 4.
- outfile is the .42r program (or a .42x library) to produce from the link.
{
{
module.42m |
library.42x }
|
pattern
|
@argfile
}
[...]
- module.42m is a p-code module compiled with fglcomp.
- library.42x is a name of a library to be used for linking.
- pattern is a
MATCHES
-style pattern to find files, like'[a-z]*.42m'
. - argfile defines a file that contains a list of .42m or .42x files. Each line must specify a filename or a pattern.
Syntax 4: Using diagnostic options
fglrun diagnostic-option file-list
- In this form, fglrun produces diagnostic data.
- diagnostic-option is one of the diagnostic options.
{
module.42m
|
pattern
|
@argfile
}
[...]
- module.42m is a p-code module compiled with fglcomp.
- pattern is a
MATCHES
-style pattern to find files, like'[a-z]*.42m'
. - argfile defines a file that contains a list of .42m files. Each line must specify a filename or a pattern.
Syntax 5: Information options
fglrun info-option
- info-option can be any of the informational options.
Options
Option | Description |
---|---|
-e
extfile |
Specify a C extension module to be loaded. This option can take a comma-separated list of extensions. |
--java-option=option |
Passes Java runtime options when initializing the JNI interface. See Java Interface for more details. |
Option | Description |
---|---|
-p |
Generate profiling information to stderr. See Program profiler. |
--start-guilog=logfile |
Log all GUI protocol exchange in a file. The GUI log file can
then be replayed with the --run-guilog option. If the log file contains a
%p placeholder, it is replaced by the current process id. |
--run-guilog=logfile |
Replays a GUI log created with the
--start-guilog option. |
--gui-listen=port |
Instructs the runtime system to listen to a TCP port for incoming GUI connections. For more details see Connecting with a front-end. |
--trace |
Starts the program by printing function call stack trace with parameter and return values. For more details, see Execution trace. |
Option | Description |
---|---|
-b |
Displays compiler version information of the module, see Compiling source files. |
--print-imports |
Loads the specified modules and prints all IMPORT
FGL instructions required in each module. See Identifying modules to be imported. |
--print-missing-imports |
Loads the specified modules and prints all missing
IMPORT FGL instructions for each module. See Identifying modules to be imported. |
--module-size |
Displays the pcode size for a single module. The argument of the |
--program-size |
Displays the pcode size for an entire program. The argument of the |
--merge-cov name.4gl
[name.42m.cov] |
Merges FGLCOV coverage data files with source files to produce a readable file name.4gl.cov module. If the .42m.cov file is not located beside the source file, you can specify the full path with the second optional file path. See Source code coverage. |
Option | Description |
---|---|
-e
extfile |
Specify a C extension module to be loaded. This option can take a comma-separated list of extensions. |
--print-imports |
Loads the specified modules and prints all IMPORT
FGL instructions required in each module. See Identifying modules to be imported. |
--print-missing-imports |
Loads the specified modules and prints all missing
IMPORT FGL instructions for each module. See Identifying modules to be imported. |
Option | Description |
---|---|
-V or --version |
Displays version information. |
-h or --help |
Displays options for the tool. |
-i |
Displays information about the current locale / character set settings. See Application locale. |
Usage
fglrun myprogram.42r -x 123
The program file must contain the MAIN
routine.
The arguments passed to the program can be queried with the arg_val() built-in function.
fglrun myprogram -x 123
The program name passed to fglrun can be a simple base name of the program file, or an absolute or relative filename including the path to the program file.
- First fglrun tries to find the program file with the filename as provided in the command line. The filename can have a different extension than .42r or .42m.
- If the file is not found, a new search is done by adding the .42r extension.
- If the file is still not found, fglrun tries with the .42m extension.
- If the file is still not found, fglrun produces the error -4448.