Commit 36dfea42 authored by Vincent's avatar Vincent Committed by Jason Wessel

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: default avatarVincent Stehlé <vincent.stehle@laposte.net>
Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
parent a37372f6
...@@ -486,11 +486,9 @@ static int kdb_bc(int argc, const char **argv) ...@@ -486,11 +486,9 @@ static int kdb_bc(int argc, const char **argv)
/* /*
* kdb_ss * kdb_ss
* *
* Process the 'ss' (Single Step) and 'ssb' (Single Step to Branch) * Process the 'ss' (Single Step) command.
* commands.
* *
* ss * ss
* ssb
* *
* Parameters: * Parameters:
* argc Argument count * argc Argument count
...@@ -498,35 +496,23 @@ static int kdb_bc(int argc, const char **argv) ...@@ -498,35 +496,23 @@ static int kdb_bc(int argc, const char **argv)
* Outputs: * Outputs:
* None. * None.
* Returns: * Returns:
* KDB_CMD_SS[B] for success, a kdb error if failure. * KDB_CMD_SS for success, a kdb error if failure.
* Locking: * Locking:
* None. * None.
* Remarks: * Remarks:
* *
* Set the arch specific option to trigger a debug trap after the next * Set the arch specific option to trigger a debug trap after the next
* instruction. * instruction.
*
* For 'ssb', set the trace flag in the debug trap handler
* after printing the current insn and return directly without
* invoking the kdb command processor, until a branch instruction
* is encountered.
*/ */
static int kdb_ss(int argc, const char **argv) static int kdb_ss(int argc, const char **argv)
{ {
int ssb = 0;
ssb = (strcmp(argv[0], "ssb") == 0);
if (argc != 0) if (argc != 0)
return KDB_ARGCOUNT; return KDB_ARGCOUNT;
/* /*
* Set trace flag and go. * Set trace flag and go.
*/ */
KDB_STATE_SET(DOING_SS); KDB_STATE_SET(DOING_SS);
if (ssb) {
KDB_STATE_SET(DOING_SSB);
return KDB_CMD_SSB;
}
return KDB_CMD_SS; return KDB_CMD_SS;
} }
...@@ -561,8 +547,6 @@ void __init kdb_initbptab(void) ...@@ -561,8 +547,6 @@ void __init kdb_initbptab(void)
kdb_register_repeat("ss", kdb_ss, "", kdb_register_repeat("ss", kdb_ss, "",
"Single Step", 1, KDB_REPEAT_NO_ARGS); "Single Step", 1, KDB_REPEAT_NO_ARGS);
kdb_register_repeat("ssb", kdb_ss, "",
"Single step to branch/call", 0, KDB_REPEAT_NO_ARGS);
/* /*
* Architecture dependent initialization. * Architecture dependent initialization.
*/ */
......
...@@ -114,7 +114,6 @@ int kdb_stub(struct kgdb_state *ks) ...@@ -114,7 +114,6 @@ int kdb_stub(struct kgdb_state *ks)
/* Remove any breakpoints as needed by kdb and clear single step */ /* Remove any breakpoints as needed by kdb and clear single step */
kdb_bp_remove(); kdb_bp_remove();
KDB_STATE_CLEAR(DOING_SS); KDB_STATE_CLEAR(DOING_SS);
KDB_STATE_CLEAR(DOING_SSB);
KDB_STATE_SET(PAGER); KDB_STATE_SET(PAGER);
/* zero out any offline cpu data */ /* zero out any offline cpu data */
for_each_present_cpu(i) { for_each_present_cpu(i) {
......
...@@ -1128,7 +1128,6 @@ void kdb_set_current_task(struct task_struct *p) ...@@ -1128,7 +1128,6 @@ void kdb_set_current_task(struct task_struct *p)
* KDB_CMD_GO User typed 'go'. * KDB_CMD_GO User typed 'go'.
* KDB_CMD_CPU User switched to another cpu. * KDB_CMD_CPU User switched to another cpu.
* KDB_CMD_SS Single step. * KDB_CMD_SS Single step.
* KDB_CMD_SSB Single step until branch.
*/ */
static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
kdb_dbtrap_t db_result) kdb_dbtrap_t db_result)
...@@ -1167,14 +1166,6 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, ...@@ -1167,14 +1166,6 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
kdb_printf("due to Debug @ " kdb_machreg_fmt "\n", kdb_printf("due to Debug @ " kdb_machreg_fmt "\n",
instruction_pointer(regs)); instruction_pointer(regs));
break; break;
case KDB_DB_SSB:
/*
* In the midst of ssb command. Just return.
*/
KDB_DEBUG_STATE("kdb_local 3", reason);
return KDB_CMD_SSB; /* Continue with SSB command */
break;
case KDB_DB_SS: case KDB_DB_SS:
break; break;
case KDB_DB_SSBPT: case KDB_DB_SSBPT:
...@@ -1297,7 +1288,6 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, ...@@ -1297,7 +1288,6 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
if (diag == KDB_CMD_GO if (diag == KDB_CMD_GO
|| diag == KDB_CMD_CPU || diag == KDB_CMD_CPU
|| diag == KDB_CMD_SS || diag == KDB_CMD_SS
|| diag == KDB_CMD_SSB
|| diag == KDB_CMD_KGDB) || diag == KDB_CMD_KGDB)
break; break;
...@@ -1384,12 +1374,6 @@ int kdb_main_loop(kdb_reason_t reason, kdb_reason_t reason2, int error, ...@@ -1384,12 +1374,6 @@ int kdb_main_loop(kdb_reason_t reason, kdb_reason_t reason2, int error,
break; break;
} }
if (result == KDB_CMD_SSB) {
KDB_STATE_SET(DOING_SS);
KDB_STATE_SET(DOING_SSB);
break;
}
if (result == KDB_CMD_KGDB) { if (result == KDB_CMD_KGDB) {
if (!KDB_STATE(DOING_KGDB)) if (!KDB_STATE(DOING_KGDB))
kdb_printf("Entering please attach debugger " kdb_printf("Entering please attach debugger "
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#define KDB_CMD_GO (-1001) #define KDB_CMD_GO (-1001)
#define KDB_CMD_CPU (-1002) #define KDB_CMD_CPU (-1002)
#define KDB_CMD_SS (-1003) #define KDB_CMD_SS (-1003)
#define KDB_CMD_SSB (-1004)
#define KDB_CMD_KGDB (-1005) #define KDB_CMD_KGDB (-1005)
/* Internal debug flags */ /* Internal debug flags */
...@@ -125,8 +124,6 @@ extern int kdb_state; ...@@ -125,8 +124,6 @@ extern int kdb_state;
* kdb control */ * kdb control */
#define KDB_STATE_HOLD_CPU 0x00000010 /* Hold this cpu inside kdb */ #define KDB_STATE_HOLD_CPU 0x00000010 /* Hold this cpu inside kdb */
#define KDB_STATE_DOING_SS 0x00000020 /* Doing ss command */ #define KDB_STATE_DOING_SS 0x00000020 /* Doing ss command */
#define KDB_STATE_DOING_SSB 0x00000040 /* Doing ssb command,
* DOING_SS is also set */
#define KDB_STATE_SSBPT 0x00000080 /* Install breakpoint #define KDB_STATE_SSBPT 0x00000080 /* Install breakpoint
* after one ss, independent of * after one ss, independent of
* DOING_SS */ * DOING_SS */
...@@ -191,7 +188,6 @@ extern void kdb_bp_remove(void); ...@@ -191,7 +188,6 @@ extern void kdb_bp_remove(void);
typedef enum { typedef enum {
KDB_DB_BPT, /* Breakpoint */ KDB_DB_BPT, /* Breakpoint */
KDB_DB_SS, /* Single-step trap */ KDB_DB_SS, /* Single-step trap */
KDB_DB_SSB, /* Single step to branch */
KDB_DB_SSBPT, /* Single step over breakpoint */ KDB_DB_SSBPT, /* Single step over breakpoint */
KDB_DB_NOBPT /* Spurious breakpoint */ KDB_DB_NOBPT /* Spurious breakpoint */
} kdb_dbtrap_t; } kdb_dbtrap_t;
......
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