aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/debug
diff options
context:
space:
mode:
authorVincent <vincent.stehle@laposte.net>2013-02-12 05:34:15 -0500
committerJason Wessel <jason.wessel@windriver.com>2013-03-02 09:52:20 -0500
commit36dfea42cc35509b481377980338cc3b89d79256 (patch)
tree0f01cb90bf908844ab855c155421c083f654d383 /kernel/debug
parenta37372f6c3c03dc7613eaae8bb3458c8068f5fff (diff)
kdb: Remove unhandled ssb command
The 'ssb' command can only be handled when we have a disassembler, to check for branches, so remove the 'ssb' command for now. Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'kernel/debug')
-rw-r--r--kernel/debug/kdb/kdb_bp.c20
-rw-r--r--kernel/debug/kdb/kdb_debugger.c1
-rw-r--r--kernel/debug/kdb/kdb_main.c16
-rw-r--r--kernel/debug/kdb/kdb_private.h4
4 files changed, 2 insertions, 39 deletions
diff --git a/kernel/debug/kdb/kdb_bp.c b/kernel/debug/kdb/kdb_bp.c
index 8418c2f8ec5d..70a504601dc3 100644
--- a/kernel/debug/kdb/kdb_bp.c
+++ b/kernel/debug/kdb/kdb_bp.c
@@ -486,11 +486,9 @@ static int kdb_bc(int argc, const char **argv)
486/* 486/*
487 * kdb_ss 487 * kdb_ss
488 * 488 *
489 * Process the 'ss' (Single Step) and 'ssb' (Single Step to Branch) 489 * Process the 'ss' (Single Step) command.
490 * commands.
491 * 490 *
492 * ss 491 * ss
493 * ssb
494 * 492 *
495 * Parameters: 493 * Parameters:
496 * argc Argument count 494 * argc Argument count
@@ -498,35 +496,23 @@ static int kdb_bc(int argc, const char **argv)
498 * Outputs: 496 * Outputs:
499 * None. 497 * None.
500 * Returns: 498 * Returns:
501 * KDB_CMD_SS[B] for success, a kdb error if failure. 499 * KDB_CMD_SS for success, a kdb error if failure.
502 * Locking: 500 * Locking:
503 * None. 501 * None.
504 * Remarks: 502 * Remarks:
505 * 503 *
506 * Set the arch specific option to trigger a debug trap after the next 504 * Set the arch specific option to trigger a debug trap after the next
507 * instruction. 505 * instruction.
508 *
509 * For 'ssb', set the trace flag in the debug trap handler
510 * after printing the current insn and return directly without
511 * invoking the kdb command processor, until a branch instruction
512 * is encountered.
513 */ 506 */
514 507
515static int kdb_ss(int argc, const char **argv) 508static int kdb_ss(int argc, const char **argv)
516{ 509{
517 int ssb = 0;
518
519 ssb = (strcmp(argv[0], "ssb") == 0);
520 if (argc != 0) 510 if (argc != 0)
521 return KDB_ARGCOUNT; 511 return KDB_ARGCOUNT;
522 /* 512 /*
523 * Set trace flag and go. 513 * Set trace flag and go.
524 */ 514 */
525 KDB_STATE_SET(DOING_SS); 515 KDB_STATE_SET(DOING_SS);
526 if (ssb) {
527 KDB_STATE_SET(DOING_SSB);
528 return KDB_CMD_SSB;
529 }
530 return KDB_CMD_SS; 516 return KDB_CMD_SS;
531} 517}
532 518
@@ -561,8 +547,6 @@ void __init kdb_initbptab(void)
561 547
562 kdb_register_repeat("ss", kdb_ss, "", 548 kdb_register_repeat("ss", kdb_ss, "",
563 "Single Step", 1, KDB_REPEAT_NO_ARGS); 549 "Single Step", 1, KDB_REPEAT_NO_ARGS);
564 kdb_register_repeat("ssb", kdb_ss, "",
565 "Single step to branch/call", 0, KDB_REPEAT_NO_ARGS);
566 /* 550 /*
567 * Architecture dependent initialization. 551 * Architecture dependent initialization.
568 */ 552 */
diff --git a/kernel/debug/kdb/kdb_debugger.c b/kernel/debug/kdb/kdb_debugger.c
index d04a6ce2d3b7..328d18ef31e4 100644
--- a/kernel/debug/kdb/kdb_debugger.c
+++ b/kernel/debug/kdb/kdb_debugger.c
@@ -114,7 +114,6 @@ int kdb_stub(struct kgdb_state *ks)
114 /* Remove any breakpoints as needed by kdb and clear single step */ 114 /* Remove any breakpoints as needed by kdb and clear single step */
115 kdb_bp_remove(); 115 kdb_bp_remove();
116 KDB_STATE_CLEAR(DOING_SS); 116 KDB_STATE_CLEAR(DOING_SS);
117 KDB_STATE_CLEAR(DOING_SSB);
118 KDB_STATE_SET(PAGER); 117 KDB_STATE_SET(PAGER);
119 /* zero out any offline cpu data */ 118 /* zero out any offline cpu data */
120 for_each_present_cpu(i) { 119 for_each_present_cpu(i) {
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index 496f596aa807..00eb8f7fbf41 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -1128,7 +1128,6 @@ void kdb_set_current_task(struct task_struct *p)
1128 * KDB_CMD_GO User typed 'go'. 1128 * KDB_CMD_GO User typed 'go'.
1129 * KDB_CMD_CPU User switched to another cpu. 1129 * KDB_CMD_CPU User switched to another cpu.
1130 * KDB_CMD_SS Single step. 1130 * KDB_CMD_SS Single step.
1131 * KDB_CMD_SSB Single step until branch.
1132 */ 1131 */
1133static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, 1132static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
1134 kdb_dbtrap_t db_result) 1133 kdb_dbtrap_t db_result)
@@ -1167,14 +1166,6 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
1167 kdb_printf("due to Debug @ " kdb_machreg_fmt "\n", 1166 kdb_printf("due to Debug @ " kdb_machreg_fmt "\n",
1168 instruction_pointer(regs)); 1167 instruction_pointer(regs));
1169 break; 1168 break;
1170 case KDB_DB_SSB:
1171 /*
1172 * In the midst of ssb command. Just return.
1173 */
1174 KDB_DEBUG_STATE("kdb_local 3", reason);
1175 return KDB_CMD_SSB; /* Continue with SSB command */
1176
1177 break;
1178 case KDB_DB_SS: 1169 case KDB_DB_SS:
1179 break; 1170 break;
1180 case KDB_DB_SSBPT: 1171 case KDB_DB_SSBPT:
@@ -1297,7 +1288,6 @@ do_full_getstr:
1297 if (diag == KDB_CMD_GO 1288 if (diag == KDB_CMD_GO
1298 || diag == KDB_CMD_CPU 1289 || diag == KDB_CMD_CPU
1299 || diag == KDB_CMD_SS 1290 || diag == KDB_CMD_SS
1300 || diag == KDB_CMD_SSB
1301 || diag == KDB_CMD_KGDB) 1291 || diag == KDB_CMD_KGDB)
1302 break; 1292 break;
1303 1293
@@ -1384,12 +1374,6 @@ int kdb_main_loop(kdb_reason_t reason, kdb_reason_t reason2, int error,
1384 break; 1374 break;
1385 } 1375 }
1386 1376
1387 if (result == KDB_CMD_SSB) {
1388 KDB_STATE_SET(DOING_SS);
1389 KDB_STATE_SET(DOING_SSB);
1390 break;
1391 }
1392
1393 if (result == KDB_CMD_KGDB) { 1377 if (result == KDB_CMD_KGDB) {
1394 if (!KDB_STATE(DOING_KGDB)) 1378 if (!KDB_STATE(DOING_KGDB))
1395 kdb_printf("Entering please attach debugger " 1379 kdb_printf("Entering please attach debugger "
diff --git a/kernel/debug/kdb/kdb_private.h b/kernel/debug/kdb/kdb_private.h
index 392ec6a25844..7afd3c8c41d5 100644
--- a/kernel/debug/kdb/kdb_private.h
+++ b/kernel/debug/kdb/kdb_private.h
@@ -19,7 +19,6 @@
19#define KDB_CMD_GO (-1001) 19#define KDB_CMD_GO (-1001)
20#define KDB_CMD_CPU (-1002) 20#define KDB_CMD_CPU (-1002)
21#define KDB_CMD_SS (-1003) 21#define KDB_CMD_SS (-1003)
22#define KDB_CMD_SSB (-1004)
23#define KDB_CMD_KGDB (-1005) 22#define KDB_CMD_KGDB (-1005)
24 23
25/* Internal debug flags */ 24/* Internal debug flags */
@@ -125,8 +124,6 @@ extern int kdb_state;
125 * kdb control */ 124 * kdb control */
126#define KDB_STATE_HOLD_CPU 0x00000010 /* Hold this cpu inside kdb */ 125#define KDB_STATE_HOLD_CPU 0x00000010 /* Hold this cpu inside kdb */
127#define KDB_STATE_DOING_SS 0x00000020 /* Doing ss command */ 126#define KDB_STATE_DOING_SS 0x00000020 /* Doing ss command */
128#define KDB_STATE_DOING_SSB 0x00000040 /* Doing ssb command,
129 * DOING_SS is also set */
130#define KDB_STATE_SSBPT 0x00000080 /* Install breakpoint 127#define KDB_STATE_SSBPT 0x00000080 /* Install breakpoint
131 * after one ss, independent of 128 * after one ss, independent of
132 * DOING_SS */ 129 * DOING_SS */
@@ -191,7 +188,6 @@ extern void kdb_bp_remove(void);
191typedef enum { 188typedef enum {
192 KDB_DB_BPT, /* Breakpoint */ 189 KDB_DB_BPT, /* Breakpoint */
193 KDB_DB_SS, /* Single-step trap */ 190 KDB_DB_SS, /* Single-step trap */
194 KDB_DB_SSB, /* Single step to branch */
195 KDB_DB_SSBPT, /* Single step over breakpoint */ 191 KDB_DB_SSBPT, /* Single step over breakpoint */
196 KDB_DB_NOBPT /* Spurious breakpoint */ 192 KDB_DB_NOBPT /* Spurious breakpoint */
197} kdb_dbtrap_t; 193} kdb_dbtrap_t;