/* Support for printing C and C++ types for GDB, the GNU debugger.
- Copyright (C) 1986-2016 Free Software Foundation, Inc.
+ Copyright (C) 1986-2017 Free Software Foundation, Inc.
This file is part of GDB.
#include "c-lang.h"
#include "typeprint.h"
#include "cp-abi.h"
-#include "jv-lang.h"
#include "cp-support.h"
static void c_type_print_varspec_prefix (struct type *,
const struct type_print_options *flags,
struct ui_file *stream)
{
- char *s = NULL;
+ std::string s;
if (!flags->raw)
s = cp_canonicalize_string_full (name,
find_typedef_for_canonicalize,
(void *) flags);
- fputs_filtered (s ? s : name, stream);
- xfree (s);
+ fputs_filtered (!s.empty () ? s.c_str () : name, stream);
}
\f
parameter types get removed their possible const and volatile qualifiers to
match demangled linkage name parameters part of such function type.
LANGUAGE is the language in which TYPE was defined. This is a necessary
- evil since this code is used by the C, C++, and Java backends. */
+ evil since this code is used by the C and C++. */
void
c_type_print_args (struct type *type, struct ui_file *stream,
param_type = make_cv_type (0, 0, param_type, NULL);
}
- if (language == language_java)
- java_print_type (param_type, "", stream, -1, 0, flags);
- else
- c_print_type (param_type, "", stream, -1, 0, flags);
+ c_print_type (param_type, "", stream, -1, 0, flags);
printed_any = 1;
}
}
}
else if (!printed_any
- && ((TYPE_PROTOTYPED (type) && language != language_java)
- || language == language_cplus))
+ && (TYPE_PROTOTYPED (type) || language == language_cplus))
fprintf_filtered (stream, "void");
fprintf_filtered (stream, ")");
TYPE_FIELD_NAME (type, i),
stream, show, level + 4,
&local_flags);
- fprintf_filtered (stream, " @%d",
- TYPE_FIELD_BITPOS (type, i));
+ fprintf_filtered (stream, " @%s",
+ plongest (TYPE_FIELD_BITPOS (type, i)));
if (TYPE_FIELD_BITSIZE (type, i) > 1)
{
- fprintf_filtered (stream, "-%d",
- TYPE_FIELD_BITPOS (type, i)
- + TYPE_FIELD_BITSIZE (type, i) - 1);
+ fprintf_filtered (stream, "-%s",
+ plongest (TYPE_FIELD_BITPOS (type, i)
+ + TYPE_FIELD_BITSIZE (type, i)
+ - 1));
}
fprintf_filtered (stream, ";\n");
}