3 Copyright (c) 1998-2001 Klaus P. Gerlicher
25 This file may be distributed under the terms of the GNU Public License.
29 ////////////////////////////////////////////////////
36 extern void NewInt31Handler(void);
38 void DeInstallTraceHook(void);
40 volatile ULONG OldInt1Handler
=0;
42 BOOLEAN
InstallTraceHook(void)
44 ULONG LocalInt1Handler
;
46 DPRINT((0,"InstallTraceHook(OldInt1Handler=%0.8x)...\n",OldInt1Handler
));
51 __asm__("mov $NewInt1Handler,%0"
52 :"=r" (LocalInt1Handler
)
55 OldInt1Handler
=SetGlobalInt(0x01,(ULONG
)LocalInt1Handler
);
61 //this asm function must be at least second in the file. otherwise gcc does not
62 //generate correct code.
67 testl $(1<<14),%eax\n\t \
68 jz exceptionnotsinglestep\n\t \
71 pushl $" STR(REASON_SINGLESTEP
) "\n\t \
72 jmp NewInt31Handler\n\t \
74 exceptionnotsinglestep:\n\t \
76 pushl $" STR(REASON_HARDWARE_BP
) "\n\t \
77 jmp NewInt31Handler\n\t \
80 void DeInstallTraceHook(void)
82 DPRINT((0,"DeInstallTraceHook(OldInt1Handler=%0.8x)...\n",OldInt1Handler
));
87 SetGlobalInt(0x01,(ULONG
)OldInt1Handler
);