source: bootcd/isolinux/syslinux-6.03/gpxe/src/arch/x86_64/include/gdbmach.h

Last change on this file was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 1.1 KB
Line 
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#include <stdint.h>
14
15typedef unsigned long gdbreg_t;
16
17/* The register snapshot, this must be in sync with interrupt handler and the
18 * GDB protocol. */
19enum {
20        // STUB: don't expect this to work!
21        GDBMACH_EIP,
22        GDBMACH_EFLAGS,
23        GDBMACH_NREGS,
24        GDBMACH_SIZEOF_REGS = GDBMACH_NREGS * sizeof ( gdbreg_t )
25};
26
27/* Breakpoint types */
28enum {
29        GDBMACH_BPMEM,
30        GDBMACH_BPHW,
31        GDBMACH_WATCH,
32        GDBMACH_RWATCH,
33        GDBMACH_AWATCH,
34};
35
36static inline void gdbmach_set_pc ( gdbreg_t *regs, gdbreg_t pc ) {
37        regs [ GDBMACH_EIP ] = pc;
38}
39
40static inline void gdbmach_set_single_step ( gdbreg_t *regs, int step ) {
41        regs [ GDBMACH_EFLAGS ] &= ~( 1 << 8 ); /* Trace Flag (TF) */
42        regs [ GDBMACH_EFLAGS ] |= ( step << 8 );
43}
44
45static inline void gdbmach_breakpoint ( void ) {
46        __asm__ __volatile__ ( "int $3\n" );
47}
48
49extern int gdbmach_set_breakpoint ( int type, unsigned long addr, size_t len, int enable );
50
51#endif /* GDBMACH_H */
Note: See TracBrowser for help on using the repository browser.