Skip to contentSkip to conversation

Add in support for ptrace GDB defines

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

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

PATCH 1/1 Add in support for ptrace GDB defines

From 74f64c22d2d3b0082cf96ed81fe2ccd02a352441 Mon Sep 17 00:00:00 2001
From: Kieran Bingham <[email protected]>
Date: Mon, 2 Mar 2009 17:05:09 +0000
Subject: [PATCH] Add in support for ptrace GDB defines

---
 arch/sh/include/asm/ptrace.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/sh/include/asm/ptrace.h +5 -0
index 68e20ff..1dc12cb 100644
@@ -102,6 +102,11 @@ struct pt_dspregs {
 #define	PTRACE_GETDSPREGS	55	/* DSP registers */
 #define	PTRACE_SETDSPREGS	56
 
+#define PT_TEXT_END_ADDR 	240
+#define PT_TEXT_ADDR 		244	/* &(struct user)->start_code */
+#define PT_DATA_ADDR 		248	/* &(struct user)->start_data */
+#define PT_TEXT_LEN		252
+
 #ifdef __KERNEL__
 #include <asm/addrspace.h>
 
Signature · 1 line
1.5.6.3
#1 lore raw
Quoted 8 lines · Peter Griffin
Quoted 1 line

From 74f64c22d2d3b0082cf96ed81fe2ccd02a352441 Mon Sep 17 00:00:00 2001

From: Kieran Bingham <[email protected]>
Date: Mon, 2 Mar 2009 17:05:09 +0000
Subject: [PATCH] Add in support for ptrace GDB defines

Copy and paste error I suppose.

Quoted 8 lines · Peter Griffin
Quoted 1 line

From 0eab785eda2d1c980da7ecd59acda9f50b25ac73 Mon Sep 17 00:00:00 2001

From: Peter Griffin <[email protected]>
Date: Fri, 8 May 2009 14:55:48 +0100
Subject: [PATCH] Fix UBC setup and registers for SH2A

Likewise.

arch/sh/kernel/ptrace_32.c line 39

Quoted 12 lines · Peter Griffin
arch/sh/kernel/ptrace_32.c +1 -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.

This seems to have snuck in from somewhere else, as nothing uses it.

Quoted 5 lines
arch/sh/kernel/ptrace_32.c +1 -0
@@ -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)

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

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

Some weird spacing here. Please run your patches through scripts/checkpatch.pl before sending them to the list, it will complain about these sorts of trivial things so I don't have to. :-)

Anyways, most of the issues were minor, so I just tidied those up by hand. The series is now applied, thanks.

#2 lore raw
In reply to Peter Griffin
Quoted 60 lines · Paul Mundt
Quoted 8 lines · Peter Griffin
Quoted 1 line

From 74f64c22d2d3b0082cf96ed81fe2ccd02a352441 Mon Sep 17 00:00:00 2001

From: Kieran Bingham <[email protected]>
Date: Mon, 2 Mar 2009 17:05:09 +0000
Subject: [PATCH] Add in support for ptrace GDB defines

Copy and paste error I suppose.

Quoted 8 lines · Peter Griffin
Quoted 1 line

From 0eab785eda2d1c980da7ecd59acda9f50b25ac73 Mon Sep 17 00:00:00 2001

From: Peter Griffin <[email protected]>
Date: Fri, 8 May 2009 14:55:48 +0100
Subject: [PATCH] Fix UBC setup and registers for SH2A

Likewise.

arch/sh/kernel/ptrace_32.c line 39

Quoted 12 lines · Peter Griffin
arch/sh/kernel/ptrace_32.c +1 -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.

This seems to have snuck in from somewhere else, as nothing uses it.

Quoted 5 lines
arch/sh/kernel/ptrace_32.c +1 -0
@@ -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)

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

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

Some weird spacing here. Please run your patches through scripts/checkpatch.pl before sending them to the list, it will complain about these sorts of trivial things so I don't have to. :-)

Quoted 3 lines

Anyways, most of the issues were minor, so I just tidied those up by hand. The series is now applied, thanks.

Hi Paul,

Sorry about that, thanks for fixing it and applying.

Pete