Skip to contentSkip to conversation

Add ptrace support for NOMMU debugging

PATCH In review Peter Griffin 2 participants 3 messages May 8, 2009 – May 12, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add ptrace support for NOMMU debugging

From 2652ec6503dbe78e5bf371b77544e168166aa57d Mon Sep 17 00:00:00 2001
From: Peter Griffin <[email protected]>
Date: Fri, 8 May 2009 15:01:21 +0100
Subject: [PATCH] Add ptrace support for NOMMU debugging

---
 arch/sh/kernel/ptrace_32.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/sh/kernel/ptrace_32.c +9 -0
index f7b22dd..28aa86f 100644
@@ -33,6 +33,7 @@
 #include <asm/mmu_context.h>
 #include <asm/syscalls.h>
 #include <asm/fpu.h>
+#include <asm/asm-offsets.h>
 
 /*
  * 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);
Signature · 1 line
1.5.6.3
#1 lore raw
Quoted 5 lines · On Friday 08 May 2009 10:50:54 Peter Griffin wrote:
Quoted 1 line

From 2652ec6503dbe78e5bf371b77544e168166aa57d Mon Sep 17 00:00:00 2001

From: Peter Griffin <[email protected]>
Date: Fri, 8 May 2009 15:01:21 +0100
Subject: [PATCH] Add ptrace support for NOMMU debugging

are you not using git-send-email ? posting the actual file produced by git- format-patch looks weird (not sure if git-am works with this).

arch/sh/kernel/ptrace_32.c long arch_ptrace(struct task_struct *child, long request, long addr, long data) · line 345

Quoted 8 lines
arch/sh/kernel/ptrace_32.c +8 -0
+		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;

style wrong: no space inside of those parenthesis
-mike

#2 lore raw
In reply to Peter Griffin
Quoted 9 lines · Mike Frysinger
Quoted 5 lines · On Friday 08 May 2009 10:50:54 Peter Griffin wrote:
Quoted 1 line

From 2652ec6503dbe78e5bf371b77544e168166aa57d Mon Sep 17 00:00:00 2001

From: Peter Griffin <[email protected]>
Date: Fri, 8 May 2009 15:01:21 +0100
Subject: [PATCH] Add ptrace support for NOMMU debugging

are you not using git-send-email ? posting the actual file produced by git- format-patch looks weird (not sure if git-am works with this).

Hi Mike,

I was using git-format-patch to generate the patches, and then evolution in 'pre-format' mode to insert the patch file and send the email.

I've not used git-send-email before, but I just installed it on my system and it looks really good. I especially like the look of the --signed-off-by-cc option :-)

Quoted 11 lines

arch/sh/kernel/ptrace_32.c long arch_ptrace(struct task_struct *child, long request, long addr, long data) · line 345

Quoted 8 lines
arch/sh/kernel/ptrace_32.c +8 -0
+		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;

style wrong: no space inside of those parenthesis
-mike

Noted, thanks for pointing it out. Paul fixed this for me when committing.

regards,

Peter.