: options->output_format);
val_print_scalar_formatted (type, embedded_offset,
original_value, &opts, 0, stream);
+
+ if (opts.print_suffix)
+ {
+ struct type *t = check_typedef (type);
+
+ if (TYPE_UNSIGNED (t))
+ fputc_filtered ('u', stream);
+
+ /* Is there a better way to do this? Just looking at the size doesn't
+ work. */
+ if (strstr (TYPE_NAME (t), "long long") != NULL)
+ fputs_filtered ("ll", stream);
+ else if (strstr (TYPE_NAME (t), "long") != NULL)
+ fputc_filtered ('l', stream);
+ }
}
else
{
{
fixup_partial_die (pdi, cu);
- if (pdi->name != NULL && strchr (pdi->name, '<') == NULL)
+ if (pdi->name != NULL)
{
struct die_info *die;
struct attribute attr;
if (name == NULL)
name = dwarf2_name (die, cu);
+ /* If there is a template in the name, strip it and let the code below
+ re-compute it. */
+ gdb::unique_xmalloc_ptr<char> holder;
+ if (name != NULL)
+ {
+ const char *opening = strchr (name, '<');
+ if (opening != NULL)
+ {
+ /* In this case, name will get copied/modified and re-assigned,
+ so we can free this copy. */
+ holder.reset (xstrdup (name));
+ holder.get ()[opening - name] = '\0';
+ name = holder.get ();
+ }
+ }
+
/* For Fortran GDB prefers DW_AT_*linkage_name for the physname if present
but otherwise compute it by typename_concat inside GDB.
FIXME: Actually this is not really true, or at least not always true.
templates; two instantiated function templates are allowed to
differ only by their return types, which we do not add here. */
- if (cu->language == language_cplus && strchr (name, '<') == NULL)
+ if (cu->language == language_cplus)
{
struct attribute *attr;
struct die_info *child;
the radix. */
get_formatted_print_options (&opts, 'd');
opts.raw = 1;
+ opts.print_suffix = true;
value_print (v, &buf, &opts);
release_value (v);
value_free (v);
/* If nonzero, when printing a pointer, print the symbol to which it
points, if any. */
int symbol_print;
+
+ /* If true, print the integer suffixes (u for unsigned, l for long, ll for
+ long long). */
+ bool print_suffix;
};
/* The global print options set by the user. In general this should