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:
Marcin Kościelnicki 2016-01-22 14:25:02 +01:00
parent 1ac78c0444
commit 99e8eb11cf
2 changed files with 10 additions and 3 deletions

View File

@ -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>
* Makefile.in (COMPILER_CFLAGS, CXXFLAGS): New.

View File

@ -5931,14 +5931,15 @@ compile_tracepoint_condition (struct tracepoint *tpoint,
*jump_entry += 16;
}
/* We'll need to adjust these when we consider bi-arch setups, and big
endian machines. */
/* We'll need to adjust these when we consider bi-arch setups. */
static int
write_inferior_data_ptr (CORE_ADDR where, CORE_ADDR ptr)
{
uintptr_t pptr = ptr;
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