* config/mips-tm-mips.h (mips_extra_func_info): New frame_adjust

member for storing offset of MIPS16 frame pointer from SP.
	* mips-tdep.c: Use RA_REGNUM instead of hardcoded 31 throughout.
	(PROC_FRAME_ADJUST): Define.
	(mips16_heuristic_proc_desc): Store frame pointer adjustment value.
	(get_frame_pointer): Use frame pointer adjustment value when
	calculating frame address.
	* remote-sim.c (gdbsim_fetch_register): Don't fetch registers
	that have a null or empty name.
start-sanitize-tx19
	* config/mips/tm-tx19.h (MIPS_DEFAULT_FPU_TYPE): Define.
	(REGISTER_NAMES): Redefine to eliminate FP registers.
	* config/mips/tm-tx19l.h: Ditto.
end-sanitize-tx19
This commit is contained in:
Mark Alexander 1997-09-26 19:42:55 +00:00
parent b28ad90b4d
commit af774411e5
4 changed files with 34 additions and 12 deletions

View File

@ -1,3 +1,20 @@
Fri Sep 26 12:22:00 1997 Mark Alexander <marka@cygnus.com>
* config/mips-tm-mips.h (mips_extra_func_info): New frame_adjust
member for storing offset of MIPS16 frame pointer from SP.
* mips-tdep.c: Use RA_REGNUM instead of hardcoded 31 throughout.
(PROC_FRAME_ADJUST): Define.
(mips16_heuristic_proc_desc): Store frame pointer adjustment value.
(get_frame_pointer): Use frame pointer adjustment value when
calculating frame address.
* remote-sim.c (gdbsim_fetch_register): Don't fetch registers
that have a null or empty name.
start-sanitize-tx19
* config/mips/tm-tx19.h (MIPS_DEFAULT_FPU_TYPE): Define.
(REGISTER_NAMES): Redefine to eliminate FP registers.
* config/mips/tm-tx19l.h: Ditto.
end-sanitize-tx19
Fri Sep 26 12:40:51 1997 Jeffrey A Law (law@cygnus.com)
Michael Snyder (msnyder@cleaver.cygnus.com)

View File

@ -452,6 +452,7 @@ extern void ecoff_relocate_efi PARAMS ((struct symbol *, CORE_ADDR));
typedef struct mips_extra_func_info {
long numargs; /* number of args to procedure (was iopt) */
bfd_vma high_addr; /* upper address bound */
long frame_adjust; /* offset of FP from SP (used on MIPS16) */
PDR pdr; /* Procedure descriptor record */
} *mips_extra_func_info_t;

View File

