Compiler User GuidePreface Overview of the Compiler Getting Started with the Compiler Compiler Features Compiler Coding Practices Compiler Diagnostic Messages Using the Inline and Embedded Assemblers of the AR Compiler Command-line Options Language Extensions Compiler-specific Features C and C++ Implementation Details What is Semihosting? What is semihosting? The semihosting interface Can I change the semihosting operation numbers? Debug agent interaction SVCs angel_SWIreason_EnterSVC (0x17) angel_SWIreason_ReportException (0x18) SYS_CLOSE (0x02) SYS_CLOCK (0x10) SYS_ELAPSED (0x30) SYS_ERRNO (0x13) SYS_FLEN (0x0C) SYS_GET_CMDLINE (0x15) SYS_HEAPINFO (0x16) SYS_ISERROR (0x08) SYS_ISTTY (0x09) SYS_OPEN (0x01) SYS_READ (0x06) SYS_READC (0x07) SYS_REMOVE (0x0E) SYS_RENAME (0x0F) SYS_SEEK (0x0A) SYS_SYSTEM (0x12) SYS_TICKFREQ (0x31) SYS_TIME (0x11) SYS_TMPNAM (0x0D) SYS_WRITE (0x05) SYS_WRITEC (0x03) SYS_WRITE0 (0x04) Via File Syntax Summary Table of GNU Language Extensions Standard C Implementation Definition Standard C++ Implementation Definition C and C++ Compiler Implementation Limits
What is semihosting?
11.1 What is semihosting?
Semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.
Examples of these facilities include keyboard input, screen output, and disk I/O. For example, you can use this mechanism to enable functions in the C library, such as
This is useful because development hardware often does not have all the input and output facilities of the final system. Semihosting enables the host computer to provide these facilities.
Semihosting is implemented by a set of defined software instructions, for example SVCs, that generate exceptions from program control. The application invokes the appropriate semihosting call and the debug agent then handles the exception. The debug agent provides the required communication with the host.
The semihosting interface is common across all debug agents provided by ARM. Semihosted operations work when you are debugging applications on your development platform, as shown in the following figure:
Figure 11-1 Semihosting overview
In many cases, semihosting is invoked by code within library functions. The application can also invoke the semihosting operation directly.
NoteARM processors use the
of your data.