Commit 480a0ae2 authored by Paul Brook's avatar Paul Brook Committed by Catalin Marinas

nommu ptrace support

The patch below adds ARM ptrace functions to get the process load address.
This is required for useful userspace debugging on mmuless systems.  These
values are obtained by reading magic offsets with PTRACE_PEEKUSR, as on other
nommu targets. I picked arbitrary large values for the offsets.
Signed-off-by: default avatarPaul Brook <paul@codesourcery.com>
parent 217ce578
...@@ -527,7 +527,13 @@ static int ptrace_read_user(struct task_struct *tsk, unsigned long off, ...@@ -527,7 +527,13 @@ static int ptrace_read_user(struct task_struct *tsk, unsigned long off,
return -EIO; return -EIO;
tmp = 0; tmp = 0;
if (off < sizeof(struct pt_regs)) if (off == PT_TEXT_ADDR)
tmp = tsk->mm->start_code;
else if (off == PT_DATA_ADDR)
tmp = tsk->mm->start_data;
else if (off == PT_TEXT_END_ADDR)
tmp = tsk->mm->end_code;
else if (off < sizeof(struct pt_regs))
tmp = get_user_reg(tsk, off >> 2); tmp = get_user_reg(tsk, off >> 2);
return put_user(tmp, ret); return put_user(tmp, ret);
......
...@@ -65,6 +65,12 @@ ...@@ -65,6 +65,12 @@
#define PSR_x 0x0000ff00 /* Extension */ #define PSR_x 0x0000ff00 /* Extension */
#define PSR_c 0x000000ff /* Control */ #define PSR_c 0x000000ff /* Control */
/* These are `magic' values for PTRACE_PEEKUSR that return info about where
a process is located in memory. */
#define PT_TEXT_ADDR 0x10000
#define PT_DATA_ADDR 0x10004
#define PT_TEXT_END_ADDR 0x10008
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment