Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
kdb_main.c File Reference
#include <linux/ctype.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/kmsg_dump.h>
#include <linux/reboot.h>
#include <linux/sched.h>
#include <linux/sysrq.h>
#include <linux/smp.h>
#include <linux/utsname.h>
#include <linux/vmalloc.h>
#include <linux/atomic.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/kallsyms.h>
#include <linux/kgdb.h>
#include <linux/kdb.h>
#include <linux/notifier.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/nmi.h>
#include <linux/time.h>
#include <linux/ptrace.h>
#include <linux/sysctl.h>
#include <linux/cpu.h>
#include <linux/kdebug.h>
#include <linux/proc_fs.h>
#include <linux/uaccess.h>
#include <linux/slab.h>
#include "kdb_private.h"

Go to the source code of this file.

Data Structures

struct  _kdbmsg
 
struct  defcmd_set
 
struct  kdb_tm
 

Macros

#define GREP_LEN   256
 
#define KDB_BASE_CMD_MAX   50
 
#define for_each_kdbcmd(cmd, num)
 
#define KDBMSG(msgnum, text)   { KDB_##msgnum, text }
 
#define KDB_ENVBUFSIZE   512
 
#define KDB_CMD_HISTORY_COUNT   32
 
#define CMD_BUFLEN
 
#define MAXARGC   20
 
#define CTRL_P   16
 
#define CTRL_N   14
 
#define printable_char(c)   ({unsigned char __c = c; isascii(__c) && isprint(__c) ? __c : '.'; })
 
#define LOAD_INT(x)   ((x) >> FSHIFT)
 
#define LOAD_FRAC(x)   LOAD_INT(((x) & (FIXED_1-1)) * 100)
 
#define K(x)   ((x) << (PAGE_SHIFT - 10))
 
#define KDB_PCU(cpu)   0
 
#define kdb_command_extend   50 /* arbitrary */
 

Typedefs

typedef struct _kdbmsg kdbmsg_t
 

Functions

 EXPORT_SYMBOL (kdb_grepping_flag)
 
 EXPORT_SYMBOL (kdb_current_task)
 
struct task_structkdb_curr_task (int cpu)
 
charkdbgetenv (const char *match)
 
int kdbgetintenv (const char *match, int *value)
 
int kdbgetularg (const char *arg, unsigned long *value)
 
int kdbgetu64arg (const char *arg, u64 *value)
 
int kdb_set (int argc, const char **argv)
 
int kdbgetaddrarg (int argc, const char **argv, int *nextarg, unsigned long *value, long *offset, char **name)
 
int kdb_parse (const char *cmdstr)
 
void kdb_set_current_task (struct task_struct *p)
 
void kdb_print_state (const char *text, int value)
 
int kdb_main_loop (kdb_reason_t reason, kdb_reason_t reason2, int error, kdb_dbtrap_t db_result, struct pt_regs *regs)
 
 module_param_cb (enable_nmi,&kdb_param_ops_enable_nmi, NULL, 0600)
 
void kdb_ps_suppressed (void)
 
void kdb_ps1 (const struct task_struct *p)
 
int kdb_register_repeat (char *cmd, kdb_func_t func, char *usage, char *help, short minlen, kdb_repeat_t repeat)
 
 EXPORT_SYMBOL_GPL (kdb_register_repeat)
 
int kdb_register (char *cmd, kdb_func_t func, char *usage, char *help, short minlen)
 
 EXPORT_SYMBOL_GPL (kdb_register)
 
int kdb_unregister (char *cmd)
 
 EXPORT_SYMBOL_GPL (kdb_unregister)
 
void __init kdb_init (int lvl)
 

Variables

char kdb_grep_string [GREP_LEN]
 
int kdb_grepping_flag
 
int kdb_grep_leading
 
int kdb_grep_trailing
 
int kdb_flags
 
atomic_t kdb_event
 
int kdb_initial_cpu = -1
 
int kdb_nextline = 1
 
int kdb_state
 
struct task_structkdb_current_task
 
struct pt_regskdb_current_regs
 
const charkdb_diemsg
 

Macro Definition Documentation

#define CMD_BUFLEN
Value:
200 /* kdb_printf: max printline
* size == 256 */

Definition at line 752 of file kdb_main.c.

#define CTRL_N   14
#define CTRL_P   16
#define for_each_kdbcmd (   cmd,
  num 
)
Value:
for ((cmd) = kdb_base_commands, (num) = 0; \
num < kdb_max_commands; \
num++, num == KDB_BASE_CMD_MAX ? cmd = kdb_commands : cmd++)

Definition at line 84 of file kdb_main.c.

