Pārlūkot izejas kodu

SDL_TriggerBreakppoint for riscv arch (both 32/64) version.

`ebreak` acts like int3 for x86, giving control of running process to debuggers.
David CARLIER 1 gadu atpakaļ
vecāks
revīzija
723bcd0a8b
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      include/SDL3/SDL_assert.h

+ 2 - 0
include/SDL3/SDL_assert.h

@@ -64,6 +64,8 @@ assert can have unique static variables associated with it.
     #define SDL_TriggerBreakpoint() __builtin_debugtrap()
 #elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
     #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
+#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
+    #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
 #elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) )  /* this might work on other ARM targets, but this is a known quantity... */
     #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
 #elif defined(__APPLE__) && defined(__arm__)