Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 160818
b: refs/heads/master
c: 68b7f71
h: refs/heads/master
v: v3
  • Loading branch information
Paul Brook authored and Catalin Marinas committed Jul 24, 2009
1 parent 6e33358 commit 3ba2bce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5d57795e26c413656725c26bd053dbee3711adee
refs/heads/master: 68b7f7153fa58df710924fbb79722717d2d16094
8 changes: 8 additions & 0 deletions trunk/arch/arm/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@
#define PSR_ENDSTATE 0
#endif

/*
* 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__

/*
Expand Down
8 changes: 7 additions & 1 deletion trunk/arch/arm/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,13 @@ static int ptrace_read_user(struct task_struct *tsk, unsigned long off,
return -EIO;

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);

return put_user(tmp, ret);
Expand Down

0 comments on commit 3ba2bce

Please sign in to comment.