All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Bird <tim.bird@am.sony.com>
To: Jason Wessel <jason.wessel@windriver.com>
Cc: "kgdb-bugreport@lists.sourceforge.net" 
	<kgdb-bugreport@lists.sourceforge.net>,
	linux kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] kdb: Add message about CONFIG_DEBUG_RODATA on failure to install breakpoint
Date: Wed, 21 Sep 2011 13:07:47 -0700	[thread overview]
Message-ID: <4E7A4413.5000307@am.sony.com> (raw)

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



             reply	other threads:[~2011-09-21 20:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-21 20:07 Tim Bird [this message]
2012-03-20 18:32 ` [PATCH] kdb: Add message about CONFIG_DEBUG_RODATA on failure to install breakpoint Jason Wessel
2012-03-20 21:31   ` Tim Bird
2012-03-20 21:55     ` Jason Wessel
2012-03-21 18:03       ` Jason Wessel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E7A4413.5000307@am.sony.com \
    --to=tim.bird@am.sony.com \
    --cc=jason.wessel@windriver.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.