gdb.trace: Fix write_inferior_data_ptr on 32-bit big-endian machines.
Noticed and tested on 31-bit s390. This bug caused completely broken fast tracepoints. gdb/gdbserver/ChangeLog: * tracepoint.c (write_inferior_data_ptr): Cast to uintptr_t, so that it works properly on big-endian machines where sizeof (CORE_ADDR) != sizeof (void *).
This commit is contained in:
parent
1ac78c0444
commit
99e8eb11cf
2 changed files with 10 additions and 3 deletions
gdb/gdbserver
|
@ -1,3 +1,9 @@
|
||||||
|
2016-01-22 Marcin Kościelnicki <koriakin@0x04.net>
|
||||||
|
|
||||||
|
* tracepoint.c (write_inferior_data_ptr): Cast to uintptr_t, so that
|
||||||
|
it works properly on big-endian machines where sizeof (CORE_ADDR)
|
||||||
|
!= sizeof (void *).
|
||||||
|
|
||||||
2016-01-21 Pedro Alves <palves@redhat.com>
|
2016-01-21 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* Makefile.in (COMPILER_CFLAGS, CXXFLAGS): New.
|
* Makefile.in (COMPILER_CFLAGS, CXXFLAGS): New.
|
||||||
|
|
|
@ -5931,14 +5931,15 @@ compile_tracepoint_condition (struct tracepoint *tpoint,
|
||||||
*jump_entry += 16;
|
*jump_entry += 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We'll need to adjust these when we consider bi-arch setups, and big
|
/* We'll need to adjust these when we consider bi-arch setups. */
|
||||||
endian machines. */
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
write_inferior_data_ptr (CORE_ADDR where, CORE_ADDR ptr)
|
write_inferior_data_ptr (CORE_ADDR where, CORE_ADDR ptr)
|
||||||
{
|
{
|
||||||
|
uintptr_t pptr = ptr;
|
||||||
|
|
||||||
return write_inferior_memory (where,
|
return write_inferior_memory (where,
|
||||||
(unsigned char *) &ptr, sizeof (void *));
|
(unsigned char *) &pptr, sizeof pptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The base pointer of the IPA's heap. This is the only memory the
|
/* The base pointer of the IPA's heap. This is the only memory the
|
||||||
|
|
Loading…
Add table
Reference in a new issue