11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C-SPY Debugger runtime interface* The linker option With I/O emulation modules is not required for these functions.LOW-LEVEL DEBUGGER RUNTIME INTERFACEThe low-level debugger runtime interface is used for communication between theapplication being debugged and the debugger itself. The debugger provides runtimeservices to the application via this interface; services that allow capabilities like file andterminal I/O to be performed on the host computer.These capabilities can be valuable during the early development of an application, forexample in an application using file I/O before any flash file system I/O drivers havebeen implemented. Or, if you need to debug constructions in your application that usestdin and stdout without the actual hardware device for input and output beingavailable. Another debugging purpose can be to produce debug trace printouts.The mechanism used for implementing this feature works as follows:The debugger will detect the presence of the function __DebugBreak, which will bepart of the application if you have linked it with the XLINK options for C-SPY runtimeinterface. 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 andperform the necessary services. The execution will then resume.THE DEBUGGER TERMINAL I/O WINDOWTo make the Terminal I/O window available, the application must be linked withsupport for I/O debugging, see Debug support in the runtime library, page 47. Thismeans that when the functions __read or __write are called to perform I/Ooperations on the streams stdin, stdout, or stderr, data will be sent to or readfrom 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 <strong>MSP430</strong> <strong>IAR</strong> Embedded Workbench® IDE User Guide for more informationabout the Terminal I/O window.Speeding up terminal outputOn some systems, terminal output might be slow because the host computer and thetarget hardware must communicate for each character.For this reason, a replacement for the __write function called __write_bufferedhas been included in the DLIB library. This module buffers the output and sends it to thedebugger one line at a time, speeding up the output. Note that this function uses about80 bytes of RAM memory.70<strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>Reference Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!