Skip to content

Commit 36dfea4

Browse files
vstehlejwessel
authored andcommitted
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>
1 parent a37372f commit 36dfea4

4 files changed

Lines changed: 2 additions & 39 deletions

File tree

kernel/debug/kdb/kdb_bp.c

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -486,47 +486,33 @@ static int kdb_bc(int argc, const char **argv)
486486
/*
487487
* kdb_ss
488488
*
489-
* Process the 'ss' (Single Step) and 'ssb' (Single Step to Branch)
490-
* commands.
489+
* Process the 'ss' (Single Step) command.
491490
*
492491
* ss
493-
* ssb
494492
*
495493
* Parameters:
496494
* argc Argument count
497495
* argv Argument vector
498496
* Outputs:
499497
* None.
500498
* Returns:
501-
* KDB_CMD_SS[B] for success, a kdb error if failure.
499+
* KDB_CMD_SS for success, a kdb error if failure.
502500
* Locking:
503501
* None.
504502
* Remarks:
505503
*
506504
* Set the arch specific option to trigger a debug trap after the next
507505
* 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.
513506
*/
514507

515508
static int kdb_ss(int argc, const char **argv)
516509
{
517-
int ssb = 0;
518-
519-
ssb = (strcmp(argv[0], "ssb") == 0);
520510
if (argc != 0)
521511
return KDB_ARGCOUNT;
522512
/*
523513
* Set trace flag and go.
524514
*/
525515
KDB_STATE_SET(DOING_SS);
526-
if (ssb) {
527-
KDB_STATE_SET(DOING_SSB);
528-
return KDB_CMD_SSB;
529-
}
530516
return KDB_CMD_SS;
531517
}
532518

@@ -561,8 +547,6 @@ void __init kdb_initbptab(void)
561547

562548
kdb_register_repeat("ss", kdb_ss, "",
563549
"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);
566550
/*
567551
* Architecture dependent initialization.
568552
*/

kernel/debug/kdb/kdb_debugger.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ int kdb_stub(struct kgdb_state *ks)
114114
/* Remove any breakpoints as needed by kdb and clear single step */
115115
kdb_bp_remove();
116116
KDB_STATE_CLEAR(DOING_SS);
117-
KDB_STATE_CLEAR(DOING_SSB);
118117
KDB_STATE_SET(PAGER);
119118
/* zero out any offline cpu data */
120119
for_each_present_cpu(i) {

kernel/debug/kdb/kdb_main.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,6 @@ void kdb_set_current_task(struct task_struct *p)
11281128
* KDB_CMD_GO User typed 'go'.
11291129
* KDB_CMD_CPU User switched to another cpu.
11301130
* KDB_CMD_SS Single step.
1131-
* KDB_CMD_SSB Single step until branch.
11321131
*/
11331132
static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
11341133
kdb_dbtrap_t db_result)
@@ -1167,14 +1166,6 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
11671166
kdb_printf("due to Debug @ " kdb_machreg_fmt "\n",
11681167
instruction_pointer(regs));
11691168
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;
11781169
case KDB_DB_SS:
11791170
break;
11801171
case KDB_DB_SSBPT:
@@ -1297,7 +1288,6 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
12971288
if (diag == KDB_CMD_GO
12981289
|| diag == KDB_CMD_CPU
12991290
|| diag == KDB_CMD_SS
1300-
|| diag == KDB_CMD_SSB
13011291
|| diag == KDB_CMD_KGDB)
13021292
break;
13031293

@@ -1384,12 +1374,6 @@ int kdb_main_loop(kdb_reason_t reason, kdb_reason_t reason2, int error,
13841374
break;
13851375
}
13861376

1387-
if (result == KDB_CMD_SSB) {
1388-
KDB_STATE_SET(DOING_SS);
1389-
KDB_STATE_SET(DOING_SSB);
1390-
break;
1391-
}
1392-
13931377
if (result == KDB_CMD_KGDB) {
13941378
if (!KDB_STATE(DOING_KGDB))
13951379
kdb_printf("Entering please attach debugger "

kernel/debug/kdb/kdb_private.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#define KDB_CMD_GO (-1001)
2020
#define KDB_CMD_CPU (-1002)
2121
#define KDB_CMD_SS (-1003)
22-
#define KDB_CMD_SSB (-1004)
2322
#define KDB_CMD_KGDB (-1005)
2423

2524
/* Internal debug flags */
@@ -125,8 +124,6 @@ extern int kdb_state;
125124
* kdb control */
126125
#define KDB_STATE_HOLD_CPU 0x00000010 /* Hold this cpu inside kdb */
127126
#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 */
130127
#define KDB_STATE_SSBPT 0x00000080 /* Install breakpoint
131128
* after one ss, independent of
132129
* DOING_SS */
@@ -191,7 +188,6 @@ extern void kdb_bp_remove(void);
191188
typedef enum {
192189
KDB_DB_BPT, /* Breakpoint */
193190
KDB_DB_SS, /* Single-step trap */
194-
KDB_DB_SSB, /* Single step to branch */
195191
KDB_DB_SSBPT, /* Single step over breakpoint */
196192
KDB_DB_NOBPT /* Spurious breakpoint */
197193
} kdb_dbtrap_t;

0 commit comments

Comments
 (0)