Browse Source

change(debugging): crash when makeing breakpoints

greatbridf 2 năm trước cách đây
mục cha
commit
50d68c0ff9
1 tập tin đã thay đổi với 7 bổ sung4 xóa
  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()