14#pragma clang diagnostic ignored "-Wempty-translation-unit"
15#elif defined(__GNUC__)
16#pragma GCC diagnostic ignored "-Wold-style-cast"
17#pragma GCC diagnostic ignored "-Wcast-qual"
18#pragma GCC diagnostic ignored "-Wuseless-cast"
23#if defined(__ARM_EABI__)
29#if defined(OS_USE_OS_APP_CONFIG_H)
30#include <cmsis-plus/os-app-config.h>
33#if defined(OS_USE_TRACE_SEMIHOSTING_DEBUG) || defined(OS_USE_TRACE_SEMIHOSTING_STDOUT)
39#if defined(OS_DEBUG_SEMIHOSTING_FAULTS)
40#error "Cannot debug semihosting using semihosting trace; use OS_USE_TRACE_ITM"
87#if defined(OS_USE_TRACE_SEMIHOSTING_DEBUG)
89#if !defined(OS_INTEGER_TRACE_SEMIHOSTING_BUFF_ARRAY_SIZE)
90#define OS_INTEGER_TRACE_SEMIHOSTING_BUFF_ARRAY_SIZE (16)
94 write (
const void* buf, std::size_t nbyte)
96 if (buf ==
nullptr || nbyte == 0)
101 const char* cbuf = (
const char*) buf;
105 if (cbuf[nbyte] ==
'\0')
119 std::size_t n = ((togo <
sizeof(tmp)) ? togo :
sizeof(tmp) - 1);
121 for (; i < n; ++i, ++cbuf)
134 return (ssize_t) nbyte;
137#elif defined(OS_USE_TRACE_SEMIHOSTING_STDOUT)
140 write (
const void* buf, std::size_t nbyte)
142 if (buf ==
nullptr || nbyte == 0)
157 block[0] = (
void*)
":tt";
158 block[1] = (
void*) 4;
160 block[2] = (
void*) (
sizeof(
":tt") - 1);
171 block[0] = (
void*) handle;
172 block[1] = (
void*) buf;
173 block[2] = (
void*) nbyte;
185 if (ret == (
int) nbyte)
191 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)