feat: test des breakpoint par DRx
This commit is contained in:
parent
f07f637447
commit
b72b0c2f11
|
@ -24,3 +24,5 @@ int invalidop();
|
|||
int segfault();
|
||||
int int3();
|
||||
int generalfault();
|
||||
int breakpoint();
|
||||
void testing(void);
|
||||
|
|
|
@ -181,7 +181,14 @@ void exception0()
|
|||
|
||||
void exception1()
|
||||
{
|
||||
cpuerror("debug exception",NULL);
|
||||
cli();
|
||||
save_stack dump;
|
||||
exception_stack_noerror *current = getESP()+0x28+sizeof(save_stack);
|
||||
dump_cpu(&dump);
|
||||
dump.eip=current->eip;
|
||||
dump.cs=current->cs;
|
||||
dump.esp=(current+1);
|
||||
cpuerror("debug exception",&dump);
|
||||
}
|
||||
|
||||
void exception2()
|
||||
|
|
19
lib/shell.c
19
lib/shell.c
|
@ -28,7 +28,9 @@ static command commands[] = {
|
|||
{"INVALIDOP","", &invalidop},
|
||||
{"INT3" , "", &int3},
|
||||
{"GENERALFAULT" , "", &generalfault},
|
||||
{"SEGFAULT","", &segfault}
|
||||
{"SEGFAULT","", &segfault},
|
||||
{"BREAKPOINT","", &breakpoint},
|
||||
{"TESTING","", &testing}
|
||||
};
|
||||
|
||||
/*******************************************************************************/
|
||||
|
@ -62,6 +64,21 @@ void shell()
|
|||
}
|
||||
}
|
||||
|
||||
void testing(void)
|
||||
{
|
||||
print("Fonction de test !\r\n");
|
||||
}
|
||||
|
||||
/*******************************************************************************/
|
||||
/* Génère un breakpoint */
|
||||
int breakpoint()
|
||||
{
|
||||
print("Creation d'un breakpoint !\r\n");
|
||||
asm("movl %[address],%%dr0 \n \
|
||||
movl $0x00000003, %%eax\n \
|
||||
movl %%eax, %%dr7"::[address] "a" (&testing):);
|
||||
}
|
||||
|
||||
/*******************************************************************************/
|
||||
/* Génère une interruption 3 */
|
||||
int int3()
|
||||
|
|
Loading…
Reference in New Issue