Linux Kernel
3.7.1
|
#include <linux/spinlock.h>
#include <linux/kdebug.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/ptrace.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/kgdb.h>
#include <linux/init.h>
#include <linux/smp.h>
#include <linux/nmi.h>
#include <linux/hw_breakpoint.h>
#include <linux/uaccess.h>
#include <linux/memory.h>
#include <asm/debugreg.h>
#include <asm/apicdef.h>
#include <asm/apic.h>
#include <asm/nmi.h>
Go to the source code of this file.
Data Structures | |
struct | hw_breakpoint |
Functions | |
int | dbg_set_reg (int regno, void *mem, struct pt_regs *regs) |
char * | dbg_get_reg (int regno, void *mem, struct pt_regs *regs) |
void | sleeping_thread_to_gdb_regs (unsigned long *gdb_regs, struct task_struct *p) |
int | kgdb_arch_handle_exception (int e_vector, int signo, int err_code, char *remcomInBuffer, char *remcomOutBuffer, struct pt_regs *linux_regs) |
int | kgdb_ll_trap (int cmd, const char *str, struct pt_regs *regs, long err, int trap, int sig) |
int | kgdb_arch_init (void) |
void | kgdb_arch_late (void) |
void | kgdb_arch_exit (void) |
int | kgdb_skipexception (int exception, struct pt_regs *regs) |
unsigned long | kgdb_arch_pc (int exception, struct pt_regs *regs) |
void | kgdb_arch_set_pc (struct pt_regs *regs, unsigned long ip) |
int | kgdb_arch_set_breakpoint (struct kgdb_bkpt *bpt) |
int | kgdb_arch_remove_breakpoint (struct kgdb_bkpt *bpt) |
Variables | |
struct dbg_reg_def_t | dbg_reg_def [DBG_MAX_REG_NUM] |
struct kgdb_arch | arch_kgdb_ops |
int kgdb_arch_handle_exception | ( | int | e_vector, |
int | signo, | ||
int | err_code, | ||
char * | remcomInBuffer, | ||
char * | remcomOutBuffer, | ||
struct pt_regs * | linux_regs | ||
) |
kgdb_arch_handle_exception - Handle architecture specific GDB packets. : The error vector of the exception that happened. : The signal number of the exception that happened. : The error code of the exception that happened. : The buffer of the packet we have read. : The buffer of BUFMAX bytes to write a packet into. : The &struct pt_regs of the current process.
This function MUST handle the 'c' and 's' command packets, as well packets to set / remove a hardware breakpoint, if used. If there are additional packets which the hardware needs to handle, they are handled here. The code should return -1 if it wants to process more packets, and a %0 or %1 if it wants to exit from the kgdb callback.
kgdb_skipexception - Bail out of KGDB when we've been triggered.
Exception vector number : Current &struct pt_regs. |
On some architectures we need to skip a breakpoint exception when it occurs after a breakpoint has been removed.
Skip an int3 exception when it occurs after a breakpoint has been removed. Backtrack eip by 1 since the int3 would have caused it to increment by 1.
void sleeping_thread_to_gdb_regs | ( | unsigned long * | gdb_regs, |
struct task_struct * | p | ||
) |
sleeping_thread_to_gdb_regs - Convert ptrace regs to GDB regs : A pointer to hold the registers in the order GDB wants. : The &struct task_struct of the desired process.
Convert the register values of the sleeping process in to
the format that GDB expects. This function is called when kgdb does not have access to the &struct pt_regs and therefore it should fill the gdb registers with what has been saved in &struct thread_struct thread field during switch_to.
struct kgdb_arch arch_kgdb_ops |
struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] |