From bf1f5b4c04267cbdb8daf5193af67b7ae6ac4f6c Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Fri, 16 Aug 2002 03:07:34 +0000 Subject: [PATCH] 2002-08-15 Michael Snyder * mips-tdep.c (mips_do_registers_info): Make static. (mips_gdbarch_init): Insert mips_do_registers_info into gdbarch. * config/mips/tm-mips.h (DO_REGISTERS_INFO): Delete. --- gdb/ChangeLog | 4 +++ gdb/config/mips/tm-mips.h | 6 ----- gdb/mips-tdep.c | 57 ++++++++++++--------------------------- 3 files changed, 21 insertions(+), 46 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bf15e89053f..e1cd9692162 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -8,11 +8,15 @@ REGISTER_CONVERT_TO_RAW, REGISTER_CONVERTIBLE, MAX_REGISTER_RAW_SIZE, MAX_REGISTER_VIRTUAL_SIZE): Delete. (TARGET_READ_SP): Delete. + (DO_REGISTERS_INFO): Delete. + * mips-tdep.c (mips_gdbarch_init): Set the above in the gdbarch. (mips_register_convertible, mips_register_convert_to_virtual, mips_register_convert_to_raw): Make static. (mips_read_sp): New function. (mips_gdbarch_init): Set gdbarch read_sp to mips_read_sp. + (mips_do_registers_info): Make static. + (mips_gdbarch_init): Insert mips_do_registers_info into gdbarch. 2002-08-15 Andrew Cagney diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h index 4552d96d42e..7d9e9161223 100644 --- a/gdb/config/mips/tm-mips.h +++ b/gdb/config/mips/tm-mips.h @@ -141,12 +141,6 @@ extern const char *mips_register_name (int regnr); #define PRID_REGNUM 89 /* Processor ID */ #define LAST_EMBED_REGNUM 89 /* Last one */ -/* Define DO_REGISTERS_INFO() to do machine-specific formatting - of register dumps. */ - -#define DO_REGISTERS_INFO(_regnum, fp) mips_do_registers_info(_regnum, fp) -extern void mips_do_registers_info (int, int); - /* Total amount of space needed to store our copies of the machine's register state, the array `registers'. */ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 478be209ec2..a70fd16e165 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -2302,11 +2302,9 @@ mips_frame_chain (struct frame_info *frame) we loop forever if we see a zero size frame. */ if (PROC_FRAME_REG (proc_desc) == SP_REGNUM && PROC_FRAME_OFFSET (proc_desc) == 0 - /* The previous frame from a sigtramp frame might be frameless - and have frame size zero. */ - && !frame->signal_handler_caller - /* Check if this is a call dummy frame. */ - && frame->pc != mips_call_dummy_address ()) + /* The previous frame from a sigtramp frame might be frameless + and have frame size zero. */ + && !frame->signal_handler_caller) return 0; else return get_frame_pointer (frame, proc_desc); @@ -3356,22 +3354,13 @@ mips_pop_frame (void) if (frame->saved_regs == NULL) FRAME_INIT_SAVED_REGS (frame); for (regnum = 0; regnum < NUM_REGS; regnum++) - if (regnum != SP_REGNUM && regnum != PC_REGNUM - && frame->saved_regs[regnum]) - { - /* Floating point registers must not be sign extended, - in case MIPS_SAVED_REGSIZE = 4 but sizeof (FP0_REGNUM) == 8. */ - - if (FP0_REGNUM <= regnum && regnum < FP0_REGNUM + 32) - write_register (regnum, - read_memory_unsigned_integer (frame->saved_regs[regnum], - MIPS_SAVED_REGSIZE)); - else - write_register (regnum, - read_memory_integer (frame->saved_regs[regnum], - MIPS_SAVED_REGSIZE)); - } - + { + if (regnum != SP_REGNUM && regnum != PC_REGNUM + && frame->saved_regs[regnum]) + write_register (regnum, + read_memory_integer (frame->saved_regs[regnum], + MIPS_SAVED_REGSIZE)); + } write_register (SP_REGNUM, new_sp); flush_cached_frames (); @@ -3739,7 +3728,7 @@ do_gp_register_row (int regnum) /* MIPS_DO_REGISTERS_INFO(): called by "info register" command */ -void +static void mips_do_registers_info (int regnum, int fpregs) { if (regnum != -1) /* do one specified register */ @@ -4098,28 +4087,15 @@ return_value_location (struct type *valtype, if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && len < MIPS_SAVED_REGSIZE) { - if ((gdbarch_tdep (current_gdbarch) -> mips_abi == MIPS_ABI_N32 - || gdbarch_tdep (current_gdbarch) -> mips_abi == MIPS_ABI_N64) - && (TYPE_CODE (valtype) == TYPE_CODE_STRUCT - || TYPE_CODE (valtype) == TYPE_CODE_UNION)) - { - /* Values are already aligned in the low register. */ - lo->reg_offset = 0; - } - else - { - /* "un-left-justify" the value in the low register */ - lo->reg_offset = MIPS_SAVED_REGSIZE - len; - } - hi->reg_offset = 0; + /* "un-left-justify" the value in the low register */ + lo->reg_offset = MIPS_SAVED_REGSIZE - len; lo->len = len; + hi->reg_offset = 0; hi->len = 0; } else if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && len > MIPS_SAVED_REGSIZE /* odd-size structs */ && len < MIPS_SAVED_REGSIZE * 2 - && gdbarch_tdep (current_gdbarch) -> mips_abi != MIPS_ABI_N32 - && gdbarch_tdep (current_gdbarch) -> mips_abi != MIPS_ABI_N64 && (TYPE_CODE (valtype) == TYPE_CODE_STRUCT || TYPE_CODE (valtype) == TYPE_CODE_UNION)) { @@ -4957,7 +4933,6 @@ mips_gdbarch_init (struct gdbarch_info info, } } -#undef MIPS_DEFAULT_ABI #ifdef MIPS_DEFAULT_ABI if (mips_abi == MIPS_ABI_UNKNOWN) mips_abi = MIPS_DEFAULT_ABI; @@ -5238,7 +5213,7 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_call_dummy_words (gdbarch, mips_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (mips_call_dummy_words)); set_gdbarch_push_return_address (gdbarch, mips_push_return_address); - set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not); + set_gdbarch_register_convertible (gdbarch, mips_register_convertible); set_gdbarch_register_convert_to_virtual (gdbarch, mips_register_convert_to_virtual); set_gdbarch_register_convert_to_raw (gdbarch, @@ -5264,6 +5239,8 @@ mips_gdbarch_init (struct gdbarch_info info, define REGISTER_VIRTUAL_TYPE. */ set_gdbarch_register_virtual_type (gdbarch, mips_register_virtual_type); + set_gdbarch_do_registers_info (gdbarch, mips_do_registers_info); + /* Hook in OS ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch, osabi); -- 2.30.2