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 authored and fincs committed Jul 27, 2022
1 parent 215adf3 commit 028899e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/wutcrt/wut_crt.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <coreinit/debug.h>
void __init_wut_newlib();
void __init_wut_stdcpp();
void __init_wut_devoptab();
Expand All @@ -11,6 +12,9 @@ void __attribute__((weak)) __fini_wut_socket();
void __attribute__((weak))
__init_wut()
{
if (OSIsDebuggerInitialized()) {
__asm__ __volatile__("tw 0x1f, 30, 0");
}
__init_wut_newlib();
__init_wut_stdcpp();
__init_wut_devoptab();
Expand Down

0 comments on commit 028899e

Please sign in to comment.