29#pragma clang diagnostic ignored "-Wempty-translation-unit"
34#if defined(__ARM_EABI__)
40#include <cmsis-plus/os-app-config.h>
42#if defined(OS_USE_TRACE_SEMIHOSTING_DEBUG) || defined(OS_USE_TRACE_SEMIHOSTING_STDOUT)
48#if defined(OS_DEBUG_SEMIHOSTING_FAULTS)
49#error "Cannot debug semihosting using semihosting trace; use OS_USE_TRACE_ITM"
96#if defined(OS_USE_TRACE_SEMIHOSTING_DEBUG)
98#if !defined(OS_INTEGER_TRACE_SEMIHOSTING_BUFF_ARRAY_SIZE)
99#define OS_INTEGER_TRACE_SEMIHOSTING_BUFF_ARRAY_SIZE (16)
103 write (
const void* buf, std::size_t nbyte)
105 if (buf ==
nullptr || nbyte == 0)
110 const char* cbuf = (
const char*) buf;
114 if (cbuf[nbyte] ==
'\0')
128 std::size_t n = ((togo <
sizeof(tmp)) ? togo :
sizeof(tmp) - 1);
130 for (; i < n; ++i, ++cbuf)
143 return (ssize_t) nbyte;
146#elif defined(OS_USE_TRACE_SEMIHOSTING_STDOUT)
149 write (
const void* buf, std::size_t nbyte)
151 if (buf ==
nullptr || nbyte == 0)
166 block[0] = (
void*)
":tt";
167 block[1] = (
void*) 4;
169 block[2] = (
void*) (
sizeof(
":tt") - 1);
180 block[0] = (
void*) handle;
181 block[1] = (
void*) buf;
182 block[2] = (
void*) nbyte;
194 if (ret == (
int) nbyte)
200 return (ssize_t) (nbyte) - (ssize_t) ret;
#define OS_INTEGER_TRACE_SEMIHOSTING_BUFF_ARRAY_SIZE
Define the semihosting debug buffer size.
ssize_t write(const void *buf, std::size_t nbyte)
Write the given number of bytes to the trace output channel.
static int call_host(int reason, void *arg)