Specifications
CAVR-4
76
C-SPY Debugger runtime interface
AVR® IAR C/C++ Compiler
Reference Guide
C-SPY Debugger runtime interface
To include support for runtime and I/O debugging, you must link your application
with the XLINK options With runtime control modules or With I/O emulation
modules, see Debug support in the runtime library, page 56. In this case, C-SPY
variants of the following library functions will be linked to the application:
* The linker option With I/O emulation modules is not required for these functions.
LOW-LEVEL DEBUGGER RUNTIME INTERFACE
The low-level debugger runtime interface is used for communication between the
application being debugged and the debugger itself. The debugger provides runtime
services to the application via this interface; services that allow capabilities like file and
terminal I/O to be performed on the host computer.
These capabilities can be valuable during the early development of an application, for
example in an application using file I/O before any flash file system I/O drivers have
been implemented. Or, if you need to debug constructions in your application that use
stdin and stdout without the actual hardware device for input and output being
available. Another debugging purpose can be to produce debug trace printouts.
Function Description
abort C-SPY notifies that the application has called abort *
__exit C-SPY notifies that the end of the application has been reached *
__read
stdin, stdout, and stderr will be directed to the Terminal I/O
window; all other files will read the associated host file
__write
stdin, stdout, and stderr will be directed to the Terminal I/O
window, all other files will write to the associated host file
__open Opens a file on the host computer
__close Closes the associated host file on the host computer
__seek Seeks in the associated host file on the host computer
remove Writes a message to the Debug Log window and returns -1
rename Writes a message to the Debug Log window and returns -1
time Returns the time on the host computer
clock Returns the clock on the host computer
system Writes a message to the Debug Log window and returns -1
_ReportAssert Handles failed asserts *
Table 23: Functions with special meanings when linked with debug info