This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] MIPS: Fix breakpoints on frameless functions


Hi,

 There's a piece of code in the standard MIPS prologue scanner that 
accumulates an adjustment to be made to the address of the end of the 
prologue sequence if some immediate load instructions turn out not to be 
related to an SP adjustment sequence.  The problem is the adjustment is 
made to the address even if these instructions are beyond the end of the 
prologue.  As a result, the address is decremented too much, perhaps even 
before the beginning of the function handled.  A notable problem seen by 
the user if that happens is that a breakpoint is misplaced.  This only 
happens if the function has no frame (no SP manipulation has been seen).

 Fixed thus.  Regression-tested with mips-sde-elf and mips-linux-gnu 
successfully.  OK to apply?

2011-11-23  Maciej W. Rozycki  <macro@codesourcery.com>

	gdb/
	* mips-tdep.c (mips32_scan_prologue): Only update the immediate
	load adjustment if still within the prologue.

  Maciej

gdb-mips-scan-prologue-imm.diff
Index: gdb-fsf-trunk-quilt/gdb/mips-tdep.c
===================================================================
--- gdb-fsf-trunk-quilt.orig/gdb/mips-tdep.c	2011-11-23 02:43:17.315559888 +0000
+++ gdb-fsf-trunk-quilt/gdb/mips-tdep.c	2011-11-23 02:43:20.955595369 +0000
@@ -2273,7 +2273,8 @@ mips32_scan_prologue (struct gdbarch *gd
                    || high_word == 0x3408 /* ori $t0,$zero,n */
                   ))
        {
-          load_immediate_bytes += MIPS_INSN32_SIZE;     	/* FIXME!  */
+	 if (end_prologue_addr == 0)
+	   load_immediate_bytes += MIPS_INSN32_SIZE;		/* FIXME!  */
        }
       else
        {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]