ia32/amd64
[Debugging]


Files

file  debugger.h
file  debugger.c

Data Structures

struct  bpinfo_t

Defines

#define BKPOINTS_MAX   4
#define BKPOINT_INSTR   0x1
#define BKPOINT_WRITE   0x2
#define BKPOINT_READ_WRITE   0x4
#define BKPOINT_CHECK_ZERO   0x8
#define getip(x)   ((x)->eip)

Functions

void debugger_init (void)
int breakpoint_add (void *where, int flags, int curidx)
void breakpoint_del (int slot)
 SPINLOCK_INITIALIZE (bkpoint_lock)
static int cmd_print_breakpoints (cmd_arg_t *argv)
static int cmd_del_breakpoint (cmd_arg_t *argv)
static int cmd_add_breakpoint (cmd_arg_t *argv)
static void setup_dr (int curidx)
static void handle_exception (int slot, istate_t *istate)
static void debug_exception (int n, istate_t *istate)
static void debug_ipi (int n, istate_t *istate)

Variables

static bpinfo_t breakpoints [BKPOINTS_MAX]
static cmd_info_t bkpts_info
static cmd_arg_t del_argv
static cmd_info_t delbkpt_info
static cmd_arg_t add_argv
static cmd_info_t addbkpt_info
static cmd_arg_t addw_argv
static cmd_info_t addwatchp_info

Define Documentation

#define BKPOINT_CHECK_ZERO   0x8
 

Definition at line 47 of file debugger.h.

Referenced by before_thread_runs_arch(), and handle_exception().

#define BKPOINT_INSTR   0x1
 

Definition at line 43 of file debugger.h.

Referenced by breakpoint_add(), cmd_add_breakpoint(), handle_exception(), and setup_dr().

#define BKPOINT_READ_WRITE   0x4
 

Definition at line 45 of file debugger.h.

Referenced by breakpoint_add(), and setup_dr().

#define BKPOINT_WRITE   0x2
 

Definition at line 44 of file debugger.h.

Referenced by before_thread_runs_arch(), breakpoint_add(), cmd_add_breakpoint(), and setup_dr().

#define BKPOINTS_MAX   4
 

Definition at line 40 of file debugger.h.

Referenced by before_thread_runs_arch(), breakpoint_add(), cmd_del_breakpoint(), cmd_print_breakpoints(), debug_exception(), debug_ipi(), and debugger_init().

#define getip  )     ((x)->eip)
 

Definition at line 228 of file debugger.c.

Referenced by handle_exception().


Function Documentation

int breakpoint_add void *  where,
int  flags,
int  curidx
 

Enable hardware breakpoint

Parameters:
where Address of HW breakpoint
flags Type of breakpoint (EXECUTE, WRITE)
Returns:
Debug slot on success, -1 - no available HW breakpoint

Definition at line 181 of file debugger.c.

References ASSERT, BKPOINT_INSTR, BKPOINT_READ_WRITE, BKPOINT_WRITE, BKPOINTS_MAX, breakpoints, interrupts_disable(), interrupts_restore(), spinlock_lock, and spinlock_unlock().

Referenced by before_thread_runs_arch(), and cmd_add_breakpoint().

Here is the call graph for this function:

void breakpoint_del int  slot  ) 
 

Definition at line 255 of file debugger.c.

References bpinfo_t::address, breakpoints, interrupts_disable(), interrupts_restore(), NULL, setup_dr(), spinlock_lock, and spinlock_unlock().

Referenced by cmd_del_breakpoint().

Here is the call graph for this function:

static int cmd_add_breakpoint cmd_arg_t argv  )  [static]
 

Add new breakpoint to table

Definition at line 295 of file debugger.c.

References add_argv, BKPOINT_INSTR, BKPOINT_WRITE, breakpoint_add(), cmd_arg::intval, and printf().

Here is the call graph for this function:

int cmd_del_breakpoint cmd_arg_t argv  )  [static]
 

Remove breakpoint from table

Definition at line 284 of file debugger.c.

References BKPOINTS_MAX, breakpoint_del(), cmd_arg::intval, and printf().

Here is the call graph for this function:

int cmd_print_breakpoints cmd_arg_t argv  )  [static]
 

