GDB (API)
Defines | Enumerations | Functions | Variables
/home/stan/gdb/src/gdb/i386-nat.c File Reference
#include "defs.h"
#include "i386-nat.h"
#include "breakpoint.h"
#include "command.h"
#include "gdbcmd.h"
#include "target.h"
#include "gdb_assert.h"
#include "inferior.h"

Go to the source code of this file.

Defines

#define TARGET_HAS_DR_LEN_8   (i386_dr_low.debug_register_length == 8)
#define DR_CONTROL_SHIFT   16
#define DR_CONTROL_SIZE   4
#define DR_RW_EXECUTE   (0x0) /* Break on instruction execution. */
#define DR_RW_WRITE   (0x1) /* Break on data writes. */
#define DR_RW_READ   (0x3) /* Break on data reads or writes. */
#define DR_RW_IORW   (0x2) /* Break on I/O reads or writes. */
#define DR_LEN_1   (0x0 << 2) /* 1-byte region watch or breakpoint. */
#define DR_LEN_2   (0x1 << 2) /* 2-byte region watch. */
#define DR_LEN_4   (0x3 << 2) /* 4-byte region watch. */
#define DR_LEN_8   (0x2 << 2) /* 8-byte region watch (AMD64). */
#define DR_LOCAL_ENABLE_SHIFT   0 /* Extra shift to the local enable bit. */
#define DR_GLOBAL_ENABLE_SHIFT   1 /* Extra shift to the global enable bit. */
#define DR_ENABLE_SIZE   2 /* Two enable bits per debug register. */
#define DR_LOCAL_SLOWDOWN   (0x100)
#define DR_GLOBAL_SLOWDOWN   (0x200)
#define DR_CONTROL_RESERVED   (0xFC00)
#define I386_DR_CONTROL_MASK   (~DR_CONTROL_RESERVED)
#define I386_DR_VACANT(state, i)   (((state)->dr_control_mirror & (3 << (DR_ENABLE_SIZE * (i)))) == 0)
#define I386_DR_LOCAL_ENABLE(state, i)
#define I386_DR_GLOBAL_ENABLE(state, i)
#define I386_DR_DISABLE(state, i)
#define I386_DR_SET_RW_LEN(state, i, rwlen)
#define I386_DR_GET_RW_LEN(dr7, i)
#define I386_DR_WATCH_MASK(i)   (1 << (i))
#define I386_DR_WATCH_HIT(dr6, i)   ((dr6) & (1 << (i)))
#define ALL_DEBUG_REGISTERS(i)   for (i = 0; i < DR_NADDR; i++)

Enumerations

enum  i386_wp_op_t { WP_INSERT, WP_REMOVE, WP_COUNT }

Functions

struct i386_debug_reg_statei386_debug_reg_state (pid_t pid)
void i386_forget_process (pid_t pid)
void i386_cleanup_dregs (void)
void i386_use_watchpoints (struct target_ops *t)
void i386_set_debug_register_length (int len)

Variables

struct i386_dr_low_type i386_dr_low

Define Documentation

#define ALL_DEBUG_REGISTERS (   i)    for (i = 0; i < DR_NADDR; i++)

Definition at line 154 of file i386-nat.c.

#define DR_CONTROL_RESERVED   (0xFC00)

Definition at line 100 of file i386-nat.c.

#define DR_CONTROL_SHIFT   16

Definition at line 49 of file i386-nat.c.

#define DR_CONTROL_SIZE   4

Definition at line 51 of file i386-nat.c.

#define DR_ENABLE_SIZE   2 /* Two enable bits per debug register. */

Definition at line 85 of file i386-nat.c.

#define DR_GLOBAL_ENABLE_SHIFT   1 /* Extra shift to the global enable bit. */

Definition at line 84 of file i386-nat.c.

#define DR_GLOBAL_SLOWDOWN   (0x200)

Definition at line 93 of file i386-nat.c.

#define DR_LEN_1   (0x0 << 2) /* 1-byte region watch or breakpoint. */

