aboutsummaryrefslogtreecommitdiff
path: root/gdb/i387-tdep.c
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2017-11-06 15:56:35 +0100
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2017-11-06 15:56:35 +0100
commitf69fdf9bca80ac703890a51e124e408cbccbb743 (patch)
treef760113a7673920b807b0871000c40d27dde0604 /gdb/i387-tdep.c
parent701000146a01f1966c59f50d7b638915917b6378 (diff)
downloadgdb-f69fdf9bca80ac703890a51e124e408cbccbb743.zip
gdb-f69fdf9bca80ac703890a51e124e408cbccbb743.tar.gz
gdb-f69fdf9bca80ac703890a51e124e408cbccbb743.tar.bz2
Target FP: Add string routines to target-float.{c,h}
This adds target_float_to_string and target_float_from_string, which dispatch to the corresponding floatformat_ or decimal_ routines. Existing users of those routines are changed to use the new target-float routines instead (most of those places already handle both binary and decimal FP). In addition, two other places are changes to use target_float_from_string: - define_symbol in stabsread.c, when parsing a floating-point literal from stabs debug info - gdbarch-selftest.c when initializing a target format values (to eliminate use of DOUBLEST there). gdb/ChangeLog: 2017-11-06 Ulrich Weigand <uweigand@de.ibm.com> * target-float.c (target_float_to_string): New function. (target_float_from_string): New function. * target-float.h (target_float_to_string): Add prototype. (target_float_from_string): Add prototype. * valprint.c: Include "target-float.h". Do not include "doublest.h" and "dfp.h". (print_floating): Use target_float_to_string. * printcmd.c: Include "target-float.h". Do not include "dfp.h". (printf_floating): Use target_float_to_string. * i387-tdep.c: Include "target-float.h". Do not include "doublest.h". (print_i387_value): Use target_float_to_string. * mips-tdep.c: Include "target-float.h". (mips_print_fp_register): Use target_float_to_string. * sh64-tdep.c: Include "target-float.h". (sh64_do_fp_register): Use target_float_to_string. * parse.c: Include "target-float.h". Do not include "doublest.h" and "dfp.h". (parse_float): Use target_float_from_string. * stabsread.c: Include "target-float.h". Do not include "doublest.h". (define_symbol): Use target_float_from_string. * gdbarch-selftests.c: Include "target-float.h". (register_to_value_test): Use target_float_from_string.
Diffstat (limited to 'gdb/i387-tdep.c')
-rw-r--r--gdb/i387-tdep.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index cfacced..8de0431 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -18,12 +18,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "doublest.h"
#include "frame.h"
#include "gdbcore.h"
#include "inferior.h"
#include "language.h"
#include "regcache.h"
+#include "target-float.h"
#include "value.h"
#include "i386-tdep.h"
@@ -40,9 +40,8 @@ print_i387_value (struct gdbarch *gdbarch,
garbage, but we'd better print one too many. We need enough room
to print the value, 1 position for the sign, 1 for the decimal
point, 19 for the digits and 6 for the exponent adds up to 27. */
- const struct floatformat *fmt
- = floatformat_from_type (i387_ext_type (gdbarch));
- std::string str = floatformat_to_string (fmt, raw, " %-+27.19g");
+ const struct type *type = i387_ext_type (gdbarch);
+ std::string str = target_float_to_string (raw, type, " %-+27.19g");
fprintf_filtered (file, "%s", str.c_str ());
}