This section demonstrates how to define your our own I/O primitives for the dump phase.
Again, create a new TDP based on the one created previously.
To create a new TDP:
Open the cwingccmingw2.xdp TDP in the TDP Editor
Select the top-level node and rename it My MinGW UserMode2
Save the current TDP as cwingccmingw3.xdp.
Collapse all the nodes in the Navigation window as this section concentrates only on the Build Settings and Library Settings nodes of the TDP Editor.
To set up user-defined I/O primitives:
Expand Build Settings and select the Execution function.
Delete the >$out parameter that was added to the SystemP statement:
Expand Library Settings, Data retrieval and error output and select Data retrieval to locate the RTRT_IO macro definition.
Select the RTRT_USR entry.
On the Settings tab, in RTRT_FILE_TYPE, change int to FILE*.
Add your own code for the usr_open function, such as:
Add your own code for the usr_init function:
Add your own code for the usr_writeln function:
printf("...Dumping : %s\n",s);
Add your own code for the usr_close function:
Save the TDP, update the Configuration in OneTest Embedded and Build the add.c example.
The examples described here make no sense in real life as they are functionally identical the standard I/O mechanism. However, they show how easy it is to map user-defined I/O primitives to the data retrieval mechanism implemented by the TDP.
Move on the next section: Using a Debugger