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 rs6000-aix-tdep.c rs6000-lyn ...


CVSROOT:	/cvs/src
Module name:	src
Changes by:	brobecke@sourceware.org	2013-05-13 10:27:35

Modified files:
	gdb            : ChangeLog rs6000-aix-tdep.c 
	                 rs6000-lynx178-tdep.c 

Log message:
	Float parameter passing in funcall on ppc-aix & ppc-lynx178.
	
	Given the following code:
	
	float global_float = 0.0;
	
	void
	set_float (float f)
	{
	global_float = f;
	}
	
	GDB incorrectly calls set_float if the set_float function is marked
	as prototyped:
	
	(gdb) call set_float (5.0)
	(gdb) print global_float
	$1 = 2048
	
	What happens, when the function is marked as prototyped, is that
	GDB finds that the argument is a float, casts the value given in
	the expression to a float, and then gives that float to ppc-aix/
	ppc-lynx178's push_dummy_call gdbarch routine. The latter then blindly
	copies it as is in the first floating-point register, instead of
	making sure that it has the proper format first.
	
	gdb/ChangeLog:
	
	* rs6000-aix-tdep.c (rs6000_push_dummy_call): Convert
	floating point registers to register type before storing
	value.
	* rs6000-lynx178-tdep.c (rs6000_lynx178_push_dummy_call):
	Likewise.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15547&r2=1.15548
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/rs6000-aix-tdep.c.diff?cvsroot=src&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/rs6000-lynx178-tdep.c.diff?cvsroot=src&r1=1.2&r2=1.3


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