fglrun

The fglrun tool is the runtime system program that executes p-code programs.

Syntax

fglrun [options] program [argument [...]]
  1. options are described in Table 1.
  2. program is a .42r or .42m p-code program.
  3. argument is an argument passed to the program

Options

Table 1. fglrun options
Option Description
-V Display version information for the tool.
-h Displays options for the tool. Short help.
-i { mbcs } Displays information.
  • -i mbcs displays information about multibyte character set settings.
-d Start in debug mode. See The debugger for more details.
-e extfile[,...] Specify a C extension module to be loaded. This option can take a comma-separated list of extensions.
-l Link p-code modules together, see Compiling source files.
-o { progname.42r | libname.42x } Output file specification when using the -l link option, it can be a 42r program or a 42x library.
-b Displays compiler version information of the module, see Compiling source files.
-p Generate profiling information to stderr (UNIX™ only). See The profiler.
-M Display a memory usage diagnostic when program ends. See Check runtime system memory leaks.
-m Check for memory leaks. If leaks are found, displays memory usage diagnostic and stops with status 1. See Check runtime system memory leaks.
--java-option=option

Passes Java™ runtime options when initializing the JNI interface.

See Java Interface for more details.

--print-imports Loads the specified modules and prints all IMPORT FGL instructions that should be used in each module. See Compiling source files.
--start-guilog=logfile Log all GUI protocol exchange in a file. The GUI log file can then be replayed with the --run-guilog option.
--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.
--module-size module Show the amount of limited pcode size for a module.
--program-size program Show the amount of limited pcode size for an entire program.

Usage

The fglrun command line tool executes p-code programs, for example:
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.

The .42r or .42m extension is optional:
fglrun myprogram -x 123
Note: First fglrun tries to find the program file with the name provided in the command line. If the file is not found, the extension is removed (if it is present in the provided file name), and a new search is done by adding the .42r extension. If the file is still not found, fglrun tries with the .42m extension. As result, a program file myprogram.42m will be found and loaded, even if you pass myprogram.42r to fglrun. Specify no .42r or .42m extension, to avoid mistakes and simplify migration from .42r linked programs to .42m-only modules (using IMPORT FGL).