Print table of active breakpoints

Definition at line 105 of file debugger.c.

References BKPOINTS_MAX, breakpoints, get_symtab_entry(), and printf().

Here is the call graph for this function:

static void debug_exception int  n,
istate_t istate
[static]
 

Definition at line 316 of file debugger.c.

References BKPOINTS_MAX, handle_exception(), istate::rflags, and RFLAGS_RF.

Referenced by debugger_init().

Here is the call graph for this function:

static void debug_ipi int  n,
istate_t istate
[static]
 

Definition at line 340 of file debugger.c.

References BKPOINTS_MAX, setup_dr(), spinlock_lock, and spinlock_unlock().

Referenced by debugger_init().

Here is the call graph for this function:

void debugger_init void   ) 
 

Initialize debugger

Definition at line 352 of file debugger.c.

References addbkpt_info, addwatchp_info, BKPOINTS_MAX, bkpts_info, breakpoints, cmd_initialize(), cmd_register(), debug_exception(), debug_ipi(), delbkpt_info, exc_register(), cmd_info::name, NULL, panic, VECTOR_DEBUG, and VECTOR_DEBUG_IPI.

Referenced by arch_post_mm_init().

Here is the call graph for this function:

static void handle_exception int  slot,
istate_t istate
[static]
 

Definition at line 231 of file debugger.c.

References ASSERT, atomic_set(), BKPOINT_CHECK_ZERO, BKPOINT_INSTR, breakpoints, get_symtab_entry(), getip, haltstate, kconsole(), and printf().

Referenced by debug_exception().

Here is the call graph for this function:

static void setup_dr int  curidx  )  [static]
 

Definition at line 123 of file debugger.c.

References bpinfo_t::address, BKPOINT_INSTR, BKPOINT_READ_WRITE, BKPOINT_WRITE, breakpoints, and bpinfo_t::flags.

Referenced by breakpoint_del(), and debug_ipi().

SPINLOCK_INITIALIZE bkpoint_lock   ) 
 


Variable Documentation

cmd_arg_t add_argv [static]
 

Initial value:

 {
        .type = ARG_TYPE_INT
}

Definition at line 80 of file debugger.c.

Referenced by cmd_add_breakpoint().

cmd_info_t addbkpt_info [static]
 

Initial value:

 {
        .name = "addbkpt",
        .description = "addbkpt <&symbol> - new breakpoint.",
        .func = cmd_add_breakpoint,
        .argc = 1,
        .argv = &add_argv
}

Definition at line 83 of file debugger.c.

Referenced by debugger_init().

cmd_arg_t addw_argv [static]
 

Initial value:

 {
        .type = ARG_TYPE_INT
}

Definition at line 91 of file debugger.c.

cmd_info_t addwatchp_info [static]
 

Initial value:

 {
        .name = "addwatchp",
        .description = "addbwatchp <&symbol> - new write watchpoint.",
        .func = cmd_add_breakpoint,
        .argc = 1,
        .argv = &addw_argv
}

Definition at line 94 of file debugger.c.

Referenced by debugger_init().

cmd_info_t bkpts_info [static]
 

Initial value:

 {
        .name = "bkpts",
        .description = "Print breakpoint table.",
        .func = cmd_print_breakpoints,
        .argc = 0,
}

Definition at line 58 of file debugger.c.

Referenced by debugger_init().

bpinfo_t breakpoints[BKPOINTS_MAX] [static]
 

Definition at line 54 of file debugger.c.

Referenced by breakpoint_add(), breakpoint_del(), cmd_print_breakpoints(), debugger_init(), handle_exception(), and setup_dr().

cmd_arg_t del_argv [static]
 

Initial value:

 {
        .type = ARG_TYPE_INT
}

Definition at line 68 of file debugger.c.

cmd_info_t delbkpt_info [static]
 

Initial value:

 {
        .name = "delbkpt",
        .description = "delbkpt <number> - Delete breakpoint.",
        .func = cmd_del_breakpoint,
        .argc = 1,
        .argv = &del_argv
}

Definition at line 71 of file debugger.c.

Referenced by debugger_init().


Generated on Sun Jun 18 16:36:41 2006 for HelenOS Kernel (amd64) by  doxygen 1.4.6