aboutsummaryrefslogtreecommitdiff
path: root/gdb/mips-tdep.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>1993-03-28 19:28:26 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>1993-03-28 19:28:26 +0000
commit0b0d6c3fa7fe45549ce89c70f896a11d5f4cff5a (patch)
tree5a14e1eb1739e4088d1d6eab86cf51ba05c797db /gdb/mips-tdep.c
parent53f6119fc612d594c69e8bba420f571c65b74c17 (diff)
downloadgdb-0b0d6c3fa7fe45549ce89c70f896a11d5f4cff5a.zip
gdb-0b0d6c3fa7fe45549ce89c70f896a11d5f4cff5a.tar.gz
gdb-0b0d6c3fa7fe45549ce89c70f896a11d5f4cff5a.tar.bz2
* breakpoint.c (breakpoint_re_set_one): Fix storage leak.
* breakpoint.c (enable_breakpoint): Don't enable watchpoint if it went out of scope. * exec.c (exec_close): Fix storage leak. * exec.c (exec_file_command): Make sure that bfd doesn't realign the output sections when patching an executable. * mips-nat.c (store_inferior_registers): Use REGISTER_PTRACE_ADDR when writing all registers. * mips-tdep.c (mips_push_dummy_frame): Save floating point registers at the right offset in the dummy frame. * mipsread.c (psymtab_to_symtab_1): Do not complain for stProc, stStaticProc and stEnd symbols as they are generated by gcc-2.x. * mipsread.c (mipscoff_new_init): Initialize stabsread and buildsym.
Diffstat (limited to 'gdb/mips-tdep.c')
-rw-r--r--gdb/mips-tdep.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index b21d269..d68fbc29 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -502,8 +502,8 @@ mips_push_dummy_frame()
write_memory (save_address, (char *)&buffer, sizeof(REGISTER_TYPE));
save_address -= 4;
}
- /* save floating-points registers */
- save_address = sp + PROC_FREG_OFFSET(proc_desc);
+ /* save floating-points registers starting with high order word */
+ save_address = sp + PROC_FREG_OFFSET(proc_desc) + 4;
for (ireg = 32; --ireg >= 0; )
if (PROC_FREG_MASK(proc_desc) & (1 << ireg))
{
@@ -713,9 +713,10 @@ isa_NAN(p, len)
else return 1;
}
-/* To skip prologues, I use this predicate. Returns either PC
- itself if the code at PC does not look like a function prologue,
- PC+4 if it does (our caller does not need anything more fancy). */
+/* To skip prologues, I use this predicate. Returns either PC
+ itself if the code at PC does not look like a function prologue;
+ otherwise returns an address that (if we're lucky) follows
+ the prologue. */
CORE_ADDR
mips_skip_prologue(pc)
@@ -725,6 +726,7 @@ mips_skip_prologue(pc)
struct block *b;
unsigned long inst;
int offset;
+ int seen_sp_adjust = 0;
/* For -g modules and most functions anyways the
first instruction adjusts the stack.
@@ -733,10 +735,14 @@ mips_skip_prologue(pc)
for (offset = 0; offset < 100; offset += 4) {
inst = read_memory_integer(pc + offset, 4);
if ((inst & 0xffff0000) == 0x27bd0000) /* addiu $sp,$sp,offset */
- return pc + offset + 4;
- if ((inst & 0xFFE00000) != 0xAFA00000) /* sw reg,n($sp) */
- break;
+ seen_sp_adjust = 1;
+ else if ((inst & 0xFFE00000) == 0xAFA00000) /* sw reg,n($sp) */
+ continue;
+ else
+ break;
}
+ if (seen_sp_adjust)
+ return pc + offset;
/* Well, it looks like a frameless. Let's make sure.
Note that we are not called on the current PC,