lkml.org 
[lkml]   [2011]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] kdb: Add message about CONFIG_DEBUG_RODATA on failure to install breakpoint
On x86, if CONFIG_DEBUG_RODATA is set, one cannot set breakpoints
via KDB. Apparently this is a well-known problem, as at least one distribution
now ships with both KDB enabled and CONFIG_DEBUG_RODATA=y for security reasons.

This patch just adds an extra printk message to the breakpoint failure case,
in order to provide some useful diagnostics to the user.

Signed-off-by: Tim Bird <tim.bird@am.sony.com>
---
kernel/debug/kdb/kdb_bp.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/kernel/debug/kdb/kdb_bp.c b/kernel/debug/kdb/kdb_bp.c
index 20059ef..f015e79 100644
--- a/kernel/debug/kdb/kdb_bp.c
+++ b/kernel/debug/kdb/kdb_bp.c
@@ -153,6 +153,10 @@ static int _kdb_bp_install(struct pt_regs *regs, kdb_bp_t *bp)
} else {
kdb_printf("%s: failed to set breakpoint at 0x%lx\n",
__func__, bp->bp_addr);
+#ifdef CONFIG_DEBUG_RODATA
+ kdb_printf("May need to disable CONFIG_DEBUG_RODATA in order"
+ " to set breakpoints\n");
+#endif
return 1;
}
return 0;
--
1.6.6



\
 
 \ /
  Last update: 2011-09-21 22:11    [W:0.082 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site