* linux-low.c (linux_store_registers): Avoid the copying sequence
when no data has been retrieved by ptrace.
This commit is contained in:
parent
5d196efc83
commit
8d409d16dd
2 changed files with 13 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-05-22 Maciej W. Rozycki <macro@codesourcery.com>
|
||||
|
||||
* linux-low.c (linux_store_registers): Avoid the copying sequence
|
||||
when no data has been retrieved by ptrace.
|
||||
|
||||
2012-05-22 Will Deacon <will.deacon@arm.com>
|
||||
|
||||
* linux-low (__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)):
|
||||
|
|
|
@ -4449,11 +4449,14 @@ linux_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
|
|||
ret = errno;
|
||||
|
||||
/* Copy appropriate bytes out of the buffer. */
|
||||
if (i > 0)
|
||||
{
|
||||
i *= sizeof (PTRACE_XFER_TYPE);
|
||||
i -= memaddr & (sizeof (PTRACE_XFER_TYPE) - 1);
|
||||
memcpy (myaddr,
|
||||
(char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)),
|
||||
i < len ? i : len);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue