Skip to content

Commit fcc5038

Browse files
committed
[compiler-rt][sanitizer] Add Windows MIPS32 support
1 parent 5676478 commit fcc5038

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_win.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ struct SuspendedThreadsListWindows final : public SuspendedThreadsList {
4949
# define SP_REG Esp
5050
# elif SANITIZER_ARM | SANITIZER_ARM64
5151
# define SP_REG Sp
52+
# elif SANITIZER_MIPS
53+
# define SP_REG IntSp
5254
# else
5355
# error Architecture not supported!
5456
# endif

compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ void BufferedStackTrace::UnwindSlow(uptr pc, void *context, u32 max_depth) {
7575
stack_frame.AddrPC.Offset = ctx.Pc;
7676
stack_frame.AddrFrame.Offset = ctx.R11;
7777
stack_frame.AddrStack.Offset = ctx.Sp;
78+
# elif SANITIZER_MIPS32
79+
int machine_type = IMAGE_FILE_MACHINE_R4000;
80+
stack_frame.AddrPC.Offset = ctx.Fir;
81+
stack_frame.AddrFrame.Offset = ctx.IntS8;
82+
stack_frame.AddrStack.Offset = ctx.IntSp;
7883
# else
7984
int machine_type = IMAGE_FILE_MACHINE_I386;
8085
stack_frame.AddrPC.Offset = ctx.Eip;

compiler-rt/lib/sanitizer_common/sanitizer_win.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,9 @@ void SignalContext::InitPcSpBp() {
10111011
# if SANITIZER_ARM
10121012
bp = (uptr)context_record->R11;
10131013
sp = (uptr)context_record->Sp;
1014+
# elif SANITIZER_MIPS32
1015+
bp = (uptr)context_record->IntS8;
1016+
sp = (uptr)context_record->IntSp;
10141017
# else
10151018
bp = (uptr)context_record->Ebp;
10161019
sp = (uptr)context_record->Esp;

0 commit comments

Comments
 (0)