Atmel CAVR-4 사용자 설명서

다운로드
페이지 323
CAVR-4
Part 1. Using the compiler
The DLIB runtime environment
77
The mechanism used for implementing this feature works as follows. The debugger will 
detect the presence of the function 
_ _DebugBreak
, which will be part of the application 
if you have linked it with the XLINK options for C-SPY runtime interface. In this case, 
the debugger will automatically set a breakpoint at the 
_ _DebugBreak
 function. When 
the application calls, for example 
open
, the 
_ _DebugBreak
 function is called, which 
will cause the application to break and perform the necessary services. The execution 
will then resume.
THE DEBUGGER TERMINAL I/O WINDOW
To make the Terminal I/O window available, the application must be linked with 
support for I/O debugging, see Debug support in the runtime library, page 56. This 
means that when the functions 
_ _read
 or 
_ _write
 are called to perform I/O 
operations on the streams 
stdin
stdout
, or 
stderr
, data will be sent to or read 
from the C-SPY Terminal I/O window.
Note:
The Terminal I/O window is not opened automatically just because 
_ _read
 or 
_ _write
 is called; you must open it manually.
See the AVR® IAR Embedded Workbench™ IDE User Guide for more information 
about the Terminal I/O window.
Checking module consistency
This section introduces the concept of runtime model attributes, a mechanism used by 
the IAR compiler, assembler, and linker to ensure module consistency.
When developing an application, it is important to ensure that incompatible modules are 
not used together. For example, in the AVR IAR C/C++ Compiler, it is possible to 
specify the size of the 
double
 floating-point type. If you write a routine that only works 
for 64-bit doubles, it is possible to check that the routine is not used in an application 
built using 32-bit doubles.
The tools provided by IAR use a set of predefined runtime model attributes. You can use 
these predefined attributes or define your own to perform any type of consistency check.
RUNTIME MODEL ATTRIBUTES 
A runtime attribute is a pair constituted of a named key and its corresponding value. Two 
modules can only be linked together if they have the same value for each key that they 
both define.
There is one exception: if the value of an attribute is 
*
, then that attribute matches any 
value. The reason for this is that you can specify this in a module to show that you have 
considered a consistency property, and this ensures that the module does not rely on that 
property.