/* Target-dependent code for the 32-bit OpenRISC 1000, for the GDB.
- Copyright (C) 2008-2017 Free Software Foundation, Inc.
+ Copyright (C) 2008-2019 Free Software Foundation, Inc.
This file is part of GDB.
#include "block.h"
#include "reggroups.h"
#include "arch-utils.h"
-#include "frame.h"
#include "frame-unwind.h"
#include "frame-base.h"
#include "dwarf2-frame.h"
static void
show_or1k_debug (struct ui_file *file, int from_tty,
- struct cmd_list_element *c, const char *value)
+ struct cmd_list_element *c, const char *value)
{
fprintf_filtered (file, _("OpenRISC debugging is %s.\n"), value);
}
/* Check we got something, and if so skip on. */
if (start_ptr == end_ptr)
error (_("bitstring \"%s\" at offset %d has no length field."),
- format, i);
+ format, i);
i += end_ptr - start_ptr;
just should not be wrong. */
if ('b' != format[i++])
error (_("bitstring \"%s\" at offset %d has no terminating 'b'."),
- format, i);
+ format, i);
/* Break out the field. There is a special case with a bit width
of 32. */
default:
error (_("invalid character in bitstring \"%s\" at offset %d."),
- format, i);
+ format, i);
break;
}
}
else
memcpy (buf, writebuf, rv_size);
- regcache_cooked_write (regcache, OR1K_RV_REGNUM, buf);
+ regcache->cooked_write (OR1K_RV_REGNUM, buf);
free (buf);
}
memcpy (buf_hi, writebuf, rv_size - bpw);
memcpy (buf_lo, writebuf + bpw, bpw);
- regcache_cooked_write (regcache, OR1K_RV_REGNUM, buf_hi);
- regcache_cooked_write (regcache, OR1K_RV_REGNUM + 1, buf_lo);
+ regcache->cooked_write (OR1K_RV_REGNUM, buf_hi);
+ regcache->cooked_write (OR1K_RV_REGNUM + 1, buf_lo);
free (buf_lo);
free (buf_hi);
return 0;
insn = cgen_lookup_insn (tdep->gdb_cgen_cpu_desc,
- NULL,
- or1k_fetch_instruction (gdbarch, ppc),
- NULL, 32, &tmp_fields, 0);
+ NULL,
+ or1k_fetch_instruction (gdbarch, ppc),
+ NULL, 32, &tmp_fields, 0);
/* NULL here would mean the last instruction was not understood by cgen.
This should not usually happen, but if does its not a delay slot. */
or1k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr,
int nargs, struct value **args, CORE_ADDR sp,
- int struct_return, CORE_ADDR struct_addr)
+ function_call_return_method return_method,
+ CORE_ADDR struct_addr)
{
int argreg;
/* Location for a returned structure. This is passed as a silent first
argument. */
- if (struct_return)
+ if (return_method == return_method_struct)
{
regcache_cooked_write_unsigned (regcache, OR1K_FIRST_ARG_REGNUM,
struct_addr);
return sp;
}
-/* Implement the dummy_id gdbarch method. */
-
-static struct frame_id
-or1k_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
- return frame_id_build (get_frame_sp (this_frame),
- get_frame_pc (this_frame));
-}
\f
/* Support functions for frame handling. */
have executed the code. Check we have a sane prologue size, and if
zero we are frameless and can give up here. */
if (end_addr < start_addr)
- error (_("end addr 0x%08x is less than start addr 0x%08x"),
- (unsigned int) end_addr, (unsigned int) start_addr);
+ error (_("end addr %s is less than start addr %s"),
+ paddress (gdbarch, end_addr), paddress (gdbarch, start_addr));
if (end_addr == start_addr)
frame_size = 0;
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
set_gdbarch_push_dummy_code (gdbarch, or1k_push_dummy_code);
set_gdbarch_push_dummy_call (gdbarch, or1k_push_dummy_call);
- set_gdbarch_dummy_id (gdbarch, or1k_dummy_id);
/* Frame unwinders. Use DWARF debug info if available, otherwise use our
own unwinder. */
tdesc_use_registers (gdbarch, tdesc, tdesc_data);
}
+ /* Hook in ABI-specific overrides, if they have been registered. */
+ gdbarch_init_osabi (info, gdbarch);
+
return gdbarch;
}