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 doublest.c


CVSROOT:	/cvs/src
Module name:	src
Changes by:	brobecke@sourceware.org	2012-07-25 18:27:22

Modified files:
	gdb            : ChangeLog doublest.c 

Log message:
	convert_doublest_to_floatformat: handle off-range values.
	
	On x86_64-linux targetting AVR, we see the following issues:
	
	(gdb) print 1.6e+308
	$1 = 0.89002949
	(gdb) print 1.6e-308
	$3 = 2.87630892
	
	What happens is that GDB is trying to convert the value it read
	(as a host "long double") into a target "double" value. The routine
	performing the conversion does not realize that 1.6e+308 is just
	too large to fit in a double. Similarly, it does not notice that
	1.6e-308 is too small to be represented.
	
	This patch enhances convert_doublest_to_floatformat to both handle
	floats that are too small and too large.
	
	gdb/ChangeLog:
	
	* doublest.c (convert_doublest_to_floatformat): If the exponent
	is too small, treat the value as zero.  If the exponent is too
	large, treat the value as infinity.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14529&r2=1.14530
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/doublest.c.diff?cvsroot=src&r1=1.50&r2=1.51


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