Inspect Manual

Using Inspect With TNS/R Native Programs
Inspect Manual—429164-006
17-3
Optimization Levels
To debug a TNS/R program that contains position-independent code (PIC), you must
use Visual Inspect.
Optimization Levels
Debugging TNS/R native processes differs from debugging TNS or accelerated
processes. Unlike TNS and accelerated processes, TNS/R native processes do not
maintain the TNS process environment, such as the TNS environment registers.
The C, C++, and pTAL compilers support three optimization levels: 0, 1, and 2.
Source-level debugging capabilities are directly related to the optimization level of the
compiler.
Optimize 0
At this level of optimization, no optimizations occur. There is no scheduling, all delay
slots are filled with a NOP, and memory is immediately updated after calculations.
That is, variables are placed in registers, necessary calculations are performed, and
the variables are immediately updated.
Optimize 1
At this level of optimization, as many delay slots as possible are filled and updating of
memory is sometimes deferred because of forward motion of store instructions by the
scheduler.
Optimize 1 offers full debugging support. However, statement boundaries can be
blurred. Inspect will choose a sensible location when you request a breakpoint on a
source statement. Inspects statement boundaries do not necessarily coincide directly
with source statements and will emit a warning when a process is held (e.g., hits a
breakpoint) at a statement for which some code associated with a previous source
statement, e.g. a store instruction, has yet to execute.
Optimize 2
At this level of optimization, the compiler performs all of its possible optimizations–
register allocation, code motion, and instruction scheduling. The register allocation
algorithm cannot be tracked with the current debugger symbol table information.
Practically, there is no symbolic debugging support for Optimize 2.