]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kdb: Fix breakpoint enable to be silent if already enabled
authorNir Lichtman <nir@lichtman.org>
Sun, 27 Oct 2024 20:47:29 +0000 (20:47 +0000)
committerDaniel Thompson <daniel.thompson@linaro.org>
Sat, 2 Nov 2024 08:41:39 +0000 (08:41 +0000)
Fix the breakpoint enable command (be) to a logic that is inline with the
breakpoint disable command (bd) in which if the breakpoint is already in
an enabled state, do not print the message of enabled again to the user.

Also a small nit fix of the new line in a separate print.

Signed-off-by: Nir Lichtman <nir@lichtman.org>
Link: https://lore.kernel.org/r/20241027204729.GA907155@lichtman.org
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
kernel/debug/kdb/kdb_bp.c

index 372025cf1ca318efb13710a7518fef0f22b3b98c..c0c2072f54523993d8c967e1ceefe809acb26255 100644 (file)
@@ -460,13 +460,15 @@ static int kdb_bc(int argc, const char **argv)
 
                        break;
                case KDBCMD_BE:
+                       if (bp->bp_enabled)
+                               break;
+
                        bp->bp_enabled = 1;
 
                        kdb_printf("Breakpoint %d at "
-                                  kdb_bfd_vma_fmt " enabled",
+                                  kdb_bfd_vma_fmt " enabled\n",
                                   i, bp->bp_addr);
 
-                       kdb_printf("\n");
                        break;
                case KDBCMD_BD:
                        if (!bp->bp_enabled)