update for HEAD-2003050101
[reactos.git] / lib / ntdll / dbg / brkpoint.c
index f41af1a..46fe99a 100644 (file)
 /* INCLUDES *****************************************************************/
 
 #include <ddk/ntddk.h>
-
+#include <debug.h>
 
 /* FUNCTIONS *****************************************************************/
 
-VOID STDCALL DbgBreakPoint(VOID)
-{
-   __asm__("int $3\n\t");
-}
+#if 0
+/*
+ FIXME: DbgBreakPoint must not have a stack frame, but GCC doesn't support
+ __declspec(naked) yet
+*/
+__declspec(naked) VOID STDCALL DbgBreakPoint(VOID)
+{ __asm__(ASM_BREAKPOINT_STR); }
 
 VOID STDCALL DbgUserBreakPoint(VOID)
-{
-   __asm__("int $3\n\t");
-}
+{ __asm__(ASM_BREAKPOINT_STR); }
+#else
+#define DBG_BP_FUNC(__NAME__) \
+__asm__ \
+( \
+ "\n" \
+ ".global _" #__NAME__ "@0\n" \
+ "_" #__NAME__ "@0:\n" \
+ ASM_BREAKPOINT \
+ "ret $0\n" \
+)
+
+DBG_BP_FUNC(DbgBreakPoint);
+DBG_BP_FUNC(DbgUserBreakPoint);
+#endif
 
 /* EOF */