Bläddra i källkod

libobs: Add ARM64 support to Windows crash handler

Adjust obs-win-crash-handler.c to handle instruction pointers and
stack traces, improving crash reporting on ARM64 systems.
thirumalai-qcom 1 år sedan
förälder
incheckning
147d332de3
1 ändrade filer med 7 tillägg och 1 borttagningar
  1. 7 1
      libobs/obs-win-crash-handler.c

+ 7 - 1
libobs/obs-win-crash-handler.c

@@ -138,7 +138,13 @@ static inline bool get_dbghelp_imports(struct exception_handler_data *data)
 
 static inline void init_instruction_data(struct stack_trace *trace)
 {
-#ifdef _WIN64
+#if defined(_M_ARM64)
+	trace->instruction_ptr = trace->context.Pc;
+	trace->frame.AddrPC.Offset = trace->instruction_ptr;
+	trace->frame.AddrFrame.Offset = trace->context.Fp;
+	trace->frame.AddrStack.Offset = trace->context.Sp;
+	trace->image_type = IMAGE_FILE_MACHINE_ARM64;
+#elif defined(_WIN64)
 	trace->instruction_ptr = trace->context.Rip;
 	trace->frame.AddrPC.Offset = trace->instruction_ptr;
 	trace->frame.AddrFrame.Offset = trace->context.Rbp;