Using Break Point mode can be summed up as the following tasks:
Compile, link and load the executable in the debugger. This is typically handled by the GUI, so no action is required.
Dump the content of atl_buffer each time the break point on priv_writeln is met.
Quit the debugger when the priv_close is reached
Ensure sure that the file produced is ASCII
To do this, you must specify a break point for I/O. This means that you will no longer use the standard I/O or the user-defined I/O functions.
To disable I/O functions:
Settings, Data retrieval and error
output and select Data retrieval
to locate the RTRT_IO macro definition.
In the combo-box for RTRT_IO you can select:
RTRT_NONE: No I/O available
RTRT_STD: Standard I/O functions
User-defined I/O. Only this option allows you to access the customization
Select RTRT_NONE. This is the typical choice when on limited target platforms with no operating system and no file system.
You need to dump the content of atl_buffer each time the break point on priv_writeln is encountered. The way to do this, without a file system, is to specify how to use the gdb debugger command line in the atl_exec Perl script.
The debugger documentation explains how to call gdb and how to automate the use of the debugger through a command script.
To invoke the debugger from the atl_exec:
Expand Build Settings and select Execution function to locate the atl_exec Perl function.
Comment the existing command line with a # character.
Add the following lines to invoke gdb:
SystemP("gdb -se=$exe -command=$cmd > stdout.log");
Right-click Build Settings and select Ascii File. Rename the created file to run.cmd.
Copy the contents of the run_example.cmd file, provided in the example directory, into the run.cmd file.
Save the TDP, update the TDP in the project, and Build the add.c node.
Depending on the cross development environment, the format of the dumped data can vary largely from one target to another. In most cases, the results must be decoded and converted to ASCII data in order to be processed by the OneTest Embedded Data Splitter and Report Generators.
You need to decode the dump data to ASCII with a Perl routine by using the Perl subroutine named decode.pl.
To decode dump data to ASCII:
Save the TDP, update the Configuration in OneTest Embedded and Build the add.c node.
OneTest Embedded returns an error: the dump accomplished by the debugger does not produce a plain ASCII file as expected.
Look at the result file created by GDB. The relevant data is present but is represented in hex and mixed with other information.
Open the decode.pl Perl script in a text editor, provided with the example.
In the TDP Editor, expand Build Settings and select Execution function to locate the atl_exec Perl function.
Copy-paste the contents of the decode.pl Perl script into the atl_exec Perl function after execution of gdb.
Save the TDP update the TDP in the project, and Build the add.c node.
This time, everything should work as expected and you should be able to view the reports generated by the execution.
Congratulations! You have completed what is probably the most complex part building a TDP.