소스 검색

change(debugging): crash when makeing breakpoints

greatbridf 2 년 전
부모
커밋
50d68c0ff9
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      include/kernel_main.h

+ 7 - 4
include/kernel_main.h

@@ -1,10 +1,13 @@
 #pragma once
 #include <types/types.h>
 
-static inline void __break_point(void)
-{
-    asm volatile("xchgw %bx, %bx");
-}
+#define __crash() asm volatile("ud2")
+
+#ifdef __BOCHS_SYSTEM__
+#define __break_point() asm volatile("xchgw %bx, %bx")
+#else
+#define __break_point() __crash()
+#endif
 
 #define MAKE_BREAK_POINT() __break_point()