]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/parse.c
Target FP: Add string routines to target-float.{c,h}
[thirdparty/binutils-gdb.git] / gdb / parse.c
index a4058c377bfd3169c9d4fa747a121a33e41e320c..506efa38fb791105327cace7a97b385abbab5ddf 100644 (file)
@@ -44,8 +44,7 @@
 #include "gdbcmd.h"
 #include "symfile.h"           /* for overlay functions */
 #include "inferior.h"
-#include "doublest.h"
-#include "dfp.h"
+#include "target-float.h"
 #include "block.h"
 #include "source.h"
 #include "objfiles.h"
@@ -1338,13 +1337,7 @@ bool
 parse_float (const char *p, int len,
             const struct type *type, gdb_byte *data)
 {
-  if (TYPE_CODE (type) == TYPE_CODE_FLT)
-    return floatformat_from_string (floatformat_from_type (type),
-                                   data, std::string (p, len));
-  else
-    return decimal_from_string (data, TYPE_LENGTH (type),
-                               gdbarch_byte_order (get_type_arch (type)),
-                               std::string (p, len));
+  return target_float_from_string (data, type, std::string (p, len));
 }
 \f
 /* Stuff for maintaining a stack of types.  Currently just used by C, but