28#if defined(__ARM_EABI__)
34#include <cmsis-plus/os-app-config.h>
36#if defined(OS_USE_TRACE_SEMIHOSTING_DEBUG) || defined(OS_USE_TRACE_SEMIHOSTING_STDOUT)
42#if defined(OS_DEBUG_SEMIHOSTING_FAULTS)
43#error "Cannot debug semihosting using semihosting trace; use OS_USE_TRACE_ITM"
90#if defined(OS_USE_TRACE_SEMIHOSTING_DEBUG)
92#if !defined(OS_INTEGER_TRACE_SEMIHOSTING_BUFF_ARRAY_SIZE)
93#define OS_INTEGER_TRACE_SEMIHOSTING_BUFF_ARRAY_SIZE (16)
97 write (
const void* buf, std::size_t nbyte)
99 if (buf ==
nullptr || nbyte == 0)
104 const char* cbuf = (
const char*) buf;
108 if (cbuf[nbyte] ==
'\0')
122 std::size_t n = ((togo <
sizeof(tmp)) ? togo :
sizeof(tmp) - 1);
124 for (; i < n; ++i, ++cbuf)
137 return (ssize_t) nbyte;
140#elif defined(OS_USE_TRACE_SEMIHOSTING_STDOUT)
143 write (
const void* buf, std::size_t nbyte)
145 if (buf ==
nullptr || nbyte == 0)
160 block[0] = (
void*)
":tt";
161 block[1] = (
void*) 4;
163 block[2] = (
void*) (
sizeof(
":tt") - 1);
174 block[0] = (
void*) handle;
175 block[1] = (
void*) buf;
176 block[2] = (
void*) nbyte;
188 if (ret == (
int) nbyte)
194 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)