Trace
semihosting itm segger-rtt
https://github.com/pokitoz/qemu-lm3s6965evb
https://github.com/pokitoz/qemu-lm3s6965evb/blob/master/start.c
https://github.com/iNvEr7/qemu-learn
Cortex-M3
链接参数中需要加入 -specs=nano.specs -specs=rdimon.specs
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
/* Static functions and constant data */ const int SYS_WRITE0 = 0x04; void semihost(int sys_id, const void *arg) { register int r0 __asm__ ("r0") = sys_id; register const void *r1 __asm__ ("r1") = arg; __asm__ volatile ("bkpt 0xab"); (void) r0; (void) r1; } void logPrint(const char* format, ...) { char buffer[256] = {'