This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

src/gdb ChangeLog hppa-hpux-tdep.c


CVSROOT:	/cvs/src
Module name:	src
Changes by:	palves@sourceware.org	2013-03-22 14:43:29

Modified files:
	gdb            : ChangeLog hppa-hpux-tdep.c 

Log message:
	hppa-hpux-tdep.c: Fix host dependency.
	
	$ make WERROR_CFLAGS="-Wpointer-sign -Werror" hppa-hpux-tdep.o -k 2>&1 1>/dev/null
	../../src/gdb/hppa-hpux-tdep.c: In function âhppa_hpux_push_dummy_codeâ:
	../../src/gdb/hppa-hpux-tdep.c:1225:7: error: pointer targets in passing argument 2 of âwrite_memoryâ differ in signedness [-Werror=pointer-sign]
	In file included from ../../src/gdb/hppa-hpux-tdep.c:22:0:
	../../src/gdb/gdbcore.h:85:13: note: expected âconst gdb_byte *â but argument is of type âchar *â
	../../src/gdb/hppa-hpux-tdep.c:1251:7: error: pointer targets in passing argument 2 of âwrite_memoryâ differ in signedness [-Werror=pointer-sign]
	In file included from ../../src/gdb/hppa-hpux-tdep.c:22:0:
	../../src/gdb/gdbcore.h:85:13: note: expected âconst gdb_byte *â but argument is of type âchar *â
	../../src/gdb/hppa-hpux-tdep.c: In function âhppa_hpux_supply_save_stateâ:
	../../src/gdb/hppa-hpux-tdep.c:1354:9: error: pointer targets in passing argument 1 of âextract_unsigned_integerâ differ in signedness [-Werror=pointer-sign]
	In file included from ../../src/gdb/hppa-hpux-tdep.c:20:0:
	../../src/gdb/defs.h:675:22: note: expected âconst gdb_byte *â but argument is of type âconst char *â
	
	Casting to gdb_byte would fix it, however, writing an
	unsigned int array like this
	
	static unsigned int hppa64_tramp[] = {
	0xeac0f000, /* bve,l (r22),%r2 */
	0x0fdf12d1, /* std r31,-8(,sp) */
	0x0fd110c2, /* ldd -8(,sp),rp */
	0xe840d002, /* bve,n (rp) */
	0x08000240  /* nop */
	...
	
	directly to target memory assumes the host endianness is the same as
	the target's.  hppa is big endian, so I believe this patch should be
	correct -- it defines the array as a gdb_byte array.  It uses a macro
	to make the insn bytes a little more readable.  I thought of using
	write_memory_unsigned_integer once for each element of the unsigned
	int array, but this way keeps issuing a single target memory write /
	roundtrip for the whole trampoline.
	
	gdb/
	2013-03-22  Pedro Alves  <palves@redhat.com>
	
	* hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Define INSN macro,
	use it to rewrite the trampoline buffers with type gdb_byte[], and
	undefine the macro.  Remove char* cast.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15299&r2=1.15300
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/hppa-hpux-tdep.c.diff?cvsroot=src&r1=1.87&r2=1.88


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]