#define GREP_LEN   256

Definition at line 45 of file kdb_main.c.

#define K (   x)    ((x) << (PAGE_SHIFT - 10))
#define KDB_BASE_CMD_MAX   50

Definition at line 81 of file kdb_main.c.

#define KDB_CMD_HISTORY_COUNT   32

Definition at line 751 of file kdb_main.c.

#define kdb_command_extend   50 /* arbitrary */

Definition at line 2696 of file kdb_main.c.

#define KDB_ENVBUFSIZE   512
#define KDB_PCU (   cpu)    0
#define KDBMSG (   msgnum,
  text 
)    { KDB_##msgnum, text }

Definition at line 94 of file kdb_main.c.

#define LOAD_FRAC (   x)    LOAD_INT(((x) & (FIXED_1-1)) * 100)
#define LOAD_INT (   x)    ((x) >> FSHIFT)
#define MAXARGC   20

Definition at line 848 of file kdb_main.c.

#define printable_char (   c)    ({unsigned char __c = c; isascii(__c) && isprint(__c) ? __c : '.'; })

Typedef Documentation

Function Documentation

EXPORT_SYMBOL ( kdb_grepping_flag  )
EXPORT_SYMBOL ( kdb_current_task  )
EXPORT_SYMBOL_GPL ( kdb_register_repeat  )
EXPORT_SYMBOL_GPL ( kdb_register  )
EXPORT_SYMBOL_GPL ( kdb_unregister  )
struct task_struct* kdb_curr_task ( int  cpu)
read

Definition at line 180 of file kdb_main.c.

void __init kdb_init ( int  lvl)

Definition at line 2915 of file kdb_main.c.

int kdb_main_loop ( kdb_reason_t  reason,
kdb_reason_t  reason2,
int  error,
kdb_dbtrap_t  db_result,
struct pt_regs regs 
)

Definition at line 1334 of file kdb_main.c.

int kdb_parse ( const char cmdstr)

Definition at line 850 of file kdb_main.c.

void kdb_print_state ( const char text,
int  value 
)

Definition at line 1302 of file kdb_main.c.

void kdb_ps1 ( const struct task_struct p)

Definition at line 2255 of file kdb_main.c.

void kdb_ps_suppressed ( void  )

Definition at line 2221 of file kdb_main.c.

int kdb_register ( char cmd,
kdb_func_t  func,
char usage,
char help,
short  minlen 
)

Definition at line 2771 of file kdb_main.c.

int kdb_register_repeat ( char cmd,
kdb_func_t  func,
char usage,
char help,
short  minlen,
kdb_repeat_t  repeat 
)

Definition at line 2697 of file kdb_main.c.

int kdb_set ( int  argc,
const char **  argv 
)

Definition at line 352 of file kdb_main.c.

void kdb_set_current_task ( struct task_struct p)

Definition at line 1085 of file kdb_main.c.

int kdb_unregister ( char cmd)

Definition at line 2791 of file kdb_main.c.

int kdbgetaddrarg ( int  argc,
const char **  argv,
int nextarg,
unsigned long value,
long offset,
char **  name 
)

Definition at line 464 of file kdb_main.c.

char* kdbgetenv ( const char match)

Definition at line 199 of file kdb_main.c.

int kdbgetintenv ( const char match,
int value 
)

Definition at line 286 of file kdb_main.c.

int kdbgetu64arg ( const char arg,
u64 value 
)

Definition at line 329 of file kdb_main.c.

int kdbgetularg ( const char arg,
unsigned long value 
)

Definition at line 307 of file kdb_main.c.

module_param_cb ( enable_nmi  ,
kdb_param_ops_enable_nmi,
NULL  ,
0600   
)

Variable Documentation

struct pt_regs* kdb_current_regs

Definition at line 68 of file kdb_main.c.

struct task_struct* kdb_current_task

Definition at line 66 of file kdb_main.c.

const char* kdb_diemsg

Definition at line 70 of file kdb_main.c.

atomic_t kdb_event

Definition at line 56 of file kdb_main.c.

int kdb_flags

Definition at line 55 of file kdb_main.c.

int kdb_grep_leading

Definition at line 49 of file kdb_main.c.

char kdb_grep_string[GREP_LEN]

Definition at line 46 of file kdb_main.c.

int kdb_grep_trailing

Definition at line 50 of file kdb_main.c.

int kdb_grepping_flag

Definition at line 47 of file kdb_main.c.

int kdb_initial_cpu = -1

Definition at line 62 of file kdb_main.c.

int kdb_nextline = 1

Definition at line 63 of file kdb_main.c.

int kdb_state

Definition at line 64 of file kdb_main.c.