Skip to content

Commit

Permalink
wutcrt: Add a trapword in case a debugger is initialized to allow deb…
Browse files Browse the repository at this point in the history
…ugging
  • Loading branch information
Maschell committed Jul 27, 2022
1 parent 9d7289c commit af63b71
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libraries/wutcrt/wut_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ void __fini_wut_stdcpp();
void __fini_wut_devoptab();
void __attribute__((weak)) __fini_wut_socket();

extern int OSIsDebuggerInitialized();

void __attribute__((weak))
__init_wut()
{
if (OSIsDebuggerInitialized()) {
asm("tw 0x1f, 30, 0");
}
__init_wut_newlib();
__init_wut_stdcpp();
__init_wut_devoptab();
Expand Down

0 comments on commit af63b71

Please sign in to comment.