ReactOS  0.4.14-dev-114-gc8cbd56
trace.c File Reference
#include "remods.h"
#include "precomp.h"
Include dependency graph for trace.c:

Go to the source code of this file.

Functions

void NewInt31Handler (void)
 
void DeInstallTraceHook (void)
 
BOOLEAN InstallTraceHook (void)
 
 __asm__ ("\n\t \ NewInt1Handler:\n\t \ pushl %eax\n\t \ movl %dr6,%eax\n\t \ testl $(1<<14),%eax\n\t \ jz exceptionnotsinglestep\n\t \ \n\t \ popl %eax\n\t \ pushl $" STR(REASON_SINGLESTEP) "\n\t \ jmp NewInt31Handler\n\t \ \n\t \ exceptionnotsinglestep:\n\t \ popl %eax\n\t \ pushl $" STR(REASON_HARDWARE_BP) "\n\t \ jmp NewInt31Handler\n\t \ ")
 

Variables

volatile ULONG OldInt1Handler =0
 

Function Documentation

◆ __asm__()

__asm__ ( "\n\t \NewInt1Handler:\n\t \ pushl %eax\n\t \ movl dr6,
%eax\n\t \ testl 1<< 14,
%eax\n\t \ jz exceptionnotsinglestep\n\t \\n\t \ popl %eax\n\t \ pushl $" STR(REASON_SINGLESTEP) "\n\t \ jmp NewInt31Handler\n\t \\n\t \exceptionnotsinglestep:\n\t \ popl %eax\n\t \ pushl $" STR(REASON_HARDWARE_BP) "\n\t \ jmp NewInt31Handler\n\t \"   
)

Referenced by InstallTraceHook().

◆ DeInstallTraceHook()

void DeInstallTraceHook ( void  )

Definition at line 80 of file trace.c.

81 {
82  DPRINT((0,"DeInstallTraceHook(OldInt1Handler=%0.8x)...\n",OldInt1Handler));
83 
84  MaskIrqs();
85  if(OldInt1Handler)
86  {
88  OldInt1Handler = 0;
89  }
90  UnmaskIrqs();
91 }
ULONG SetGlobalInt(ULONG dwInt, ULONG NewIntHandler)
Definition: hooks.c:95
void DPRINT(...)
Definition: polytest.cpp:61
void MaskIrqs(void)
Definition: hooks.c:68
volatile ULONG OldInt1Handler
Definition: trace.c:40
unsigned int ULONG
Definition: retypes.h:1
void UnmaskIrqs(void)
Definition: hooks.c:82

Referenced by CleanUpPICE().

◆ InstallTraceHook()

BOOLEAN InstallTraceHook ( void  )

Definition at line 42 of file trace.c.

43 {
44  ULONG LocalInt1Handler;
45 
46  DPRINT((0,"InstallTraceHook(OldInt1Handler=%0.8x)...\n",OldInt1Handler));
47 
48  MaskIrqs();
49  if(!OldInt1Handler)
50  {
51  __asm__("mov $NewInt1Handler,%0"
52  :"=r" (LocalInt1Handler)
53  :
54  :"eax");
55  OldInt1Handler=SetGlobalInt(0x01,(ULONG)LocalInt1Handler);
56  }
57  UnmaskIrqs();
58  return TRUE;
59 }
#define TRUE
Definition: types.h:120
ULONG SetGlobalInt(ULONG dwInt, ULONG NewIntHandler)
Definition: hooks.c:95
void DPRINT(...)
Definition: polytest.cpp:61
void MaskIrqs(void)
Definition: hooks.c:68
__asm__("\n\t \ NewInt1Handler:\n\t \ pushl %eax\n\t \ movl %dr6,%eax\n\t \ testl $(1<<14),%eax\n\t \ jz exceptionnotsinglestep\n\t \ \n\t \ popl %eax\n\t \ pushl $" STR(REASON_SINGLESTEP) "\n\t \ jmp NewInt31Handler\n\t \ \n\t \ exceptionnotsinglestep:\n\t \ popl %eax\n\t \ pushl $" STR(REASON_HARDWARE_BP) "\n\t \ jmp NewInt31Handler\n\t \ ")
volatile ULONG OldInt1Handler
Definition: trace.c:40
unsigned int ULONG
Definition: retypes.h:1
void UnmaskIrqs(void)
Definition: hooks.c:82

Referenced by InitPICE().

◆ NewInt31Handler()

void NewInt31Handler ( void  )

Variable Documentation

◆ OldInt1Handler

volatile ULONG OldInt1Handler =0

Definition at line 40 of file trace.c.

Referenced by DeInstallTraceHook(), and InstallTraceHook().