Definition at line 67 of file i386-nat.c.

#define DR_LEN_2   (0x1 << 2) /* 2-byte region watch. */

Definition at line 68 of file i386-nat.c.

#define DR_LEN_4   (0x3 << 2) /* 4-byte region watch. */

Definition at line 69 of file i386-nat.c.

#define DR_LEN_8   (0x2 << 2) /* 8-byte region watch (AMD64). */

Definition at line 70 of file i386-nat.c.

#define DR_LOCAL_ENABLE_SHIFT   0 /* Extra shift to the local enable bit. */

Definition at line 83 of file i386-nat.c.

#define DR_LOCAL_SLOWDOWN   (0x100)

Definition at line 92 of file i386-nat.c.

#define DR_RW_EXECUTE   (0x0) /* Break on instruction execution. */

Definition at line 54 of file i386-nat.c.

#define DR_RW_IORW   (0x2) /* Break on I/O reads or writes. */

Definition at line 62 of file i386-nat.c.

#define DR_RW_READ   (0x3) /* Break on data reads or writes. */

Definition at line 56 of file i386-nat.c.

#define DR_RW_WRITE   (0x1) /* Break on data writes. */

Definition at line 55 of file i386-nat.c.

Definition at line 105 of file i386-nat.c.

#define I386_DR_DISABLE (   state,
 
)
Value:
do { \
    (state)->dr_control_mirror &= \
      ~(3 << (DR_ENABLE_SIZE * (i))); \
  } while (0)

Definition at line 127 of file i386-nat.c.

#define I386_DR_GET_RW_LEN (   dr7,
 
)
Value:
(((dr7) \
    >> (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))) & 0x0f)

Definition at line 143 of file i386-nat.c.

#define I386_DR_GLOBAL_ENABLE (   state,
 
)
Value:
do { \
    (state)->dr_control_mirror |= \
      (1 << (DR_GLOBAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i))); \
  } while (0)

Definition at line 120 of file i386-nat.c.

#define I386_DR_LOCAL_ENABLE (   state,
 
)
Value:
do { \
    (state)->dr_control_mirror |= \
      (1 << (DR_LOCAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i))); \
  } while (0)

Definition at line 113 of file i386-nat.c.

#define I386_DR_SET_RW_LEN (   state,
  i,
  rwlen 
)
Value:
do { \
    (state)->dr_control_mirror &= \
      ~(0x0f << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))); \
    (state)->dr_control_mirror |= \
      ((rwlen) << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))); \
  } while (0)

Definition at line 134 of file i386-nat.c.

#define I386_DR_VACANT (   state,
 
)    (((state)->dr_control_mirror & (3 << (DR_ENABLE_SIZE * (i)))) == 0)

Definition at line 109 of file i386-nat.c.

#define I386_DR_WATCH_HIT (   dr6,
 
)    ((dr6) & (1 << (i)))

Definition at line 151 of file i386-nat.c.

#define I386_DR_WATCH_MASK (   i)    (1 << (i))

Definition at line 148 of file i386-nat.c.

#define TARGET_HAS_DR_LEN_8   (i386_dr_low.debug_register_length == 8)

Definition at line 44 of file i386-nat.c.


Enumeration Type Documentation

Enumerator:
WP_INSERT 
WP_REMOVE 
WP_COUNT 

Definition at line 258 of file i386-nat.c.


Function Documentation

void i386_cleanup_dregs ( void  )

Definition at line 302 of file i386-nat.c.

struct i386_debug_reg_state* i386_debug_reg_state ( pid_t  pid) [read]

Definition at line 224 of file i386-nat.c.

void i386_forget_process ( pid_t  pid)

Definition at line 232 of file i386-nat.c.

Definition at line 879 of file i386-nat.c.

void i386_use_watchpoints ( struct target_ops t)

Definition at line 861 of file i386-nat.c.


Variable Documentation

Definition at line 40 of file i386-nat.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines