A module is a set of source codes and is subject to HKSAT analyses. The addition
follows the following steps:
Selecting source codes
Entering compile options
Validation module information
Performing pre-analysis
Creating a module
To start New Module window
On Modules menu, select Create New Module entry.
Create New Module window appears.
Alternative ways
Click Manage Modules button in the toolbar to open Module View, and then click Add button.
In Project view, on a Project node, right-click to pop up the context menu, and then select Add
Module.
On a project node in Project Graph, right-click to pop up the Context menu, and then click Add Module.
To enter basic info.
In Create New Module window, check the module name and change it if needed.
Enter Compile options if any.
Module name must be within 32 characters, and only a combination of English alphabet and numbers is
available. Spaces, Unicode, and special characters are not available.
Compilation options include a variety of options for compiling on a Network-line Interface (CLI)
base.
However, some options for controlling the compiler, such as -c (compile only) and -G (add debugging
information) of the GHS compiler, cannot be used, and the unavailable options can be changed in the
Compile Settings.
To select source codes
Select Source Code tab.
Click Add button to open File Selection window.
In Select File window, select source code file or directory.
Press Open button to finish.
The source code must be compilable.
If Korean characters is included in the path of a source code file or directory, an error may occur.
An alternative way
Drag source code files or directories to Source Code list. (Drag&Drop)
Check selected files and modify the selection if needed.
Press the OK button to confirm.
To include directories
Select Include Directories tab.
Click Add button and open File Selection window
An alternative way
Drag and drop directories to include directly into Directories list.
If a directory path contains Korean characters, an error may occur.
For a successful compilation, you must include directories with header files that source codes uses.
This can be replaced by directly adding "-I [path]" option to Compile options. [path] can be described
as the header file path.
To add definitions and macros
Select Define and Macros tab.
Enter a key and value, and then click Save button.
Repeat the previous step as needed.
For a successful compilation, you must provide the definitions and macros that are used in the source
codes.
You can directly specifying in Compile options the "-D [name]" that defines a macro, or the "-D
[name]=[definition]" option that defines a macro with a value.
Add note
Select Notes tab.
Type a user note.
You can describe the module or related information.
Notes do not affect actual behavior.
To apply a module setting
Click the Apply button.
Pre-analysis is conducted.
When the pre-analysis is complete, and the module is added to the project.
For convenience, a option dialog is displayed for selecting the following actions:
Modules are created after the validation and the Pre-analysis of the input.>
Pre-analysis extracts information from the source codes.
Pre-analysis checks that the input is valid.
Rebuilding a module from modified input after a failure could use cache for the performance, unless
the compile option is modified.
If the input module information is invalid, the pre-analysis will fail, and no modules will be added.
If you include too many directories, you may encounter errors, and to avoid this, we recommend that you
select a major parent directory to reduce the number.
If the information for compiling is incorrect, module creation may fail. If the module creation fails,
make sure the input is correct.
If the module creation continues to fail even if the information for compilation is correct, you can use
the error reporting feature to report errors.
To reuse the setting as a template
Click Save Setting Template button to save information you entered during module creation to a file.
Click Load Setting Template button to reuse a previously saved template file.
The modules added to the project have source code information extracted from a dictionary analysis of the module
creation process, which includes program basic information such as function lists, variable lists, function call
relationships, and variable usage relationships. This information is easy to see using the various views
provided by HKSAT.
The call relationship of functions in a module can be displayed as a function call graph. The function call graph
visually shows the call relationship between functions contained in the module. The nodes in the graph display
each function, and the edges show the call relationships between them. This makes it easy to understand the
associated function information and the overall flow of calls.
To display a graph of function calls in a module:
Double-click the Module node in the project view.
An alternative way
Double-click the Module node in the project graph.
Open the Graph Viewer and drag the module nodes of the project view to the Graph Viewer.
Functions and functions are linked to the calling edge.
Functions that do not exist in the source code are defined as external functions and are displayed
differently.
When a node is selected, the function that calls that function and the function that is called by that
function are highlighted.
When you click a node, the properties view displays details about the function.
Double-clicking a node displays the control flow graph of that function in the Graph Viewer, and the
source code for that function is displayed in the SourceCode view.
The control flow of a particular function can be displayed as a control flow graph. The Control Flow graph
consists of a program flow chart, which visually displays control flow and details to visually show the order in
which each component runs. The nodes in the graph display the components of each function, and the edges display
the control flow (execution order) between them.
To display a control flow graph of a function:
Double-click the Functions node in the project view.
An alternative way
Double-click the function node in the function call graph.
Open the Graph Viewer and drag the Function node of the project view to the Graph Viewer.
When a node is selected, the syntax that runs before that syntax and the syntax that runs after that
syntax are highlighted.
When you click a node, the Properties view displays details about its syntax.
Double-clicking a node displays the source code for that syntax in the source code view.
View function details
View function details extracted from the pre-analysis. Here's what you can see:
Declaration Location: Displays where the function was declared. The location is displayed by the source code
file name and line number.
Definition Location: Displays where the function is defined.
Call location: Displays where the function is called.
Call function: Displays a list of functions that the function calls.
Assignment Location: Displays where the function is assigned.
Where used: Displays where the function is used.
Variable Declaration: Displays a list of variables declared by the function.
Variable Allocation: Displays a list of variables that the function assigns.
Use Variables: Displays a list of variables used by the function.
To view function details
Float the context menu with a right mouse click on the function node in the project view or the function
node in the function call graph.
Select the menu item you want.
If the information does not exist, the menu is disabled.
Some menus display the number of descendants in parentheses.
Understand the structure of function calls
You can use the Function Call view to recursively track function call relationships. The function call view can
recursively track the function call structure, providing an intuitive understanding of the impact of related
calls.
Displays functions that call specific functions and where they are called as sub-nodes, and recursively displays
them until there are no more nodes calling them. This makes it easy to understand which functions are calling a
particular function and which functions are calling it.
To display the call relationship of a particular function in the function call view
Open the function call view.
Select a specific function in the project view, and then drag it and drop it in the Function Call window.
An alternative way>
In the Project View, right-click on the function node to pop up the context menu, select the call location,
and select the Open Call Structure entry from the submen menu.
In the Functions node of the Function Call Graph, right-click to pop up the context menu, select the calling
location, and select the Open Call Structure entry from the submen menu.
In the Function Call view, the node icon is displayed in blue if there are other functions that call a
particular function, otherwise it is grayed out.
If it is called multiple times, clicking the calling function displays a list of call locations on the
right screen.
View variable details
View variable details extracted from the pre-analysis. Here's what you can see:
Declaration Location: Displays where the variable was declared. The location is displayed by the source code
file name and line number.
Definition Location: Displays where the variable is defined.
Assignment: Displays where values are assigned to variables.
Enabled: Displays where variables are used.
To view variable details
Floats the context menu with a right-click on a variable item in the selection view.
Select the item you want.
If the information does not exist, the menu is disabled.
Some menus display the number of descendants in parentheses.