@ -190,6 +190,7 @@ static unsigned int heuristic_fence_post = 0;
#define PROC_HIGH_ADDR(proc) ((proc)->high_addr) /* upper address bound */
#define PROC_FRAME_OFFSET(proc) ((proc)->pdr.frameoffset)
#define PROC_FRAME_REG(proc) ((proc)->pdr.framereg)
#define PROC_FRAME_ADJUST(proc) ((proc)->frame_adjust)
#define PROC_REG_MASK(proc) ((proc)->pdr.regmask)
#define PROC_FREG_MASK(proc) ((proc)->pdr.fregmask)
#define PROC_REG_OFFSET(proc) ((proc)->pdr.regoffset)
@ -323,7 +324,7 @@ mips16_decode_reg_save (inst, gen_mask)
}
else if ((inst & 0xff00) == 0x6200 /* sw $ra,n($sp) */
|| (inst & 0xff00) == 0xfa00) /* sd $ra,n($sp) */
*gen_mask |= (1 << 31);
*gen_mask |= (1 << RA_REGNUM);
}
@ -721,7 +722,7 @@ Otherwise, you told GDB there was a function where there isn't one, or\n\
static int
mips16_get_imm (prev_inst, inst, nbits, scale, is_signed)
unsigned short prev_inst; /* previous instruction */
unsigned short inst; /* current current instruction */
unsigned short inst; /* current instruction */
int nbits; /* number of bits in imm field */
int scale; /* scale factor to be applied to imm */
int is_signed; /* is the imm field signed? */
@ -763,7 +764,8 @@ mips16_heuristic_proc_desc(start_pc, limit_pc, next_frame, sp)
unsigned short prev_inst = 0; /* saved copy of previous instruction */
unsigned inst = 0; /* current instruction */
PROC_FRAME_OFFSET(&temp_proc_desc) = 0;
PROC_FRAME_OFFSET(&temp_proc_desc) = 0; /* size of stack frame */
PROC_FRAME_ADJUST(&temp_proc_desc) = 0; /* offset of FP from SP */
for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += MIPS16_INSTLEN)
{
@ -804,14 +806,14 @@ mips16_heuristic_proc_desc(start_pc, limit_pc, next_frame, sp)
else if ((inst & 0xff00) == 0x6200) /* sw $ra,n($sp) */
{
offset = mips16_get_imm (prev_inst, inst, 8, 4, 0);
PROC_REG_MASK(&temp_proc_desc) |= (1 << 31);
temp_saved_regs.regs[31] = sp + offset;
PROC_REG_MASK(&temp_proc_desc) |= (1 << RA_REGNUM);
temp_saved_regs.regs[RA_REGNUM] = sp + offset;
}
else if ((inst & 0xff00) == 0xfa00) /* sd $ra,n($sp) */
{
offset = mips16_get_imm (prev_inst, inst, 8, 8, 0);
PROC_REG_MASK(&temp_proc_desc) |= (1 << 31);
temp_saved_regs.regs[31] = sp + offset;
PROC_REG_MASK(&temp_proc_desc) |= (1 << RA_REGNUM);
temp_saved_regs.regs[RA_REGNUM] = sp + offset;
}
else if (inst == 0x673d) /* move $s1, $sp */
{
@ -823,6 +825,7 @@ mips16_heuristic_proc_desc(start_pc, limit_pc, next_frame, sp)
offset = mips16_get_imm (prev_inst, inst, 8, 4, 0);
frame_addr = sp + offset;
PROC_FRAME_REG (&temp_proc_desc) = 17;
PROC_FRAME_ADJUST (&temp_proc_desc) = offset;
}
else if ((inst & 0xFF00) == 0xd900) /* sw reg,offset($s1) */
{
@ -858,8 +861,8 @@ mips16_heuristic_proc_desc(start_pc, limit_pc, next_frame, sp)
offset = 28;
if (inst & 0x20)
{
PROC_REG_MASK(&temp_proc_desc) |= 1 << 31;
temp_saved_regs.regs[31] = sp + offset;
PROC_REG_MASK(&temp_proc_desc) |= 1 << RA_REGNUM;
temp_saved_regs.regs[RA_REGNUM] = sp + offset;
offset -= MIPS_REGSIZE;
}
@ -1110,8 +1113,9 @@ get_frame_pointer(frame, proc_desc)
struct frame_info *frame;
mips_extra_func_info_t proc_desc;
{
return ADDR_BITS_REMOVE (read_next_frame_reg (frame,
PROC_FRAME_REG(proc_desc)) + PROC_FRAME_OFFSET(proc_desc));
return ADDR_BITS_REMOVE (
read_next_frame_reg (frame, PROC_FRAME_REG (proc_desc)) +
PROC_FRAME_OFFSET (proc_desc) - PROC_FRAME_ADJUST (proc_desc));
}
mips_extra_func_info_t cached_proc_desc;

View File

@ -344,7 +344,7 @@ int regno;
for (regno = 0; regno < NUM_REGS; regno++)
gdbsim_fetch_register (regno);
}
else
else if (reg_names[regno] != NULL && *reg_names[regno] != '\0')
{
char buf[MAX_REGISTER_RAW_SIZE];