The compiler of updateable programs hcucc.pl is a wrapper that invokes the compiler driver hcubasic.pl with various options. By default, hcucc.pl enables all of the features needed to build updateable programs. However it is possible to invoke the compiler driver by enabling only some of these features, which is useful in preparing updateable programs with different capabilities. Enabling only some features can be useful in measuring the performance of updateable programs.
![]() | Note that a lot of the compiler features offer additional options. For a complete list of compiler options run hcubasic.pl --help. |
The mandatory compiler features that must be enabled to prepare updateable programs are:
Enabling common functionality for updating, enabled with the parameter --doCommonUpdate.
Initializing the dynamic update runtime environment, enabled with the parameter --doInitializeRuntime.
Automatically inserting update points, enabled with the parameter --doInsertUpdatePoints.
Identifying thread entry-points, signal-handlers, and functions passed as parameters to libraries, which need special support to be updated properly, enabled with the parameter --doWrapCalls.
In addition to the mandatory compiler features, the following features are enabled by default. These features are optional:
Converting blocking system calls to non-blocking, enabled with the parameter --doBlockingSystemCallConversion.
Supporting updates of multi-threaded and multi-process programs, enabled with the parameter --doMultiThreadedUpdates.
Preparing programs to be updateable using stack reconstruction, enabled with the parameter --doStackReconstruction.
Applying dynamic stack tracing to enforce runtime safety constraints, enabled with the parameter --doDynamicSafety.
Other optional features useful in debugging the compiler or further directing the compiler are:
Marking some functions as non-updateable, enabled with the parameter --doConfiguration --compiler-configuration-file=<filename>. It requires the compiler configuration file supplied to define a variable of the datatype:
hcu_compiler_configuration_t
This datatype defines a structure with one variable: an array of function names that should not be instrumented for stack reconstruction.
Figure 4-4 shows an example compiler configuration file.
Figure 4-4. Describing a compiler configuration.
#include "hcu_compiler_configuration.h" hcu_compiler_configuration_t compiler_configuration = { /* non_updateable_functions */ { "cash_cmp", "on_exit_reset", "smgr_redo", "b64_dec_len", ... "SetDefaultClientEncoding", "Int_yy_init_buffer", "restriction_is_or_clause" } };
![]() | Marking some functions as non-updateable can lead to breaking stack-reconstruction if a callee function returns to a non-updateable function. This feature should only be used with a clear understanding of its implications. |
Trace program execution at the source-code level, enabled with the parameter --doExecutionTrace. This option can be useful in debugging the compiler.
Print a control-flow graph in dot (Graphviz) format, enabled with the parameter --doPrintDot. This option can be useful in understanding the control flow of a program.