Commit 96664dee authored by Christopher M. Riedl's avatar Christopher M. Riedl Committed by Michael Ellerman

powerpc/xmon: Allow listing and clearing breakpoints in read-only mode

Read-only mode should not prevent listing and clearing any active
breakpoints.
Tested-by: default avatarDaniel Axtens <dja@axtens.net>
Reviewed-by: default avatarDaniel Axtens <dja@axtens.net>
Signed-off-by: default avatarChristopher M. Riedl <cmr@informatik.wtf>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190907061124.1947-2-cmr@informatik.wtf
parent 4f5c5b76
...@@ -1047,10 +1047,6 @@ cmds(struct pt_regs *excp) ...@@ -1047,10 +1047,6 @@ cmds(struct pt_regs *excp)
set_lpp_cmd(); set_lpp_cmd();
break; break;
case 'b': case 'b':
if (xmon_is_ro) {
printf(xmon_ro_msg);
break;
}
bpt_cmds(); bpt_cmds();
break; break;
case 'C': case 'C':
...@@ -1319,11 +1315,16 @@ bpt_cmds(void) ...@@ -1319,11 +1315,16 @@ bpt_cmds(void)
struct bpt *bp; struct bpt *bp;
cmd = inchar(); cmd = inchar();
switch (cmd) { switch (cmd) {
#ifndef CONFIG_PPC_8xx #ifndef CONFIG_PPC_8xx
static const char badaddr[] = "Only kernel addresses are permitted for breakpoints\n"; static const char badaddr[] = "Only kernel addresses are permitted for breakpoints\n";
int mode; int mode;
case 'd': /* bd - hardware data breakpoint */ case 'd': /* bd - hardware data breakpoint */
if (xmon_is_ro) {
printf(xmon_ro_msg);
break;
}
if (!ppc_breakpoint_available()) { if (!ppc_breakpoint_available()) {
printf("Hardware data breakpoint not supported on this cpu\n"); printf("Hardware data breakpoint not supported on this cpu\n");
break; break;
...@@ -1351,6 +1352,10 @@ bpt_cmds(void) ...@@ -1351,6 +1352,10 @@ bpt_cmds(void)
break; break;
case 'i': /* bi - hardware instr breakpoint */ case 'i': /* bi - hardware instr breakpoint */
if (xmon_is_ro) {
printf(xmon_ro_msg);
break;
}
if (!cpu_has_feature(CPU_FTR_ARCH_207S)) { if (!cpu_has_feature(CPU_FTR_ARCH_207S)) {
printf("Hardware instruction breakpoint " printf("Hardware instruction breakpoint "
"not supported on this cpu\n"); "not supported on this cpu\n");
...@@ -1409,7 +1414,8 @@ bpt_cmds(void) ...@@ -1409,7 +1414,8 @@ bpt_cmds(void)
break; break;
} }
termch = cmd; termch = cmd;
if (!scanhex(&a)) {
if (xmon_is_ro || !scanhex(&a)) {
/* print all breakpoints */ /* print all breakpoints */
printf(" type address\n"); printf(" type address\n");
if (dabr.enabled) { if (dabr.enabled) {
......
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