Defines |
| #define | BUFMAX 400 |
| #define | NUMREGS 16 |
| #define | NUMREGBYTES (NUMREGS * 4) |
| #define | STACKSIZE 10000 |
| #define | SAVE_REGISTERS1() |
| #define | SAVE_ERRCODE() |
| #define | SAVE_REGISTERS2() |
| #define | CHECK_FAULT() |
| #define | CALL_HOOK() asm("call _remcomHandler"); |
| #define | BREAKPOINT() asm(" int $3"); |
Enumerations |
| enum | regnames {
EAX,
ECX,
EDX,
EBX,
ESP,
EBP,
ESI,
EDI,
PC,
PS,
CS,
SS,
DS,
ES,
FS,
GS
} |
Functions |
| void | putDebugChar () |
| int | getDebugChar () |
| void | exceptionHandler () |
| void | return_to_prog () |
| | asm (".text") |
| | asm (".globl _return_to_prog") |
| | asm ("_return_to_prog:") |
| | asm (" movw _registers+44, %ss") |
| | asm (" movl _registers+16, %esp") |
| | asm (" movl _registers+4, %ecx") |
| | asm (" movl _registers+8, %edx") |
| | asm (" movl _registers+12, %ebx") |
| | asm (" movl _registers+20, %ebp") |
| | asm (" movl _registers+24, %esi") |
| | asm (" movl _registers+28, %edi") |
| | asm (" movw _registers+48, %ds") |
| | asm (" movw _registers+52, %es") |
| | asm (" movw _registers+56, %fs") |
| | asm (" movw _registers+60, %gs") |
| | asm (" movl _registers+36, %eax") |
| | asm (" pushl %eax") |
| | asm (" movl _registers, %eax") |
| | asm ("ret") |
| | asm (" iret") |
| | asm ("mem_fault:") |
| | asm (" popl %eax") |
| | asm (" movl %eax, _gdb_i386errcode") |
| | asm (" popl %ecx") |
| | asm (" popl %edx") |
| | asm (" leave") |
| | asm (" pushl %edx") |
| | asm (" pushl %ecx") |
| | asm (" movl $0, %eax") |
| | asm (" movl %eax, _mem_fault_routine") |
| | asm ("iret") |
| void | _catchException3 () |
| | asm (".globl __catchException3") |
| | asm ("__catchException3:") |
| | asm ("pushl $3") |
| void | _catchException1 () |
| | asm (".globl __catchException1") |
| | asm ("__catchException1:") |
| | asm ("pushl $1") |
| void | _catchException0 () |
| | asm (".globl __catchException0") |
| | asm ("__catchException0:") |
| | asm ("pushl $0") |
| void | _catchException4 () |
| | asm (".globl __catchException4") |
| | asm ("__catchException4:") |
| | asm ("pushl $4") |
| void | _catchException5 () |
| | asm (".globl __catchException5") |
| | asm ("__catchException5:") |
| | asm ("pushl $5") |
| void | _catchException6 () |
| | asm (".globl __catchException6") |
| | asm ("__catchException6:") |
| | asm ("pushl $6") |
| void | _catchException7 () |
| | asm (".globl __catchException7") |
| | asm ("__catchException7:") |
| | asm ("pushl $7") |
| void | _catchException8 () |
| | asm (".globl __catchException8") |
| | asm ("__catchException8:") |
| | asm ("pushl $8") |
| void | _catchException9 () |
| | asm (".globl __catchException9") |
| | asm ("__catchException9:") |
| | asm ("pushl $9") |
| void | _catchException10 () |
| | asm (".globl __catchException10") |
| | asm ("__catchException10:") |
| | asm ("pushl $10") |
| void | _catchException12 () |
| | asm (".globl __catchException12") |
| | asm ("__catchException12:") |
| | asm ("pushl $12") |
| void | _catchException16 () |
| | asm (".globl __catchException16") |
| | asm ("__catchException16:") |
| | asm ("pushl $16") |
| void | _catchException13 () |
| | asm (".globl __catchException13") |
| | asm ("__catchException13:") |
| | asm ("pushl $13") |
| void | _catchException11 () |
| | asm (".globl __catchException11") |
| | asm ("__catchException11:") |
| | asm ("pushl $11") |
| void | _catchException14 () |
| | asm (".globl __catchException14") |
| | asm ("__catchException14:") |
| | asm ("pushl $14") |
| | asm ("_remcomHandler:") |
| | asm (" movl _stackPtr, %esp") |
| | asm (" call _handle_exception") |
| void | _returnFromException () |
| int | hex (char ch) |
| char * | getpacket (void) |
| void | putpacket (char *buffer) |
| void | debug_error (char *format) |
| void | set_mem_err (void) |
| int | get_char (char *addr) |
| void | set_char (char *addr, int val) |
| char * | mem2hex (char *mem, char *buf, int count, int may_fault) |
| char * | hex2mem (char *buf, char *mem, int count, int may_fault) |
| int | computeSignal (int exceptionVector) |
| int | hexToInt (char **ptr, int *intValue) |
| void | handle_exception (int exceptionVector) |
| void | set_debug_traps (void) |
| void | breakpoint (void) |
Variables |
| static char | initialized |
| int | remote_debug |
| static const char | hexchars [] = "0123456789abcdef" |
| int | registers [NUMREGS] |
| int | remcomStack [STACKSIZE/sizeof(int)] |
| static int * | stackPtr = &remcomStack[STACKSIZE/sizeof(int) - 1] |
| int | gdb_i386errcode |
| int | gdb_i386vector = -1 |
| static char | remcomInBuffer [BUFMAX] |
| static char | remcomOutBuffer [BUFMAX] |
| static void(*volatile | mem_fault_routine )() = NULL |
| static volatile int | mem_err = 0 |