diff options
Diffstat (limited to 'kernel/debug/kdb/kdb_main.c')
| -rw-r--r-- | kernel/debug/kdb/kdb_main.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index 7b40c5f07dce..4121345498e0 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c | |||
| @@ -50,8 +50,7 @@ | |||
| 50 | static int kdb_cmd_enabled = CONFIG_KDB_DEFAULT_ENABLE; | 50 | static int kdb_cmd_enabled = CONFIG_KDB_DEFAULT_ENABLE; |
| 51 | module_param_named(cmd_enable, kdb_cmd_enabled, int, 0600); | 51 | module_param_named(cmd_enable, kdb_cmd_enabled, int, 0600); |
| 52 | 52 | ||
| 53 | #define GREP_LEN 256 | 53 | char kdb_grep_string[KDB_GREP_STRLEN]; |
| 54 | char kdb_grep_string[GREP_LEN]; | ||
| 55 | int kdb_grepping_flag; | 54 | int kdb_grepping_flag; |
| 56 | EXPORT_SYMBOL(kdb_grepping_flag); | 55 | EXPORT_SYMBOL(kdb_grepping_flag); |
| 57 | int kdb_grep_leading; | 56 | int kdb_grep_leading; |
| @@ -870,7 +869,7 @@ static void parse_grep(const char *str) | |||
| 870 | len = strlen(cp); | 869 | len = strlen(cp); |
| 871 | if (!len) | 870 | if (!len) |
| 872 | return; | 871 | return; |
| 873 | if (len >= GREP_LEN) { | 872 | if (len >= KDB_GREP_STRLEN) { |
| 874 | kdb_printf("search string too long\n"); | 873 | kdb_printf("search string too long\n"); |
| 875 | return; | 874 | return; |
| 876 | } | 875 | } |
| @@ -915,13 +914,12 @@ int kdb_parse(const char *cmdstr) | |||
| 915 | char *cp; | 914 | char *cp; |
| 916 | char *cpp, quoted; | 915 | char *cpp, quoted; |
| 917 | kdbtab_t *tp; | 916 | kdbtab_t *tp; |
| 918 | int i, escaped, ignore_errors = 0, check_grep; | 917 | int i, escaped, ignore_errors = 0, check_grep = 0; |
| 919 | 918 | ||
| 920 | /* | 919 | /* |
| 921 | * First tokenize the command string. | 920 | * First tokenize the command string. |
| 922 | */ | 921 | */ |
| 923 | cp = (char *)cmdstr; | 922 | cp = (char *)cmdstr; |
| 924 | kdb_grepping_flag = check_grep = 0; | ||
| 925 | 923 | ||
| 926 | if (KDB_FLAG(CMD_INTERRUPT)) { | 924 | if (KDB_FLAG(CMD_INTERRUPT)) { |
| 927 | /* Previous command was interrupted, newline must not | 925 | /* Previous command was interrupted, newline must not |
| @@ -1247,7 +1245,6 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, | |||
| 1247 | kdb_printf("due to NonMaskable Interrupt @ " | 1245 | kdb_printf("due to NonMaskable Interrupt @ " |
| 1248 | kdb_machreg_fmt "\n", | 1246 | kdb_machreg_fmt "\n", |
| 1249 | instruction_pointer(regs)); | 1247 | instruction_pointer(regs)); |
| 1250 | kdb_dumpregs(regs); | ||
| 1251 | break; | 1248 | break; |
| 1252 | case KDB_REASON_SSTEP: | 1249 | case KDB_REASON_SSTEP: |
| 1253 | case KDB_REASON_BREAK: | 1250 | case KDB_REASON_BREAK: |
| @@ -1281,6 +1278,9 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, | |||
| 1281 | */ | 1278 | */ |
| 1282 | kdb_nextline = 1; | 1279 | kdb_nextline = 1; |
| 1283 | KDB_STATE_CLEAR(SUPPRESS); | 1280 | KDB_STATE_CLEAR(SUPPRESS); |
| 1281 | kdb_grepping_flag = 0; | ||
| 1282 | /* ensure the old search does not leak into '/' commands */ | ||
| 1283 | kdb_grep_string[0] = '\0'; | ||
| 1284 | 1284 | ||
| 1285 | cmdbuf = cmd_cur; | 1285 | cmdbuf = cmd_cur; |
| 1286 | *cmdbuf = '\0'; | 1286 | *cmdbuf = '\0'; |
| @@ -2256,7 +2256,7 @@ static int kdb_cpu(int argc, const char **argv) | |||
| 2256 | /* | 2256 | /* |
| 2257 | * Validate cpunum | 2257 | * Validate cpunum |
| 2258 | */ | 2258 | */ |
| 2259 | if ((cpunum > NR_CPUS) || !kgdb_info[cpunum].enter_kgdb) | 2259 | if ((cpunum >= CONFIG_NR_CPUS) || !kgdb_info[cpunum].enter_kgdb) |
| 2260 | return KDB_BADCPUNUM; | 2260 | return KDB_BADCPUNUM; |
| 2261 | 2261 | ||
| 2262 | dbg_switch_cpu = cpunum; | 2262 | dbg_switch_cpu = cpunum; |
| @@ -2583,7 +2583,7 @@ static int kdb_summary(int argc, const char **argv) | |||
| 2583 | #define K(x) ((x) << (PAGE_SHIFT - 10)) | 2583 | #define K(x) ((x) << (PAGE_SHIFT - 10)) |
| 2584 | kdb_printf("\nMemTotal: %8lu kB\nMemFree: %8lu kB\n" | 2584 | kdb_printf("\nMemTotal: %8lu kB\nMemFree: %8lu kB\n" |
| 2585 | "Buffers: %8lu kB\n", | 2585 | "Buffers: %8lu kB\n", |
| 2586 | val.totalram, val.freeram, val.bufferram); | 2586 | K(val.totalram), K(val.freeram), K(val.bufferram)); |
| 2587 | return 0; | 2587 | return 0; |
| 2588 | } | 2588 | } |
| 2589 | 2589 | ||
