/* Support routines for manipulating internal types for GDB.
- Copyright (C) 1992-2019 Free Software Foundation, Inc.
+ Copyright (C) 1992-2020 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
#include "hashtab.h"
#include "cp-support.h"
#include "bcache.h"
-#include "dwarf2loc.h"
+#include "dwarf2/loc.h"
#include "gdbcore.h"
#include "floatformat.h"
&& !type_not_allocated (result_type)))
{
LONGEST low_bound, high_bound;
- unsigned int stride;
+ int stride;
/* If the array itself doesn't provide a stride value then take
whatever stride the range provides. Don't update BIT_STRIDE as
In such cases, the array length should be zero. */
if (high_bound < low_bound)
TYPE_LENGTH (result_type) = 0;
- else if (stride > 0)
- TYPE_LENGTH (result_type) =
- (stride * (high_bound - low_bound + 1) + 7) / 8;
+ else if (stride != 0)
+ {
+ /* Ensure that the type length is always positive, even in the
+ case where (for example in Fortran) we have a negative
+ stride. It is possible to have a single element array with a
+ negative stride in Fortran (this doesn't mean anything
+ special, it's still just a single element array) so do
+ consider that case when touching this code. */
+ LONGEST element_count = abs (high_bound - low_bound + 1);
+ TYPE_LENGTH (result_type)
+ = ((abs (stride) * element_count) + 7) / 8;
+ }
else
TYPE_LENGTH (result_type) =
TYPE_LENGTH (element_type) * (high_bound - low_bound + 1);
}
else
{
- /* Lvalues should prefer lvalue overloads. */
+ /* It's illegal to pass an lvalue as an rvalue. */
if (TYPE_CODE (parm) == TYPE_CODE_RVALUE_REF)
- {
- rank.subrank = REFERENCE_CONVERSION_RVALUE;
- return sum_ranks (rank, REFERENCE_CONVERSION_BADNESS);
- }
+ return INCOMPATIBLE_TYPE_BADNESS;
}
}
TYPE_FN_FIELD_PROTECTED (f, overload_idx));
printfi_filtered (spaces + 8, "is_stub %d\n",
TYPE_FN_FIELD_STUB (f, overload_idx));
+ printfi_filtered (spaces + 8, "defaulted %d\n",
+ TYPE_FN_FIELD_DEFAULTED (f, overload_idx));
+ printfi_filtered (spaces + 8, "is_deleted %d\n",
+ TYPE_FN_FIELD_DELETED (f, overload_idx));
printfi_filtered (spaces + 8, "voffset %u\n",
TYPE_FN_FIELD_VOFFSET (f, overload_idx));
}
{
dump_fn_fieldlists (type, spaces);
}
+
+ printfi_filtered (spaces, "calling_convention %d\n",
+ TYPE_CPLUS_CALLING_CONVENTION (type));
}
/* Print the contents of the TYPE's type_specific union, assuming that
return objfile_type;
}
+void _initialize_gdbtypes ();
void
-_initialize_gdbtypes (void)
+_initialize_gdbtypes ()
{
gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init);