From patchwork Fri May 8 14:50:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 22608 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n48FE59s024951 for ; Fri, 8 May 2009 15:14:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760370AbZEHPNd (ORCPT ); Fri, 8 May 2009 11:13:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755417AbZEHPNd (ORCPT ); Fri, 8 May 2009 11:13:33 -0400 Received: from cvs.mpc-ogw.co.uk ([81.2.99.171]:1651 "EHLO warcop.mpc-data.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1760370AbZEHPNc (ORCPT ); Fri, 8 May 2009 11:13:32 -0400 X-Greylist: delayed 1499 seconds by postgrey-1.27 at vger.kernel.org; Fri, 08 May 2009 11:13:22 EDT Received: from [10.150.18.187] (quercus-bis.mpc-data.co.uk [10.150.18.187]) by warcop.mpc-data.co.uk (8.12.9p2/8.12.9) with ESMTP id n48EowMM003981; Fri, 8 May 2009 15:50:58 +0100 (BST) (envelope-from pgriffin@mpc-data.co.uk) Subject: [PATCH] Add ptrace support for NOMMU debugging From: Peter Griffin To: lethal@linux-sh.org Cc: linux-sh@vger.kernel.org Date: Fri, 08 May 2009 15:50:54 +0100 Message-Id: <1241794254.16311.32.camel@quercus-bis> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org >From 2652ec6503dbe78e5bf371b77544e168166aa57d Mon Sep 17 00:00:00 2001 From: Peter Griffin Date: Fri, 8 May 2009 15:01:21 +0100 Subject: [PATCH] Add ptrace support for NOMMU debugging Signed-off-by: Peter Griffin --- arch/sh/kernel/ptrace_32.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c index f7b22dd..28aa86f 100644 --- a/arch/sh/kernel/ptrace_32.c +++ b/arch/sh/kernel/ptrace_32.c @@ -33,6 +33,7 @@ #include #include #include +#include /* * This routine will get a word off of the process kernel stack. @@ -334,6 +335,14 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) [(addr - (long)&dummy->fpu) >> 2]; } else if (addr == (long) &dummy->u_fpvalid) tmp = !!tsk_used_math(child); + else if ( addr == PT_TEXT_ADDR) + tmp = child->mm->start_code; + else if ( addr == PT_DATA_ADDR) + tmp = child->mm->start_data; + else if ( addr == PT_TEXT_END_ADDR ) + tmp = child->mm->end_code; + else if ( addr == PT_TEXT_LEN ) + tmp = child->mm->end_code - child->mm->start_code; else tmp = 0; ret = put_user(tmp, datap);