Chapter 5 The Reactis Build File Editor
Reactis for C requires the C source files that implement a program as well as the source files for any libraries referenced by the program. The mechanism for listing these C source files is described in the rest of this section.
The collection of C source files that implement an program is specified using a Reactis Build File (.rsm file 1), which is created and modified using the editor shown in Figure 5.1. An .rsm file specifies how Reactis for C should compile a program for testing. Additionally, a separate .rsm file is required for each library referenced by a program. The .rsm files for the program and any libraries referenced by the program are defined in the same way. In the following discussion we denote the program/library compiled from an .rsm file as the library under construction (LUC).
5.1 Common Buttons
The .rsm file editor has 5 buttons which are always enabled regardless of which pane is selected. These buttons are labeled 5-9 in Figure 5.1, and are used as follows:
5.2 Item Selection
Four of the Reactis Build File Editor panes contain lists of items, such as source files or directories. Within each of these panes, a item listed within the pane can be selected by left-clicking on the line containing the item. Selected items are distinguished by a blue background. A contiguous group of multiple items can be selected by left-clicking on the first item in the sequence and then holding down the shift button while left-clicking on the last item in the sequence. This will select the two items clicked-on plus all items appearing between them. A non-contiguous group of items can be selected by left-clicking on the first item and then holding down the control (Ctrl) key while left-clicking on subsequent items.
Figure 5.1 shows the Source Files pane of the .rsm file editor, which lists the C source files which implement the LUC. The contents of this pane are modified using the buttons labeled 1-4 in Figure 5.1:
5.4 Include Search Path
Figure 5.2 shows the Include Search Path
pane of the .rsm file editor,
which lists the directories to be searched when processing a
Figure 5.4 shows the Defines pane of the .rsm file editor, which lists the macro definitions which are to be defined at the start of compilation of the LUC. Macros are defined using expressions of the form:
There is no mechanism
provided to define macros which accept arguments or use macro
operators such as stringification or token catenation.
This is similar to the way the
The labeled items in Figure 5.4 are used as follows:
See Section 5.2 for an explanation of how macro definitions within the Defines pane are selected.
5.6.1 Instrumentation Code
Figure 5.5 shows the Instrumentation Code pane of the .rsm file editor. This pane lists the location of every segment of instrumentation code that is stored within the build file. Instrumentation code whose location needs to be verified are highlighted with red text. Double clicking on any location within the pane causes the corresponding instrumentation code to be displayed in the main window and highlighted with a yellow flashing background for a few seconds.
The labeled items in Figure 5.4 are used as follows:
5.7 Target Architecture
In Reactis for C, C code is compiled and executed on a virtual machine (VM). There are two choices for VM architecture:
In versions of Reactis for C prior to V2020, only the first choice (32-bit little endian) was available. The salient features of this VM are identical to the IA-32 (Intel/32-bit) architecture. When a word is stored in memory, the bytes are stored from least to most significant. For example, when the word 1025 is stored in memory, bytes will be stored in the order 1, 4, 0, 0.
The other architecture choice is 32-bit big endian. This architecture has the same word and pointer size, but uses a big endian byte order. Under this architecture, when a word is stored in memory, the bytes are stored from most to least significant. For example, when the word 1025 is stored in memory, bytes will be stored in the order 0, 0, 4, 1.
For most programs the byte order should not any difference. Byte order only affects the behavior of programs which use unions or pointers to access the individual bytes of a stored value. Math operations and bit-level operations are not affected by the byte order.
Note that all code is executed on the same VM, so the target architecture selected for components of the program under test must LUC must match the target architecture of all the other system components. Changing the target architecture will require the LUC to be rebuilt before the change will take effect.
5.8 Generating Stubs
The Stub button (item 7 in Figure 5.1) generates a source file which contains definitions for global variables and functions which are declared in the code, but are not defined.
A variable is defined if an instance of the variable exists which does not include
A function is defined if an instance with a body containing the code for that function exists.
In the generated source file, all variables are initialized to numeric zero
(0 for integers, 0.0 for floats, structure fields are individually initialized to numeric zero),
and all functions ignore their arguments and return a value of zero (using the same rules as variables).
The generated source file may require manual editing before it will compile, particularly
if complex types or typedefs are used. In particular,
Also note, that, if you want to stub missing variables with an initial value of zero and stub missing functions with functions that return zero, then it is easier to open the Error Checking pane of the Reactis Harness Editor and set When an extern variable is undefined to Initialize to zero and When an undefined function is called to Return zero. See Section 6.11 for details.
The path to a source file or directory can be either relative or absolute. The location of a source file whose path is relative is determined by appending the relative path to the directory containing the .rsm file. For example, if the .rsm file
references the source file
For convenience, the .rsm file editor provides two buttons for converting paths from relative to absolute form, and vice-versa. To use one of these buttons, first select a source file or library by clicking on it, and then click on either the Relative or Absolute button to the right of the window containing the source file or library.