* 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.
This commit is contained in:
Peter Schauer 1993-03-28 19:28:26 +00:00
parent 53f6119fc6
commit 0b0d6c3fa7
5 changed files with 40 additions and 10 deletions

View File

@ -1,3 +1,19 @@
Sun Mar 28 11:24:37 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* 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.
Fri Mar 26 15:25:05 1993 John Gilmore (gnu@cygnus.com) Fri Mar 26 15:25:05 1993 John Gilmore (gnu@cygnus.com)
* Makefile.in (TARFILES): Avoid trailing backslash. * Makefile.in (TARFILES): Avoid trailing backslash.

View File

@ -2220,6 +2220,8 @@ breakpoint_re_set_one (bint)
if (b->cond_string != NULL) if (b->cond_string != NULL)
{ {
s = b->cond_string; s = b->cond_string;
if (b->cond)
free ((PTR)b->cond);
b->cond = parse_exp_1 (&s, block_for_pc (sals.sals[i].pc), 0); b->cond = parse_exp_1 (&s, block_for_pc (sals.sals[i].pc), 0);
} }
@ -2408,6 +2410,7 @@ enable_breakpoint (bpt)
printf_filtered ("\ printf_filtered ("\
Cannot enable watchpoint %d because the block in which its expression\n\ Cannot enable watchpoint %d because the block in which its expression\n\
is valid is not currently in scope.\n", bpt->number); is valid is not currently in scope.\n", bpt->number);
bpt->enable = disabled;
return; return;
} }

View File

@ -125,7 +125,7 @@ store_inferior_registers (regno)
|| regno == FCRIR_REGNUM || regno == FP_REGNUM || regno == FCRIR_REGNUM || regno == FP_REGNUM
|| (regno >= FIRST_EMBED_REGNUM && regno <= LAST_EMBED_REGNUM)) || (regno >= FIRST_EMBED_REGNUM && regno <= LAST_EMBED_REGNUM))
continue; continue;
regaddr = register_addr (regno, 1); regaddr = REGISTER_PTRACE_ADDR (regno);
errno = 0; errno = 0;
ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
read_register (regno)); read_register (regno));

View File

@ -502,8 +502,8 @@ mips_push_dummy_frame()
write_memory (save_address, (char *)&buffer, sizeof(REGISTER_TYPE)); write_memory (save_address, (char *)&buffer, sizeof(REGISTER_TYPE));
save_address -= 4; save_address -= 4;
} }
/* save floating-points registers */ /* save floating-points registers starting with high order word */
save_address = sp + PROC_FREG_OFFSET(proc_desc); save_address = sp + PROC_FREG_OFFSET(proc_desc) + 4;
for (ireg = 32; --ireg >= 0; ) for (ireg = 32; --ireg >= 0; )
if (PROC_FREG_MASK(proc_desc) & (1 << ireg)) if (PROC_FREG_MASK(proc_desc) & (1 << ireg))
{ {
@ -713,9 +713,10 @@ isa_NAN(p, len)
else return 1; else return 1;
} }
/* To skip prologues, I use this predicate. Returns either PC /* To skip prologues, I use this predicate. Returns either PC
itself if the code at PC does not look like a function prologue, 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). */ otherwise returns an address that (if we're lucky) follows
the prologue. */
CORE_ADDR CORE_ADDR
mips_skip_prologue(pc) mips_skip_prologue(pc)
@ -725,6 +726,7 @@ mips_skip_prologue(pc)
struct block *b; struct block *b;
unsigned long inst; unsigned long inst;
int offset; int offset;
int seen_sp_adjust = 0;
/* For -g modules and most functions anyways the /* For -g modules and most functions anyways the
first instruction adjusts the stack. first instruction adjusts the stack.
@ -733,10 +735,14 @@ mips_skip_prologue(pc)
for (offset = 0; offset < 100; offset += 4) { for (offset = 0; offset < 100; offset += 4) {
inst = read_memory_integer(pc + offset, 4); inst = read_memory_integer(pc + offset, 4);
if ((inst & 0xffff0000) == 0x27bd0000) /* addiu $sp,$sp,offset */ if ((inst & 0xffff0000) == 0x27bd0000) /* addiu $sp,$sp,offset */
return pc + offset + 4; seen_sp_adjust = 1;
if ((inst & 0xFFE00000) != 0xAFA00000) /* sw reg,n($sp) */ else if ((inst & 0xFFE00000) == 0xAFA00000) /* sw reg,n($sp) */
break; continue;
else
break;
} }
if (seen_sp_adjust)
return pc + offset;
/* Well, it looks like a frameless. Let's make sure. /* Well, it looks like a frameless. Let's make sure.
Note that we are not called on the current PC, Note that we are not called on the current PC,

View File

@ -330,6 +330,8 @@ static void
mipscoff_new_init (ignore) mipscoff_new_init (ignore)
struct objfile *ignore; struct objfile *ignore;
{ {
stabsread_new_init ();
buildsym_new_init ();
} }
static void static void
@ -2459,10 +2461,13 @@ psymtab_to_symtab_1 (pst, filename)
/* Handle encoded stab line number. */ /* Handle encoded stab line number. */
record_line (current_subfile, sh.index, valu); record_line (current_subfile, sh.index, valu);
} }
else if (sh.st == stProc || sh.st == stStaticProc || sh.st == stEnd)
/* These are generated by gcc-2.x, do not complain */
;
else else
complain (&stab_unknown_complaint, name); complain (&stab_unknown_complaint, name);
} }
st = end_symtab (pst->texthigh, 0, 0, pst->objfile); st = end_symtab (pst->texthigh, 0, 0, pst->objfile, SECT_OFF_TEXT);
end_stabs (); end_stabs ();
/* Sort the symbol table now, we are done adding symbols to it. /* Sort the symbol table now, we are done adding symbols to it.