mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 14:39:09 +08:00
gdb/
* ppc-linux-nat.c (fetch_register, store_register): Fix GCC aliasing compilation warning.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2012-02-12 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* ppc-linux-nat.c (fetch_register, store_register): Fix GCC aliasing
|
||||||
|
compilation warning.
|
||||||
|
|
||||||
2012-02-12 Jan Kratochvil <jan.kratochvil@redhat.com>
|
2012-02-12 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
Fix crash on loaded shlibs without loaded exec_bfd.
|
Fix crash on loaded shlibs without loaded exec_bfd.
|
||||||
|
@ -593,9 +593,10 @@ fetch_register (struct regcache *regcache, int tid, int regno)
|
|||||||
bytes_transferred < register_size (gdbarch, regno);
|
bytes_transferred < register_size (gdbarch, regno);
|
||||||
bytes_transferred += sizeof (long))
|
bytes_transferred += sizeof (long))
|
||||||
{
|
{
|
||||||
|
long l;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
*(long *) &buf[bytes_transferred]
|
l = ptrace (PTRACE_PEEKUSER, tid, (PTRACE_TYPE_ARG3) regaddr, 0);
|
||||||
= ptrace (PTRACE_PEEKUSER, tid, (PTRACE_TYPE_ARG3) regaddr, 0);
|
|
||||||
regaddr += sizeof (long);
|
regaddr += sizeof (long);
|
||||||
if (errno != 0)
|
if (errno != 0)
|
||||||
{
|
{
|
||||||
@ -604,6 +605,7 @@ fetch_register (struct regcache *regcache, int tid, int regno)
|
|||||||
gdbarch_register_name (gdbarch, regno), regno);
|
gdbarch_register_name (gdbarch, regno), regno);
|
||||||
perror_with_name (message);
|
perror_with_name (message);
|
||||||
}
|
}
|
||||||
|
memcpy (&buf[bytes_transferred], &l, sizeof (l));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now supply the register. Keep in mind that the regcache's idea
|
/* Now supply the register. Keep in mind that the regcache's idea
|
||||||
@ -1073,9 +1075,11 @@ store_register (const struct regcache *regcache, int tid, int regno)
|
|||||||
|
|
||||||
for (i = 0; i < bytes_to_transfer; i += sizeof (long))
|
for (i = 0; i < bytes_to_transfer; i += sizeof (long))
|
||||||
{
|
{
|
||||||
|
long l;
|
||||||
|
|
||||||
|
memcpy (&l, &buf[i], sizeof (l));
|
||||||
errno = 0;
|
errno = 0;
|
||||||
ptrace (PTRACE_POKEUSER, tid, (PTRACE_TYPE_ARG3) regaddr,
|
ptrace (PTRACE_POKEUSER, tid, (PTRACE_TYPE_ARG3) regaddr, l);
|
||||||
*(long *) &buf[i]);
|
|
||||||
regaddr += sizeof (long);
|
regaddr += sizeof (long);
|
||||||
|
|
||||||
if (errno == EIO
|
if (errno == EIO
|
||||||
|
Reference in New Issue
Block a user