/* Target-dependent code for the IQ2000 architecture, for GDB, the GNU
Debugger.
- Copyright (C) 2000-2019 Free Software Foundation, Inc.
+ Copyright (C) 2000-2020 Free Software Foundation, Inc.
Contributed by Red Hat.
#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
-#include "dwarf2-frame.h"
+#include "dwarf2/frame.h"
#include "gdbtypes.h"
#include "value.h"
#include "dis-asm.h"
struct type * type, const gdb_byte * buf)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type));
+ enum type_code target = TYPE_TARGET_TYPE (type)->code ();
CORE_ADDR addr
= extract_unsigned_integer (buf, TYPE_LENGTH (type), byte_order);
struct type *type, gdb_byte *buf, CORE_ADDR addr)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type));
+ enum type_code target = TYPE_TARGET_TYPE (type)->code ();
if (target == TYPE_CODE_FUNC || target == TYPE_CODE_METHOD)
addr = insn_ptr_from_addr (addr);
default_frame_sniffer
};
-static CORE_ADDR
-iq2000_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- return frame_unwind_register_unsigned (next_frame, E_SP_REGNUM);
-}
-
-static CORE_ADDR
-iq2000_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- return frame_unwind_register_unsigned (next_frame, E_PC_REGNUM);
-}
-
-static struct frame_id
-iq2000_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
- CORE_ADDR sp = get_frame_register_unsigned (this_frame, E_SP_REGNUM);
- return frame_id_build (sp, get_frame_pc (this_frame));
-}
-
static CORE_ADDR
iq2000_frame_base_address (struct frame_info *this_frame, void **this_cache)
{
static int
iq2000_use_struct_convention (struct type *type)
{
- return ((TYPE_CODE (type) == TYPE_CODE_STRUCT)
- || (TYPE_CODE (type) == TYPE_CODE_UNION))
+ return ((type->code () == TYPE_CODE_STRUCT)
+ || (type->code () == TYPE_CODE_UNION))
&& TYPE_LENGTH (type) > 8;
}
struct type *ftype;
/* Skip typedefs. */
- while (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
+ while (type->code () == TYPE_CODE_TYPEDEF)
type = TYPE_TARGET_TYPE (type);
/* Non-struct and non-union types are always passed by value. */
- if (TYPE_CODE (type) != TYPE_CODE_STRUCT
- && TYPE_CODE (type) != TYPE_CODE_UNION)
+ if (type->code () != TYPE_CODE_STRUCT
+ && type->code () != TYPE_CODE_UNION)
return 0;
/* Structs with more than 1 field are always passed by address. */
- if (TYPE_NFIELDS (type) != 1)
+ if (type->num_fields () != 1)
return 1;
/* Get field type. */
- ftype = (TYPE_FIELDS (type))[0].type;
+ ftype = type->field (0).type ();
/* The field type must have size 8, otherwise pass by address. */
if (TYPE_LENGTH (ftype) != 8)
return 1;
/* Skip typedefs of field type. */
- while (TYPE_CODE (ftype) == TYPE_CODE_TYPEDEF)
+ while (ftype->code () == TYPE_CODE_TYPEDEF)
ftype = TYPE_TARGET_TYPE (ftype);
/* If field is int or float, pass by value. */
- if (TYPE_CODE (ftype) == TYPE_CODE_FLT
- || TYPE_CODE (ftype) == TYPE_CODE_INT)
+ if (ftype->code () == TYPE_CODE_FLT
+ || ftype->code () == TYPE_CODE_INT)
return 0;
/* Everything else, pass by address. */
return 1;
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_register_type (gdbarch, iq2000_register_type);
set_gdbarch_frame_align (gdbarch, iq2000_frame_align);
- set_gdbarch_unwind_sp (gdbarch, iq2000_unwind_sp);
- set_gdbarch_unwind_pc (gdbarch, iq2000_unwind_pc);
- set_gdbarch_dummy_id (gdbarch, iq2000_dummy_id);
frame_base_set_default (gdbarch, &iq2000_frame_base);
set_gdbarch_push_dummy_call (gdbarch, iq2000_push_dummy_call);
Initializer function for the iq2000 module.
Called by gdb at start-up. */
+void _initialize_iq2000_tdep ();
void
-_initialize_iq2000_tdep (void)
+_initialize_iq2000_tdep ()
{
register_gdbarch_init (bfd_arch_iq2000, iq2000_gdbarch_init);
}