Commit e3e2aaf7 authored by Jason Wessel's avatar Jason Wessel Committed by Ingo Molnar

kgdb: add documentation

Add in the kgdb documentation for kgdb.
Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 4a1b5502
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \
kernel-hacking.xml kernel-locking.xml deviceiobook.xml \ kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
procfs-guide.xml writing_usb_driver.xml networking.xml \ procfs-guide.xml writing_usb_driver.xml networking.xml \
kernel-api.xml filesystems.xml lsm.xml usb.xml \ kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml
......
This diff is collapsed.
...@@ -2319,6 +2319,12 @@ L: linux-kernel@vger.kernel.org ...@@ -2319,6 +2319,12 @@ L: linux-kernel@vger.kernel.org
L: kexec@lists.infradead.org L: kexec@lists.infradead.org
S: Maintained S: Maintained
KGDB
P: Jason Wessel
M: jason.wessel@windriver.com
L: kgdb-bugreport@lists.sourceforge.net
S: Maintained
KPROBES KPROBES
P: Ananth N Mavinakayanahalli P: Ananth N Mavinakayanahalli
M: ananth@in.ibm.com M: ananth@in.ibm.com
......
...@@ -22,31 +22,34 @@ ...@@ -22,31 +22,34 @@
struct pt_regs; struct pt_regs;
/* /**
* kgdb_skipexception - Bail out of KGDB when we've been triggered. * kgdb_skipexception - (optional) exit kgdb_handle_exception early
* @exception: Exception vector number * @exception: Exception vector number
* @regs: Current &struct pt_regs. * @regs: Current &struct pt_regs.
* *
* On some architectures we need to skip a breakpoint exception when * On some architectures it is required to skip a breakpoint
* it occurs after a breakpoint has been removed. * exception when it occurs after a breakpoint has been removed.
* This can be implemented in the architecture specific portion of
* for kgdb.
*/ */
extern int kgdb_skipexception(int exception, struct pt_regs *regs); extern int kgdb_skipexception(int exception, struct pt_regs *regs);
/* /**
* kgdb_post_primary_code - Save error vector/code numbers. * kgdb_post_primary_code - (optional) Save error vector/code numbers.
* @regs: Original pt_regs. * @regs: Original pt_regs.
* @e_vector: Original error vector. * @e_vector: Original error vector.
* @err_code: Original error code. * @err_code: Original error code.
* *
* This is needed on architectures which support SMP and KGDB. * This is usually needed on architectures which support SMP and
* This function is called after all the secondary cpus have been put * KGDB. This function is called after all the secondary cpus have
* to a know spin state and the primary CPU has control over KGDB. * been put to a know spin state and the primary CPU has control over
* KGDB.
*/ */
extern void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, extern void kgdb_post_primary_code(struct pt_regs *regs, int e_vector,
int err_code); int err_code);
/* /**
* kgdb_disable_hw_debug - Disable hardware debugging while we in kgdb. * kgdb_disable_hw_debug - (optional) Disable hardware debugging hook
* @regs: Current &struct pt_regs. * @regs: Current &struct pt_regs.
* *
* This function will be called if the particular architecture must * This function will be called if the particular architecture must
...@@ -59,7 +62,14 @@ struct tasklet_struct; ...@@ -59,7 +62,14 @@ struct tasklet_struct;
struct task_struct; struct task_struct;
struct uart_port; struct uart_port;
/* To enter the debugger explicitly. */ /**
* kgdb_breakpoint - compiled in breakpoint
*
* This will be impelmented a static inline per architecture. This
* function is called by the kgdb core to execute an architecture
* specific trap to cause kgdb to enter the exception processing.
*
*/
void kgdb_breakpoint(void); void kgdb_breakpoint(void);
extern int kgdb_connected; extern int kgdb_connected;
...@@ -102,7 +112,7 @@ struct kgdb_bkpt { ...@@ -102,7 +112,7 @@ struct kgdb_bkpt {
* Functions each KGDB-supporting architecture must provide: * Functions each KGDB-supporting architecture must provide:
*/ */
/* /**
* kgdb_arch_init - Perform any architecture specific initalization. * kgdb_arch_init - Perform any architecture specific initalization.
* *
* This function will handle the initalization of any architecture * This function will handle the initalization of any architecture
...@@ -110,7 +120,7 @@ struct kgdb_bkpt { ...@@ -110,7 +120,7 @@ struct kgdb_bkpt {
*/ */
extern int kgdb_arch_init(void); extern int kgdb_arch_init(void);
/* /**
* kgdb_arch_exit - Perform any architecture specific uninitalization. * kgdb_arch_exit - Perform any architecture specific uninitalization.
* *
* This function will handle the uninitalization of any architecture * This function will handle the uninitalization of any architecture
...@@ -118,7 +128,7 @@ extern int kgdb_arch_init(void); ...@@ -118,7 +128,7 @@ extern int kgdb_arch_init(void);
*/ */
extern void kgdb_arch_exit(void); extern void kgdb_arch_exit(void);
/* /**
* pt_regs_to_gdb_regs - Convert ptrace regs to GDB regs * pt_regs_to_gdb_regs - Convert ptrace regs to GDB regs
* @gdb_regs: A pointer to hold the registers in the order GDB wants. * @gdb_regs: A pointer to hold the registers in the order GDB wants.
* @regs: The &struct pt_regs of the current process. * @regs: The &struct pt_regs of the current process.
...@@ -128,7 +138,7 @@ extern void kgdb_arch_exit(void); ...@@ -128,7 +138,7 @@ extern void kgdb_arch_exit(void);
*/ */
extern void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs); extern void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs);
/* /**
* sleeping_thread_to_gdb_regs - Convert ptrace regs to GDB regs * sleeping_thread_to_gdb_regs - Convert ptrace regs to GDB regs
* @gdb_regs: A pointer to hold the registers in the order GDB wants. * @gdb_regs: A pointer to hold the registers in the order GDB wants.
* @p: The &struct task_struct of the desired process. * @p: The &struct task_struct of the desired process.
...@@ -143,7 +153,7 @@ extern void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs); ...@@ -143,7 +153,7 @@ extern void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs);
extern void extern void
sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p); sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p);
/* /**
* gdb_regs_to_pt_regs - Convert GDB regs to ptrace regs. * gdb_regs_to_pt_regs - Convert GDB regs to ptrace regs.
* @gdb_regs: A pointer to hold the registers we've received from GDB. * @gdb_regs: A pointer to hold the registers we've received from GDB.
* @regs: A pointer to a &struct pt_regs to hold these values in. * @regs: A pointer to a &struct pt_regs to hold these values in.
...@@ -153,7 +163,7 @@ sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p); ...@@ -153,7 +163,7 @@ sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p);
*/ */
extern void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs); extern void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs);
/* /**
* kgdb_arch_handle_exception - Handle architecture specific GDB packets. * kgdb_arch_handle_exception - Handle architecture specific GDB packets.
* @vector: The error vector of the exception that happened. * @vector: The error vector of the exception that happened.
* @signo: The signal number of the exception that happened. * @signo: The signal number of the exception that happened.
...@@ -175,7 +185,7 @@ kgdb_arch_handle_exception(int vector, int signo, int err_code, ...@@ -175,7 +185,7 @@ kgdb_arch_handle_exception(int vector, int signo, int err_code,
char *remcom_out_buffer, char *remcom_out_buffer,
struct pt_regs *regs); struct pt_regs *regs);
/* /**
* kgdb_roundup_cpus - Get other CPUs into a holding pattern * kgdb_roundup_cpus - Get other CPUs into a holding pattern
* @flags: Current IRQ state * @flags: Current IRQ state
* *
...@@ -198,7 +208,7 @@ extern int kgdb_validate_break_address(unsigned long addr); ...@@ -198,7 +208,7 @@ extern int kgdb_validate_break_address(unsigned long addr);
extern int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr); extern int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr);
extern int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle); extern int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle);
/* /**
* struct kgdb_arch - Describe architecture specific values. * struct kgdb_arch - Describe architecture specific values.
* @gdb_bpt_instr: The instruction to trigger a breakpoint. * @gdb_bpt_instr: The instruction to trigger a breakpoint.
* @flags: Flags for the breakpoint, currently just %KGDB_HW_BREAKPOINT. * @flags: Flags for the breakpoint, currently just %KGDB_HW_BREAKPOINT.
...@@ -227,7 +237,7 @@ struct kgdb_arch { ...@@ -227,7 +237,7 @@ struct kgdb_arch {
void (*correct_hw_break)(void); void (*correct_hw_break)(void);
}; };
/* /**
* struct kgdb_io - Describe the interface for an I/O driver to talk with KGDB. * struct kgdb_io - Describe the interface for an I/O driver to talk with KGDB.
* @name: Name of the I/O driver. * @name: Name of the I/O driver.
* @read_char: Pointer to a function that will return one char. * @read_char: Pointer to a function that will return one char.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment