| Target Language Compiler | ![]() |
Building a Model Using the TLC Debugger
Objective: Introduce the TLC debugger. You will learn how to set breakpoints and familiarize yourself with the various commands supported by the TLC debugger.
Preparing the Example
You invoke the TLC debugger while building the model. Use the same model, sfun_x2.mdl, for this example:
The MATLAB command window shows the building process information and stops at the grt.tlc file and displays the following tag in the command window.
TLC-DEBUG>
Type help to see the list of TLC debugger commands.
Performing the Tasks
timestwo.tlc. Type help break to list the various syntaxes for the break command. Use the first form of the break command to set a breakpoint on line 19. Typebreak "timestwo.tlc":19
Type continue to instruct the TLC debugger to continue to the next
breakpoint. The debugger should advance to line 19 in timestwo.tlc and
display the following status information in the MATLAB command window.
Stopped in file "timestwo.tlc" at line 19 00019: %<y> = %<u> * 2.0; TLC-DEBUG>
%<u>.TLC-DEBUG> assign u = 5.0
TLC-DEBUG> print y TLC-DEBUG> print TYPE(y) TLC-DEBUG> whos CompiledModel TLC-DEBUG> print CompiledModel.CodeFormat
continue to commence completing code generation.TLC-DEBUG> continue
For more information about the TLC debugger, see Chapter 6, Debugging TLC.
| Introduction to TLC Token Expansion | Explore Variable Names and Loop Rolling | ![]() |