kdb: Remove unhandled ssb command
authorVincent <vincent.stehle@laposte.net>
Tue, 12 Feb 2013 10:34:15 +0000 (11:34 +0100)
committerJason Wessel <jason.wessel@windriver.com>
Sat, 2 Mar 2013 14:52:20 +0000 (08:52 -0600)
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>
kernel/debug/kdb/kdb_bp.c
kernel/debug/kdb/kdb_debugger.c
kernel/debug/kdb/kdb_main.c
kernel/debug/kdb/kdb_private.h

index 8418c2f8ec5dd255d18794ca13cf895a3b588a76..70a504601dc3909c15c424b1d2b1afdf25b9b341 100644 (file)
@@ -486,11 +486,9 @@ static int kdb_bc(int argc, const char **argv)
 /*
  * kdb_ss
  *
- *     Process the 'ss' (Single Step) and 'ssb' (Single Step to Branch)
- *     commands.
+ *     Process the 'ss' (Single Step) command.
  *
  *     ss
- *     ssb
  *
  * Parameters:
  *     argc    Argument count
@@ -498,35 +496,23 @@ static int kdb_bc(int argc, const char **argv)
  * Outputs:
  *     None.
  * Returns:
- *     KDB_CMD_SS[B] for success, a kdb error if failure.
+ *     KDB_CMD_SS for success, a kdb error if failure.
  * Locking:
  *     None.
  * Remarks:
  *
  *     Set the arch specific option to trigger a debug trap after the next
  *     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)
 {
-       int ssb = 0;
-
-       ssb = (strcmp(argv[0], "ssb") == 0);
        if (argc != 0)
                return KDB_ARGCOUNT;
        /*
         * Set trace flag and go.
         */
        KDB_STATE_SET(DOING_SS);
-       if (ssb) {
-               KDB_STATE_SET(DOING_SSB);
-               return KDB_CMD_SSB;
-       }
        return KDB_CMD_SS;
 }
 
@@ -561,8 +547,6 @@ void __init kdb_initbptab(void)
 
        kdb_register_repeat("ss", kdb_ss, "",
                "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.
         */
index d04a6ce2d3b7f71ee10d20deb800b0ce44a62008..328d18ef31e4b4f02e7cde7aff71504ad8a0fb5e 100644 (file)
@@ -114,7 +114,6 @@ int kdb_stub(struct kgdb_state *ks)
        /* Remove any breakpoints as needed by kdb and clear single step */
        kdb_bp_remove();
        KDB_STATE_CLEAR(DOING_SS);
-       KDB_STATE_CLEAR(DOING_SSB);
        KDB_STATE_SET(PAGER);
        /* zero out any offline cpu data */
        for_each_present_cpu(i) {
index 496f596aa80748c401b091522b13b181079b6d96..00eb8f7fbf41c49e1deb4b09e6858858064ae9e9 100644 (file)
@@ -1128,7 +1128,6 @@ void kdb_set_current_task(struct task_struct *p)
  *     KDB_CMD_GO      User typed 'go'.
  *     KDB_CMD_CPU     User switched to another cpu.
  *     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,
                     kdb_dbtrap_t db_result)
@@ -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",
                                   instruction_pointer(regs));
                        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:
                        break;
                case KDB_DB_SSBPT:
@@ -1297,7 +1288,6 @@ do_full_getstr:
                if (diag == KDB_CMD_GO
                 || diag == KDB_CMD_CPU
                 || diag == KDB_CMD_SS
-                || diag == KDB_CMD_SSB
                 || diag == KDB_CMD_KGDB)
                        break;
 
@@ -1384,12 +1374,6 @@ int kdb_main_loop(kdb_reason_t reason, kdb_reason_t reason2, int error,
                        break;
                }
 
-               if (result == KDB_CMD_SSB) {
-                       KDB_STATE_SET(DOING_SS);
-                       KDB_STATE_SET(DOING_SSB);
-                       break;
-               }
-
                if (result == KDB_CMD_KGDB) {
                        if (!KDB_STATE(DOING_KGDB))
                                kdb_printf("Entering please attach debugger "
index 392ec6a25844c48f1242a649c0c58a1d22c0c783..7afd3c8c41d5d51f17a7a14566551bf2d731d068 100644 (file)
@@ -19,7 +19,6 @@
 #define KDB_CMD_GO     (-1001)
 #define KDB_CMD_CPU    (-1002)
 #define KDB_CMD_SS     (-1003)
-#define KDB_CMD_SSB    (-1004)
 #define KDB_CMD_KGDB (-1005)
 
 /* Internal debug flags */
@@ -125,8 +124,6 @@ extern int kdb_state;
                                                 * kdb control */
 #define KDB_STATE_HOLD_CPU     0x00000010      /* Hold this cpu inside kdb */
 #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
                                                 * after one ss, independent of
                                                 * DOING_SS */
@@ -191,7 +188,6 @@ extern void kdb_bp_remove(void);
 typedef enum {
        KDB_DB_BPT,     /* Breakpoint */
        KDB_DB_SS,      /* Single-step trap */
-       KDB_DB_SSB,     /* Single step to branch */
        KDB_DB_SSBPT,   /* Single step over breakpoint */
        KDB_DB_NOBPT    /* Spurious breakpoint */
 } kdb_dbtrap_t;