/* Target-dependent code for the S+core architecture, for GDB,
the GNU Debugger.
- Copyright (C) 2006-2019 Free Software Foundation, Inc.
+ Copyright (C) 2006-2020 Free Software Foundation, Inc.
Contributed by Qinwei (qinwei@sunnorth.com.cn)
Contributed by Ching-Peng Lin (cplin@sunplus.com)
#include "frame-unwind.h"
#include "frame-base.h"
#include "trad-frame.h"
-#include "dwarf2-frame.h"
+#include "dwarf2/frame.h"
#include "score-tdep.h"
#define G_FLD(_i,_ms,_ls) \
struct type *type, struct regcache *regcache,
gdb_byte * readbuf, const gdb_byte * writebuf)
{
- if (TYPE_CODE (type) == TYPE_CODE_STRUCT
- || TYPE_CODE (type) == TYPE_CODE_UNION
- || TYPE_CODE (type) == TYPE_CODE_ARRAY)
+ if (type->code () == TYPE_CODE_STRUCT
+ || type->code () == TYPE_CODE_UNION
+ || type->code () == TYPE_CODE_ARRAY)
return RETURN_VALUE_STRUCT_CONVENTION;
else
{
static int
score_type_needs_double_align (struct type *type)
{
- enum type_code typecode = TYPE_CODE (type);
+ enum type_code typecode = type->code ();
if ((typecode == TYPE_CODE_INT && TYPE_LENGTH (type) == 8)
|| (typecode == TYPE_CODE_FLT && TYPE_LENGTH (type) == 8))
{
int i, n;
- n = TYPE_NFIELDS (type);
+ n = type->num_fields ();
for (i = 0; i < n; i++)
if (score_type_needs_double_align (TYPE_FIELD_TYPE (type, i)))
return 1;
{
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (value_type (arg));
- enum type_code typecode = TYPE_CODE (arg_type);
+ enum type_code typecode = arg_type->code ();
const gdb_byte *val = value_contents (arg);
int downward_offset = 0;
int arg_last_part_p = 0;
&& G_FLD (inst->v, 2, 0) == 0x0)
{
/* subei! r0, n */
- sp_offset += (int) pow (2, G_FLD (inst->v, 6, 3));
+ sp_offset += (int) pow (2.0, G_FLD (inst->v, 6, 3));
}
else if (G_FLD (inst->v, 14, 7) == 0xc0
&& G_FLD (inst->v, 2, 0) == 0x0)
{
/* addei! r0, n */
- sp_offset -= (int) pow (2, G_FLD (inst->v, 6, 3));
+ /* Solaris 11+gcc 5.5 has ambiguous overloads of pow, so we
+ pass 2.0 instead of 2 to get the right one. */
+ sp_offset -= (int) pow (2.0, G_FLD (inst->v, 6, 3));
}
}
else
return gdbarch;
}
+void _initialize_score_tdep ();
void
-_initialize_score_tdep (void)
+_initialize_score_tdep ()
{
gdbarch_register (bfd_arch_score, score_gdbarch_init, NULL);
}