X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fv850-tdep.c;h=862ebb3c1c1ad15756ef559090972c7bddd4ae59;hb=d4b6d575691fda534ef98e8eb8f2fe77529f65ed;hp=2b239b627415ad701c12b5ed8cf0436686a541b1;hpb=627003499ddac21de88a2d00a0062e2f9407dcce;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 2b239b6274..862ebb3c1c 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -1,6 +1,7 @@ /* Target-dependent code for the NEC V850 for GDB, the GNU debugger. - Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003 - Free Software Foundation, Inc. + + Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free + Software Foundation, Inc. This file is part of GDB. @@ -27,7 +28,7 @@ #include "bfd.h" #include "gdb_string.h" #include "gdbcore.h" -#include "symfile.h" +#include "objfiles.h" #include "arch-utils.h" #include "regcache.h" #include "symtab.h" @@ -247,16 +248,6 @@ v850_register_raw_size (int regnum) return v850_reg_size; } -/* Function: v850_register_virtual_size - Returns the number of bytes occupied by the register as represented - internally by gdb. */ - -static int -v850_register_virtual_size (int regnum) -{ - return v850_register_raw_size (regnum); -} - /* Function: v850_reg_virtual_type Returns the default type for register N. */ @@ -810,8 +801,8 @@ v850_find_callers_reg (struct frame_info *fi, int regnum) get_frame_base (fi))) return deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), regnum); - else if (get_frame_saved_regs (fi)[regnum] != 0) - return read_memory_unsigned_integer (get_frame_saved_regs (fi)[regnum], + else if (deprecated_get_frame_saved_regs (fi)[regnum] != 0) + return read_memory_unsigned_integer (deprecated_get_frame_saved_regs (fi)[regnum], v850_register_raw_size (regnum)); return read_register (regnum); @@ -894,15 +885,15 @@ v850_pop_frame (void) if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), get_frame_base (frame), get_frame_base (frame))) - generic_pop_dummy_frame (); + deprecated_pop_dummy_frame (); else { write_register (E_PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (frame)); for (regnum = 0; regnum < E_NUM_REGS; regnum++) - if (get_frame_saved_regs (frame)[regnum] != 0) + if (deprecated_get_frame_saved_regs (frame)[regnum] != 0) write_register (regnum, - read_memory_unsigned_integer (get_frame_saved_regs (frame)[regnum], + read_memory_unsigned_integer (deprecated_get_frame_saved_regs (frame)[regnum], v850_register_raw_size (regnum))); write_register (E_SP_REGNUM, get_frame_base (frame)); @@ -1028,27 +1019,6 @@ v850_frame_saved_pc (struct frame_info *fi) } -/* Function: fix_call_dummy - Pokes the callee function's address into the CALL_DUMMY assembly stub. - Assumes that the CALL_DUMMY looks like this: - jarl , r31 - trap - */ - -static void -v850_fix_call_dummy (char *dummy, CORE_ADDR sp, CORE_ADDR fun, int nargs, - struct value **args, struct type *type, int gcc_p) -{ - long offset24; - - offset24 = (long) fun - (long) entry_point_address (); - offset24 &= 0x3fffff; - offset24 |= 0xff800000; /* jarl , r31 */ - - store_unsigned_integer ((unsigned int *) &dummy[2], 2, offset24 & 0xffff); - store_unsigned_integer ((unsigned int *) &dummy[0], 2, offset24 >> 16); -} - static CORE_ADDR v850_saved_pc_after_call (struct frame_info *ignore) { @@ -1074,7 +1044,7 @@ v850_extract_return_value (struct type *type, char *regbuf, char *valbuf) pointed to by R6. */ return_buffer = extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (E_V0_REGNUM), - REGISTER_RAW_SIZE (E_V0_REGNUM)); + DEPRECATED_REGISTER_RAW_SIZE (E_V0_REGNUM)); read_memory (return_buffer, valbuf, TYPE_LENGTH (type)); } @@ -1088,13 +1058,6 @@ v850_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) return breakpoint; } -static CORE_ADDR -v850_extract_struct_value_address (char *regbuf) -{ - return extract_unsigned_integer (regbuf + v850_register_byte (E_V0_REGNUM), - v850_register_raw_size (E_V0_REGNUM)); -} - static void v850_store_return_value (struct type *type, char *valbuf) { @@ -1117,7 +1080,7 @@ v850_frame_init_saved_regs (struct frame_info *fi) struct pifsr pifsrs[E_NUM_REGS + 1], *pifsr; CORE_ADDR func_addr, func_end; - if (!get_frame_saved_regs (fi)) + if (!deprecated_get_frame_saved_regs (fi)) { frame_saved_regs_zalloc (fi); @@ -1140,10 +1103,10 @@ v850_frame_init_saved_regs (struct frame_info *fi) for (pifsr = pifsrs; pifsr->framereg; pifsr++) { - get_frame_saved_regs (fi)[pifsr->reg] = pifsr->offset + get_frame_base (fi); + deprecated_get_frame_saved_regs (fi)[pifsr->reg] = pifsr->offset + get_frame_base (fi); if (pifsr->framereg == E_SP_REGNUM) - get_frame_saved_regs (fi)[pifsr->reg] += pi.frameoffset; + deprecated_get_frame_saved_regs (fi)[pifsr->reg] += pi.frameoffset; } } /* Else we're out of luck (can't debug completely stripped code). @@ -1191,7 +1154,6 @@ v850_target_read_fp (void) static struct gdbarch * v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { - static LONGEST call_dummy_words[1] = { 0 }; struct gdbarch_tdep *tdep = NULL; struct gdbarch *gdbarch; int i; @@ -1213,7 +1175,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* NOTE: cagney/2002-12-06: This can be deleted when this arch is ready to unwind the PC first (see frame.c:get_prev_frame()). */ - set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + set_gdbarch_deprecated_init_frame_pc (gdbarch, deprecated_init_frame_pc_default); for (i = 0; v850_processor_type_table[i].regnames != NULL; i++) { @@ -1259,13 +1221,6 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) */ /* Stack grows up. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); - /* PC stops zero byte after a trap instruction - (which means: exactly on trap instruction). */ - set_gdbarch_decr_pc_after_break (gdbarch, 0); - /* This value is almost never non-zero... */ - set_gdbarch_function_start_offset (gdbarch, 0); - /* This value is almost never non-zero... */ - set_gdbarch_frame_args_skip (gdbarch, 0); /* * Call Dummies @@ -1277,11 +1232,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_pop_frame (gdbarch, v850_pop_frame); set_gdbarch_deprecated_store_struct_return (gdbarch, v850_store_struct_return); set_gdbarch_deprecated_store_return_value (gdbarch, v850_store_return_value); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, v850_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, v850_use_struct_convention); - set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_nil); - set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0); - set_gdbarch_deprecated_fix_call_dummy (gdbarch, v850_fix_call_dummy); set_gdbarch_breakpoint_from_pc (gdbarch, v850_breakpoint_from_pc); set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);