/* Support routines for decoding "stabs" debugging information format.
- Copyright (C) 1986-2017 Free Software Foundation, Inc.
+ Copyright (C) 1986-2018 Free Software Foundation, Inc.
This file is part of GDB.
#include "demangle.h"
#include "gdb-demangle.h"
#include "language.h"
-#include "doublest.h"
+#include "target-float.h"
#include "cp-abi.h"
#include "cp-support.h"
#include <ctype.h>
if (format)
type = init_float_type (objfile, bits, NULL, format);
else
- type = init_type (objfile, TYPE_CODE_ERROR, bits / TARGET_CHAR_BIT, NULL);
+ type = init_type (objfile, TYPE_CODE_ERROR, bits, NULL);
return type;
}
{
case 'r':
{
- double d = atof (p);
gdb_byte *dbl_valu;
struct type *dbl_type;
- /* FIXME-if-picky-about-floating-accuracy: Should be using
- target arithmetic to get the value. real.c in GCC
- probably has the necessary code. */
-
dbl_type = objfile_type (objfile)->builtin_double;
dbl_valu
= (gdb_byte *) obstack_alloc (&objfile->objfile_obstack,
TYPE_LENGTH (dbl_type));
- store_typed_floating (dbl_valu, dbl_type, d);
+
+ target_float_from_string (dbl_valu, dbl_type, std::string (p));
SYMBOL_TYPE (sym) = dbl_type;
SYMBOL_VALUE_BYTES (sym) = dbl_valu;
rettype = init_integer_type (objfile, 32, 1, "unsigned long");
break;
case 11:
- rettype = init_type (objfile, TYPE_CODE_VOID, 1, "void");
+ rettype = init_type (objfile, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
break;
case 12:
/* IEEE single precision (32 bit). */
if (type_bits == 0)
{
- struct type *type = init_type (objfile, TYPE_CODE_VOID, 1, NULL);
+ struct type *type = init_type (objfile, TYPE_CODE_VOID,
+ TARGET_CHAR_BIT, NULL);
if (unsigned_type)
TYPE_UNSIGNED (type) = 1;
return type;
/* A type defined as a subrange of itself, with bounds both 0, is void. */
if (self_subrange && n2 == 0 && n3 == 0)
- return init_type (objfile, TYPE_CODE_VOID, 1, NULL);
+ return init_type (objfile, TYPE_CODE_VOID, TARGET_CHAR_BIT, NULL);
/* If n3 is zero and n2 is positive, we want a floating type, and n2
is the width in bytes.
itself with range 0-127. */
else if (self_subrange && n2 == 0 && n3 == 127)
{
- struct type *type = init_integer_type (objfile, 1, 0, NULL);
+ struct type *type = init_integer_type (objfile, TARGET_CHAR_BIT,
+ 0, NULL);
TYPE_NOSIGN (type) = 1;
return type;
}