#include "gdbcmd.h"
#include "target.h"
#include "obstack.h"
+#include "language.h"
#include <errno.h>
extern int sys_nerr;
if (inv)
fprintf_filtered (stream, "<invalid float value>");
else
- fprintf_filtered (stream, len <= sizeof(float) ? "%.6g" : "%.17g", doub);
+ fprintf_filtered (stream, len <= sizeof(float) ? "%.9g" : "%.17g", doub);
}
/* VALADDR points to an integer of LEN bytes. Print it in hex on stream. */
{
int i, len, n_baseclasses;
+ check_stub_type (type);
+
fprintf_filtered (stream, "{");
len = TYPE_NFIELDS (type);
n_baseclasses = TYPE_N_BASECLASSES (type);
return 0;
}
\f
+/* Print a description of a type in the format of a
+ typedef for the current language.
+ NEW is the new name for a type TYPE. */
+void
+typedef_print (type, new, stream)
+ struct type *type;
+ struct symbol *new;
+ FILE *stream;
+{
+ switch (current_language->la_language)
+ {
+#ifdef _LANG_c
+ case language_c:
+ fprintf_filtered(stream, "typedef ");
+ type_print(type,"",stream,0);
+ if(TYPE_NAME ((SYMBOL_TYPE (new))) == 0
+ || 0 != strcmp (TYPE_NAME ((SYMBOL_TYPE (new))),
+ SYMBOL_NAME (new)))
+ fprintf_filtered(stream, " %s", SYMBOL_NAME(new));
+ break;
+#endif
+#ifdef _LANG_m2
+ case language_m2:
+ fprintf_filtered(stream, "TYPE ");
+ if(!TYPE_NAME(SYMBOL_TYPE(new)) ||
+ strcmp (TYPE_NAME(SYMBOL_TYPE(new)),
+ SYMBOL_NAME(new)))
+ fprintf_filtered(stream, "%s = ", SYMBOL_NAME(new));
+ else
+ fprintf_filtered(stream, "<builtin> = ");
+ type_print(type,"",stream,0);
+ break;
+#endif
+ default:
+ error("Language not supported.");
+ }
+ fprintf_filtered(stream, ";\n");
+}
+
+
/* Print a description of a type TYPE
in the form of a declaration of a variable named VARSTRING.
(VARSTRING is demangled if necessary.)