iPXE
gdbmach.h
Go to the documentation of this file.
1 #ifndef GDBMACH_H
2 #define GDBMACH_H
3 
4 /** @file
5  *
6  * GDB architecture specifics
7  *
8  * This file declares functions for manipulating the machine state and
9  * debugging context.
10  *
11  */
12 
13 FILE_SECBOOT ( FORBIDDEN );
14 
15 #include <stdint.h>
16 
17 typedef unsigned long gdbreg_t;
18 
19 /* The register snapshot, this must be in sync with interrupt handler and the
20  * GDB protocol. */
21 enum {
40 };
41 
42 /* Breakpoint types */
43 enum {
49 };
50 
51 /* Interrupt vectors */
52 extern void gdbmach_sigfpe ( void );
53 extern void gdbmach_sigtrap ( void );
54 extern void gdbmach_sigstkflt ( void );
55 extern void gdbmach_sigill ( void );
56 
57 static inline void gdbmach_set_pc ( gdbreg_t *regs, gdbreg_t pc ) {
58  regs [ GDBMACH_EIP ] = pc;
59 }
60 
61 static inline void gdbmach_set_single_step ( gdbreg_t *regs, int step ) {
62  regs [ GDBMACH_EFLAGS ] &= ~( 1 << 8 ); /* Trace Flag (TF) */
63  regs [ GDBMACH_EFLAGS ] |= ( step << 8 );
64 }
65 
66 static inline void gdbmach_breakpoint ( void ) {
67  __asm__ __volatile__ ( "int $3\n" );
68 }
69 
70 extern int gdbmach_set_breakpoint ( int type, unsigned long addr, size_t len, int enable );
71 
72 extern void gdbmach_init ( void );
73 
74 #endif /* GDBMACH_H */
void gdbmach_init(void)
Initialise GDB.
Definition: gdbmach.c:242
unsigned long gdbreg_t
Definition: gdbmach.h:17
uint32_t type
Operating system type.
Definition: ena.h:12
static void gdbmach_breakpoint(void)
Definition: gdbmach.h:66
FILE_SECBOOT(FORBIDDEN)
ring len
Length.
Definition: dwmac.h:231
int gdbmach_set_breakpoint(int type, unsigned long addr, size_t len, int enable)
Set hardware breakpoint.
Definition: gdbmach.c:134
uint32_t addr
Buffer address.
Definition: dwmac.h:20
__asm__ __volatile__("call *%9" :"=a"(result), "=c"(discard_ecx), "=d"(discard_edx) :"d"(0), "a"(code), "b"(0), "c"(in_phys), "D"(0), "S"(out_phys), "m"(hypercall))
void gdbmach_sigstkflt(void)
struct i386_regs regs
Definition: registers.h:15
void gdbmach_sigfpe(void)
void gdbmach_sigtrap(void)
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
void step(void)
Single-step a single process.
Definition: process.c:99
void gdbmach_sigill(void)
static void gdbmach_set_pc(gdbreg_t *regs, gdbreg_t pc)
Definition: gdbmach.h:57
static void gdbmach_set_single_step(gdbreg_t *regs, int step)
Definition: gdbmach.h:61