X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fm32r-tdep.c;h=59f9bb59be9470f318c3541892f7be0a84228e70;hb=d16c467a501547e37b111f775396e28f8bf27c1e;hp=2d14cede7ebf7d990aab0334b66db2e964ce9025;hpb=39503f82427e22ed8e04d986ccdc8562091ec62e;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 2d14cede7e..59f9bb59be 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -1,6 +1,6 @@ /* Target-dependent code for Renesas M32R, for GDB. - Copyright (C) 1996-2017 Free Software Foundation, Inc. + Copyright (C) 1996-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -35,7 +35,6 @@ #include "regcache.h" #include "trad-frame.h" #include "dis-asm.h" -#include "objfiles.h" #include "m32r-tdep.h" #include @@ -44,8 +43,6 @@ /* Local functions */ -extern void _initialize_m32r_tdep (void); - static CORE_ADDR m32r_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) { @@ -247,7 +244,7 @@ static void m32r_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { - struct gdbarch *gdbarch = get_regcache_arch (regcache); + struct gdbarch *gdbarch = regcache->arch (); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR regval; int len = TYPE_LENGTH (type); @@ -651,25 +648,11 @@ m32r_frame_unwind_cache (struct frame_info *this_frame, return info; } -static CORE_ADDR -m32r_read_pc (struct regcache *regcache) -{ - ULONGEST pc; - regcache_cooked_read_unsigned (regcache, M32R_PC_REGNUM, &pc); - return pc; -} - -static CORE_ADDR -m32r_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, M32R_SP_REGNUM); -} - - static CORE_ADDR m32r_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, + struct value **args, CORE_ADDR sp, + function_call_return_method return_method, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -693,7 +676,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* If STRUCT_RETURN is true, then the struct return address (in STRUCT_ADDR) will consume the first argument-passing register. Both adjust the register count and store that value. */ - if (struct_return) + if (return_method == return_method_struct) { regcache_cooked_write_unsigned (regcache, argreg, struct_addr); argreg++; @@ -772,7 +755,7 @@ static void m32r_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *dst) { - struct gdbarch *gdbarch = get_regcache_arch (regcache); + struct gdbarch *gdbarch = regcache->arch (); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int len = TYPE_LENGTH (type); ULONGEST tmp; @@ -808,14 +791,6 @@ m32r_return_value (struct gdbarch *gdbarch, struct value *function, } } - - -static CORE_ADDR -m32r_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, M32R_PC_REGNUM); -} - /* Given a GDB frame, determine the address of the calling function's frame. This will be used to create a new GDB frame struct. */ @@ -882,18 +857,6 @@ static const struct frame_base m32r_frame_base = { m32r_frame_base_address }; -/* Assuming THIS_FRAME is a dummy, return the frame ID of that dummy - frame. The frame ID's base needs to match the TOS value saved by - save_dummy_frame_tos(), and the PC match the dummy frame's breakpoint. */ - -static struct frame_id -m32r_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - CORE_ADDR sp = get_frame_register_unsigned (this_frame, M32R_SP_REGNUM); - return frame_id_build (sp, get_frame_pc (this_frame)); -} - - static gdbarch_init_ftype m32r_gdbarch_init; static struct gdbarch * @@ -908,15 +871,12 @@ m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return arches->gdbarch; /* Allocate space for the new architecture. */ - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); set_gdbarch_wchar_bit (gdbarch, 16); set_gdbarch_wchar_signed (gdbarch, 0); - set_gdbarch_read_pc (gdbarch, m32r_read_pc); - set_gdbarch_unwind_sp (gdbarch, m32r_unwind_sp); - set_gdbarch_num_regs (gdbarch, M32R_NUM_REGS); set_gdbarch_pc_regnum (gdbarch, M32R_PC_REGNUM); set_gdbarch_sp_regnum (gdbarch, M32R_SP_REGNUM); @@ -939,14 +899,6 @@ m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) frame_base_set_default (gdbarch, &m32r_frame_base); - /* Methods for saving / extracting a dummy frame's ID. The ID's - stack address must match the SP value returned by - PUSH_DUMMY_CALL, and saved by generic_save_dummy_frame_tos. */ - set_gdbarch_dummy_id (gdbarch, m32r_dummy_id); - - /* Return the unwound PC value. */ - set_gdbarch_unwind_pc (gdbarch, m32r_unwind_pc); - /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch);