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Ă© <[email protected]>
Cc: [email protected]
Cc: [email protected]
---

Hi,

Here is a patch proposal to remove 'ssb' from the kernel, which "works for me".

For simplicity, following defines like KDB_CMD_KGDB or debug traces numbers
have not been touched. Please let me know if they should be "renumbered".

Best regards,

V.

 kernel/debug/kdb/kdb_bp.c       |   20 ++------------------
 kernel/debug/kdb/kdb_debugger.c |    1 -
 kernel/debug/kdb/kdb_main.c     |   16 ----------------
 kernel/debug/kdb/kdb_private.h  |    4 ----
 4 files changed, 2 insertions(+), 39 deletions(-)

diff --git a/kernel/debug/kdb/kdb_bp.c b/kernel/debug/kdb/kdb_bp.c
index 8418c2f..70a5046 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)
 /*
  * 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.
         */
diff --git a/kernel/debug/kdb/kdb_debugger.c b/kernel/debug/kdb/kdb_debugger.c
index be7b33b..2ab4f1a 100644
--- a/kernel/debug/kdb/kdb_debugger.c
+++ b/kernel/debug/kdb/kdb_debugger.c
@@ -100,7 +100,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) {
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index 8875254..c37ab68 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -1112,7 +1112,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)
@@ -1151,14 +1150,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:
@@ -1281,7 +1272,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;
 
@@ -1368,12 +1358,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 "
diff --git a/kernel/debug/kdb/kdb_private.h b/kernel/debug/kdb/kdb_private.h
index 392ec6a..7afd3c8 100644
--- a/kernel/debug/kdb/kdb_private.h
+++ b/kernel/debug/kdb/kdb_private.h
@@ -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;
-- 
1.7.10.4


------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to