Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Improve end check on rs6000 prologue analyzer
@ 2006-09-29 21:37 Daniel Jacobowitz
  2006-09-30 19:32 ` Mark Kettenis
  0 siblings, 1 reply; 24+ messages in thread
From: Daniel Jacobowitz @ 2006-09-29 21:37 UTC (permalink / raw)
  To: gdb-patches

This patch corrects a check in the optimized code motion support of the
PPC prologue analyzer.  The lr_reg check doesn't match the comment, which
says we should keep going if the return address hasn't been saved yet;
it would stop if a scheduled instruction was encountered before mflr.

This fixes the new test; incidentally fixes e500-prologue.exp on non-e500
targets, where the evstdd is disassembled as a garbage altivec instruction
and otherwise stops the prologue analyzer early; and breaks one test in
ovldbreak.exp which now sets a breakpoint a few instructions past the end of
the prologue.  But it will never skip a branch, and I concluded that the
new failure ought to be stopped by the line-table-checking code, so it's
a bug there rather than here.

Any comments on this patch?  Otherwise, I'll plan to commit it in a few
days.

-- 
Daniel Jacobowitz
CodeSourcery

2006-09-29  Daniel Jacobowitz  <dan@codesourcery.com>

	* rs6000-tdep.c (skip_prologue): Correct test for saved PC.

2006-09-29  Daniel Jacobowitz  <dan@codesourcery.com>

	* gdb.arch/powerpc-prologue.c (optimized_1_marker, gdb2029_marker)
	(optimized_1): New.
	(main): Call optimized_1.
	(gdb2029): Correct typos.  Call gdb2029_marker.
	* gdb.arch/powerpc-prologue.exp: Run new test.  Use a breakpoint
	for gdb2029.

Index: rs6000-tdep.c
===================================================================
RCS file: /home/gcc/repos/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.258
diff -u -p -r1.258 rs6000-tdep.c
--- rs6000-tdep.c	23 Apr 2006 14:15:01 -0000	1.258
+++ rs6000-tdep.c	29 Sep 2006 20:46:03 -0000
@@ -1414,8 +1414,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
 	     Handle optimizer code motions into the prologue by continuing
 	     the search if we have no valid frame yet or if the return
 	     address is not yet saved in the frame.  */
-	  if (fdata->frameless == 0
-	      && (lr_reg == -1 || fdata->nosavedpc == 0))
+	  if (fdata->frameless == 0 && fdata->nosavedpc == 0)
 	    break;
 
 	  if (op == 0x4e800020		/* blr */
Index: testsuite/gdb.arch/powerpc-prologue.c
===================================================================
RCS file: /home/gcc/repos/src/src/gdb/testsuite/gdb.arch/powerpc-prologue.c,v
retrieving revision 1.1
diff -u -p -r1.1 powerpc-prologue.c
--- testsuite/gdb.arch/powerpc-prologue.c	23 Jan 2006 01:47:32 -0000	1.1
+++ testsuite/gdb.arch/powerpc-prologue.c	29 Sep 2006 20:43:33 -0000
@@ -31,23 +31,54 @@ int
 main (void)
 {
   gdb2029 ();
+  optimized_1 ();
   return 0;
 }
 
+void
+optimized_1_marker (void)
+{
+}
+
+void
+gdb2029_marker (void)
+{
+}
+
 /* A typical PIC prologue from GCC.  */
 
 asm(".text\n"
-    "    .align 8\n"
+    "    .p2align 3\n"
     SYMBOL (gdb2029) ":\n"
-    "	stw	%r1, -32(%r1)\n"
+    "	stwu	%r1, -32(%r1)\n"
     "	mflr	%r0\n"
     "	bcl-	20,31,.+4\n"
     "	stw	%r30, 24(%r1)\n"
     "	mflr	%r30\n"
     "	stw	%r0, 36(%r1)\n"
-    "	twge	%r2, %r2\n"
+    "	bl	gdb2029_marker\n"
     "	lwz	%r0, 36(%r1)\n"
     "	lwz	%r30, 24(%r1)\n"
     "	mtlr	%r0\n"
-    "	addi	%r0, %r0, 32\n"
+    "	addi	%r1, %r1, 32\n"
+    "	blr");
+
+/* A heavily scheduled prologue.  */
+asm(".text\n"
+    "	.p2align 3\n"
+    SYMBOL (optimized_1) ":\n"
+    "	stwu	%r1,-32(%r1)\n"
+    "	lis	%r9,-16342\n"
+    "	lis	%r11,-16342\n"
+    "	mflr	%r0\n"
+    "	addi	%r11,%r11,3776\n"
+    "	stmw	%r27,12(%r1)\n"
+    "	addi	%r31,%r9,3152\n"
+    "	cmplw	%cr7,%r31,%r11\n"
+    "	stw	%r0,36(%r1)\n"
+    "	mr	%r30,%r3\n"
+    "	bl	optimized_1_marker\n"
+    "	lwz	%r0,36(%r1)\n"
+    "	lmw	%r27,12(%r1)\n"
+    "	addi	%r1,%r1,32\n"
     "	blr");
Index: testsuite/gdb.arch/powerpc-prologue.exp
===================================================================
RCS file: /home/gcc/repos/src/src/gdb/testsuite/gdb.arch/powerpc-prologue.exp,v
retrieving revision 1.1
diff -u -p -r1.1 powerpc-prologue.exp
--- testsuite/gdb.arch/powerpc-prologue.exp	23 Jan 2006 01:47:32 -0000	1.1
+++ testsuite/gdb.arch/powerpc-prologue.exp	29 Sep 2006 20:48:14 -0000
@@ -50,12 +50,40 @@ if ![runto_main] then {
 
 # Testcase for PIC prologue.
 
-gdb_test "continue" "Program received signal SIGTRAP.*" "continue to PIC"
+gdb_breakpoint "gdb2029_marker"
+gdb_test "continue" "Breakpoint $decimal, $hex in gdb2029_marker \\(\\)" \
+	"continue to PIC"
 
 gdb_test "backtrace 10" \
-	"#0\[ \t\]*$hex in gdb2029.*\r\n#1\[ \t\]*$hex in main.*" \
+	"#0\[ \t\]*$hex in gdb2029_marker.*\r\n#1\[ \t\]*$hex in gdb2029.*\r\n#2\[ \t\]*$hex in main.*" \
+	"backtrace in PIC marker"
+
+gdb_test "finish" ".*$hex in gdb2029 .*" "finish from PIC"
+
+gdb_test "backtrace 10" \
+	"#0\[ \t\]*$hex in gdb2029 .*\r\n#1\[ \t\]*$hex in main.*" \
 	"backtrace in PIC"
 
 gdb_test "info frame" \
 	".*Saved registers:.*r30 at.*r31 at.*pc at.*lr at.*" \
 	"saved registers in PIC"
+
+# Testcase for scheduled prologue.
+
+gdb_breakpoint "optimized_1_marker"
+gdb_test "continue" "Breakpoint $decimal, $hex in optimized_1_marker \\(\\)" \
+	"continue to optimized"
+
+gdb_test "backtrace 10" \
+	"#0\[ \t\]*$hex in optimized_1_marker.*\r\n#1\[ \t\]*$hex in optimized_1.*\r\n#2\[ \t\]*$hex in main.*" \
+	"backtrace in optimized marker"
+
+gdb_test "finish" ".*$hex in optimized_1 .*" "finish from optimized"
+
+gdb_test "backtrace 10" \
+	"#0\[ \t\]*$hex in optimized_1 .*\r\n#1\[ \t\]*$hex in main.*" \
+	"backtrace in optimized"
+
+gdb_test "info frame" \
+	".*Saved registers:.*r30 at.*r31 at.*pc at.*lr at.*" \
+	"saved registers in optimized"


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2006-09-29 21:37 Improve end check on rs6000 prologue analyzer Daniel Jacobowitz
@ 2006-09-30 19:32 ` Mark Kettenis
  2006-09-30 20:25   ` Daniel Jacobowitz
  2006-10-17 21:21   ` Daniel Jacobowitz
  0 siblings, 2 replies; 24+ messages in thread
From: Mark Kettenis @ 2006-09-30 19:32 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

> Date: Fri, 29 Sep 2006 17:37:26 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> Any comments on this patch?  Otherwise, I'll plan to commit it in a few
> days.

I get quite a few new regressions on OpenBSD/powerpc.  Please don't
commit this.

--- gdb.sum.1	Sat Sep 30 20:56:37 2006
+++ gdb.sum	Sat Sep 30 21:25:23 2006
@@ -1,4 +1,4 @@
-Test Run By kettenis on Sat Sep 30 20:33:48 2006
+Test Run By kettenis on Sat Sep 30 21:01:56 2006
 Native configuration is powerpc-unknown-openbsd4.0
 
 		=== gdb tests ===
@@ -48,8 +48,8 @@ See <URL:http://gcc.gnu.org/bugs.html> f
 UNTESTED: gdb.arch/altivec-regs.exp: altivec-regs.exp
 Running ../../../../src/gdb/gdb/testsuite/gdb.arch/e500-abi.exp ...
 Running ../../../../src/gdb/gdb/testsuite/gdb.arch/e500-prologue.exp ...
-gdb compile failed, /tmp//ccE11866.s: Assembler messages:
-/tmp//ccE11866.s:31: Error: Unrecognized opcode: `evstdd'
+gdb compile failed, /tmp//ccfP7121.s: Assembler messages:
+/tmp//ccfP7121.s:31: Error: Unrecognized opcode: `evstdd'
 UNSUPPORTED: gdb.arch/e500-prologue.exp: Testcase compile failed.
 Running ../../../../src/gdb/gdb/testsuite/gdb.arch/e500-regs.exp ...
 Running ../../../../src/gdb/gdb/testsuite/gdb.arch/gdb1291.exp ...
@@ -63,8 +63,15 @@ Running ../../../../src/gdb/gdb/testsuit
 Running ../../../../src/gdb/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp ...
 Running ../../../../src/gdb/gdb/testsuite/gdb.arch/powerpc-prologue.exp ...
 PASS: gdb.arch/powerpc-prologue.exp: continue to PIC
+PASS: gdb.arch/powerpc-prologue.exp: backtrace in PIC marker
+PASS: gdb.arch/powerpc-prologue.exp: finish from PIC
 PASS: gdb.arch/powerpc-prologue.exp: backtrace in PIC
 PASS: gdb.arch/powerpc-prologue.exp: saved registers in PIC
+PASS: gdb.arch/powerpc-prologue.exp: continue to optimized
+PASS: gdb.arch/powerpc-prologue.exp: backtrace in optimized marker
+PASS: gdb.arch/powerpc-prologue.exp: finish from optimized
+PASS: gdb.arch/powerpc-prologue.exp: backtrace in optimized
+PASS: gdb.arch/powerpc-prologue.exp: saved registers in optimized
 Running ../../../../src/gdb/gdb/testsuite/gdb.asm/asm-source.exp ...
 PASS: gdb.asm/asm-source.exp: f at main
 PASS: gdb.asm/asm-source.exp: next over macro
@@ -328,7 +335,7 @@ PASS: gdb.base/attach.exp: after attach2
 FAIL: gdb.base/attach.exp: after attach2, set tbreak postloop
 FAIL: gdb.base/attach.exp: (timeout) after attach2, reach tbreak postloop
 FAIL: gdb.base/attach.exp: after attach2, exit (timeout)
-PASS: gdb.base/attach.exp: set source path
+FAIL: gdb.base/attach.exp: set source path
 PASS: gdb.base/attach.exp: cd away from process working directory
 PASS: gdb.base/attach.exp: before attach3, flush symbols
 PASS: gdb.base/attach.exp: before attach3, flush exec
@@ -487,7 +494,7 @@ PASS: gdb.base/break.exp: run until file
 PASS: gdb.base/break.exp: run until file:function(3) breakpoint
 PASS: gdb.base/break.exp: run until file:function(2) breakpoint
 PASS: gdb.base/break.exp: run until file:function(1) breakpoint
-PASS: gdb.base/break.exp: run until quoted breakpoint
+FAIL: gdb.base/break.exp: run until quoted breakpoint
 PASS: gdb.base/break.exp: run until file:linenum breakpoint
 PASS: gdb.base/break.exp: breakpoint offset +1
 PASS: gdb.base/break.exp: step onto breakpoint
@@ -870,7 +877,7 @@ PASS: gdb.base/callfuncs.exp: bt after f
 PASS: gdb.base/callfuncs.exp: finish after stop in call dummy preserves register contents
 PASS: gdb.base/callfuncs.exp: call function causing a breakpoint and then do a return
 PASS: gdb.base/callfuncs.exp: back at main after return from call dummy breakpoint
-PASS: gdb.base/callfuncs.exp: return after stop in call dummy preserves register contents
+FAIL: gdb.base/callfuncs.exp: return after stop in call dummy preserves register contents
 PASS: gdb.base/callfuncs.exp: stop at nested call level 1
 PASS: gdb.base/callfuncs.exp: backtrace at nested call level 1
 PASS: gdb.base/callfuncs.exp: stop at nested call level 2
@@ -1295,8 +1302,8 @@ PASS: gdb.base/condbreak.exp: break mark
 PASS: gdb.base/condbreak.exp: breakpoint info
 PASS: gdb.base/condbreak.exp: rerun to main
 PASS: gdb.base/condbreak.exp: run until breakpoint set at a line number
-PASS: gdb.base/condbreak.exp: run until breakpoint at marker1
-PASS: gdb.base/condbreak.exp: run until breakpoint at marker2
+XFAIL: gdb.base/condbreak.exp: run until breakpoint at marker1
+FAIL: gdb.base/condbreak.exp: run until breakpoint at marker2
 Running ../../../../src/gdb/gdb/testsuite/gdb.base/consecutive.exp ...
 PASS: gdb.base/consecutive.exp: continue to breakpoint in foo
 PASS: gdb.base/consecutive.exp: get breakpoint address for foo
@@ -2084,12 +2091,12 @@ Running ../../../../src/gdb/gdb/testsuit
 PASS: gdb.base/ena-dis-br.exp: break marker1
 PASS: gdb.base/ena-dis-br.exp: enable break marker1
 PASS: gdb.base/ena-dis-br.exp: info break marker1
-PASS: gdb.base/ena-dis-br.exp: continue to break marker1
+XFAIL: gdb.base/ena-dis-br.exp: continue to break marker1
 PASS: gdb.base/ena-dis-br.exp: delete break marker1
 PASS: gdb.base/ena-dis-br.exp: break marker2
 PASS: gdb.base/ena-dis-br.exp: enable once break marker2
 PASS: gdb.base/ena-dis-br.exp: info auto-disabled break marker2
-PASS: gdb.base/ena-dis-br.exp: continue to auto-disabled break marker2
+XFAIL: gdb.base/ena-dis-br.exp: continue to auto-disabled break marker2
 PASS: gdb.base/ena-dis-br.exp: info auto-disabled break marker2
 PASS: gdb.base/ena-dis-br.exp: continue until exit at no stop
 PASS: gdb.base/ena-dis-br.exp: rerun to main
@@ -2111,7 +2118,7 @@ PASS: gdb.base/ena-dis-br.exp: ignore br
 PASS: gdb.base/ena-dis-br.exp: info ignored break marker1
 PASS: gdb.base/ena-dis-br.exp: continue until exit at no stop at ignored break marker1
 PASS: gdb.base/ena-dis-br.exp: rerun to main
-PASS: gdb.base/ena-dis-br.exp: continue to break marker1, 2nd time
+XFAIL: gdb.base/ena-dis-br.exp: continue to break marker1, 2nd time
 PASS: gdb.base/ena-dis-br.exp: break marker1
 PASS: gdb.base/ena-dis-br.exp: ignore break marker1
 PASS: gdb.base/ena-dis-br.exp: enable del break marker1
@@ -2611,14 +2618,14 @@ PASS: gdb.base/funcargs.exp: continue to
 PASS: gdb.base/funcargs.exp: print *fp
 PASS: gdb.base/funcargs.exp: print *dp
 PASS: gdb.base/funcargs.exp: run to call4a
-PASS: gdb.base/funcargs.exp: print *stp
+FAIL: gdb.base/funcargs.exp: print *stp
 PASS: gdb.base/funcargs.exp: continue to call4b
 PASS: gdb.base/funcargs.exp: print *unp (sizeof long == sizeof int)
 PASS: gdb.base/funcargs.exp: locate actual args, structs/unions passed by reference
-PASS: gdb.base/funcargs.exp: run to call5a
-PASS: gdb.base/funcargs.exp: print st
-PASS: gdb.base/funcargs.exp: continue to call5b (sizeof long == sizeof int)
-PASS: gdb.base/funcargs.exp: print un (sizeof long == sizeof int)
+FAIL: gdb.base/funcargs.exp: run to call5a
+FAIL: gdb.base/funcargs.exp: print st
+FAIL: gdb.base/funcargs.exp: continue to call5b (sizeof long == sizeof int)
+FAIL: gdb.base/funcargs.exp: print un (sizeof long == sizeof int)
 PASS: gdb.base/funcargs.exp: run to call6a
 PASS: gdb.base/funcargs.exp: backtrace from call6a
 PASS: gdb.base/funcargs.exp: continue to call6b
@@ -2639,7 +2646,7 @@ PASS: gdb.base/funcargs.exp: continue to
 PASS: gdb.base/funcargs.exp: backtrace from call6i
 PASS: gdb.base/funcargs.exp: continue to call6j
 PASS: gdb.base/funcargs.exp: backtrace from call6j
-PASS: gdb.base/funcargs.exp: continue to call6k
+FAIL: gdb.base/funcargs.exp: continue to call6k
 PASS: gdb.base/funcargs.exp: backtrace from call6k
 PASS: gdb.base/funcargs.exp: run to call7a
 PASS: gdb.base/funcargs.exp: backtrace from call7a
@@ -2663,7 +2670,7 @@ PASS: gdb.base/funcargs.exp: continue to
 PASS: gdb.base/funcargs.exp: backtrace from call7j
 PASS: gdb.base/funcargs.exp: continue to call7k
 PASS: gdb.base/funcargs.exp: backtrace from call7k
-PASS: gdb.base/funcargs.exp: run to hitbottom
+FAIL: gdb.base/funcargs.exp: run to hitbottom
 PASS: gdb.base/funcargs.exp: recursive passing of structs by value
 PASS: gdb.base/funcargs.exp: print c after runto localvars_after_alloca
 PASS: gdb.base/funcargs.exp: print s after runto localvars_after_alloca
@@ -4945,7 +4952,7 @@ PASS: gdb.base/sepdebug.exp: run until f
 PASS: gdb.base/sepdebug.exp: run until file:function(3) breakpoint
 PASS: gdb.base/sepdebug.exp: run until file:function(2) breakpoint
 PASS: gdb.base/sepdebug.exp: run until file:function(1) breakpoint
-PASS: gdb.base/sepdebug.exp: run until quoted breakpoint
+FAIL: gdb.base/sepdebug.exp: run until quoted breakpoint
 PASS: gdb.base/sepdebug.exp: run until file:linenum breakpoint
 PASS: gdb.base/sepdebug.exp: breakpoint offset +1
 PASS: gdb.base/sepdebug.exp: step onto breakpoint
@@ -5002,7 +5009,7 @@ PASS: gdb.base/sepdebug.exp: set separat
 PASS: gdb.base/sepdebug.exp: breakpoint function, optimized file
 PASS: gdb.base/sepdebug.exp: breakpoint small function, optimized file
 PASS: gdb.base/sepdebug.exp: run until function breakpoint, optimized file
-PASS: gdb.base/sepdebug.exp: run until breakpoint set at small function, optimized file
+FAIL: gdb.base/sepdebug.exp: run until breakpoint set at small function, optimized file
 Running ../../../../src/gdb/gdb/testsuite/gdb.base/setshow.exp ...
 PASS: gdb.base/setshow.exp: default annotation_level is zero
 PASS: gdb.base/setshow.exp: set annotate 2
@@ -6958,35 +6965,10 @@ PASS: gdb.base/watchpoint.exp: set watch
 PASS: gdb.base/watchpoint.exp: watchpoint found in watchpoint/breakpoint table
 PASS: gdb.base/watchpoint.exp: disable watchpoint
 PASS: gdb.base/watchpoint.exp: disable watchpoint in test_simple_watchpoint
-PASS: gdb.base/watchpoint.exp: run to marker1 in test_simple_watchpoint
-PASS: gdb.base/watchpoint.exp: enable watchpoint
-PASS: gdb.base/watchpoint.exp: break func1
-PASS: gdb.base/watchpoint.exp: set $func1_breakpoint_number = $bpnum
-PASS: gdb.base/watchpoint.exp: continue to breakpoint at func1
-PASS: gdb.base/watchpoint.exp: watchpoint hit, first time
-PASS: gdb.base/watchpoint.exp: Watchpoint hit count is 1
-PASS: gdb.base/watchpoint.exp: delete $func1_breakpoint_number
-PASS: gdb.base/watchpoint.exp: watchpoint hit, second time
-PASS: gdb.base/watchpoint.exp: Watchpoint hit count is 2
-PASS: gdb.base/watchpoint.exp: watchpoint hit, third time
-PASS: gdb.base/watchpoint.exp: Watchpoint hit count is 3
-PASS: gdb.base/watchpoint.exp: watchpoint hit, fourth time
-PASS: gdb.base/watchpoint.exp: Watchpoint hit count is 4
-PASS: gdb.base/watchpoint.exp: watchpoint hit, fifth time
-PASS: gdb.base/watchpoint.exp: Watchpoint hit count is 5
-PASS: gdb.base/watchpoint.exp: continue to marker2
-PASS: gdb.base/watchpoint.exp: watchpoint disabled
-PASS: gdb.base/watchpoint.exp: continue until exit at continue to exit in test_simple_watchpoint
-PASS: gdb.base/watchpoint.exp: watchpoints found in watchpoint/breakpoint table
+FAIL: gdb.base/watchpoint.exp: run to marker1 in test_simple_watchpoint
+FAIL: gdb.base/watchpoint.exp: watchpoints found in watchpoint/breakpoint table
 PASS: gdb.base/watchpoint.exp: disable watchpoint in test_disabling_watchpoints
-PASS: gdb.base/watchpoint.exp: run to marker1 in test_disabling_watchpoints
-PASS: gdb.base/watchpoint.exp: watchpoint enabled
-PASS: gdb.base/watchpoint.exp: watchpoint hit in test_disabling_watchpoints, first time
-PASS: gdb.base/watchpoint.exp: watchpoint hit in test_disabling_watchpoints, second time
-PASS: gdb.base/watchpoint.exp: disable watchpoint #2 in test_disabling_watchpoints
-PASS: gdb.base/watchpoint.exp: watchpoint disabled in table
-PASS: gdb.base/watchpoint.exp: disabled watchpoint skipped
-PASS: gdb.base/watchpoint.exp: continue until exit at continue to exit in test_disabling_watchpoints
+FAIL: gdb.base/watchpoint.exp: run to marker1 in test_disabling_watchpoints
 PASS: gdb.base/watchpoint.exp: watch ival2
 PASS: gdb.base/watchpoint.exp: break func2 if 0
 PASS: gdb.base/watchpoint.exp: p $func2_breakpoint_number = $bpnum
@@ -8497,7 +8479,7 @@ PASS: gdb.cp/m-data.exp: template object
 PASS: gdb.cp/m-data.exp: template object, base enum
 PASS: gdb.cp/m-data.exp: template object, derived enum
 PASS: gdb.cp/m-data.exp: continue to breakpoint: continue to shadow breakpoint
-PASS: gdb.cp/m-data.exp: shadowing member
+FAIL: gdb.cp/m-data.exp: shadowing member
 PASS: gdb.cp/m-data.exp: shadowed global variable
 Running ../../../../src/gdb/gdb/testsuite/gdb.cp/m-static.exp ...
 PASS: gdb.cp/m-static.exp: continue to breakpoint: end of constructors
@@ -8722,17 +8704,17 @@ PASS: gdb.cp/ovldbreak.exp: bp menu for 
 PASS: gdb.cp/ovldbreak.exp: set bp on overload1arg all
 PASS: gdb.cp/ovldbreak.exp: breakpoint info (after setting on all)
 PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : (void|)
-PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : char
-PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : signed char
-PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : unsigned char
-PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : short
-PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : unsigned short
-PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : int
-PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : (unsigned|unsigned int)
-PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : long
-PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : unsigned long
-PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : float
-PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : double
+KFAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : char (PRMS: gdb/1025)
+KFAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : signed char (PRMS: gdb/1025)
+KFAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : unsigned char (PRMS: gdb/1025)
+KFAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : short (PRMS: gdb/1025)
+KFAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : unsigned short (PRMS: gdb/1025)
+FAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : int
+FAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : (unsigned|unsigned int)
+FAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : long
+FAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : unsigned long
+FAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : float
+KFAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : double (PRMS: gdb/1025)
 PASS: gdb.cp/ovldbreak.exp: continue until exit at finish program
 Running ../../../../src/gdb/gdb/testsuite/gdb.cp/pr-1023.exp ...
 PASS: gdb.cp/pr-1023.exp: break myClass::performBlocking
@@ -10941,7 +10923,7 @@ PASS: gdb.threads/manythreads.exp: first
 PASS: gdb.threads/manythreads.exp: stop threads 1
 FAIL: gdb.threads/manythreads.exp: info threads
 PASS: gdb.threads/manythreads.exp: second continue
-PASS: gdb.threads/manythreads.exp: stop threads 2
+FAIL: gdb.threads/manythreads.exp: stop threads 2 (timeout)
 FAIL: gdb.threads/manythreads.exp: GDB exits after stopping multithreaded program (timeout)
 Running ../../../../src/gdb/gdb/testsuite/gdb.threads/print-threads.exp ...
 PASS: gdb.threads/print-threads.exp: successfully compiled posix threads test case
@@ -10978,7 +10960,7 @@ PASS: gdb.threads/print-threads.exp: all
 Running ../../../../src/gdb/gdb/testsuite/gdb.threads/pthread_cond_wait.exp ...
 PASS: gdb.threads/pthread_cond_wait.exp: successfully compiled posix threads test case
 PASS: gdb.threads/pthread_cond_wait.exp: breakpoint on break_me
-PASS: gdb.threads/pthread_cond_wait.exp: run to break_me
+FAIL: gdb.threads/pthread_cond_wait.exp: run to break_me
 FAIL: gdb.threads/pthread_cond_wait.exp: backtrace in blocked thread
 Running ../../../../src/gdb/gdb/testsuite/gdb.threads/pthreads.exp ...
 PASS: gdb.threads/pthreads.exp: successfully compiled posix threads test case
@@ -11097,7 +11079,7 @@ PASS: gdb.trace/limits.exp: Current targ
 Running ../../../../src/gdb/gdb/testsuite/gdb.trace/packetlen.exp ...
 PASS: gdb.trace/packetlen.exp: setup collect actions
 PASS: gdb.trace/packetlen.exp: survive the long packet send
-PASS: gdb.trace/packetlen.exp: run trace experiment
+FAIL: gdb.trace/packetlen.exp: run trace experiment
 PASS: gdb.trace/packetlen.exp: confirm: survived the long packet send
 Running ../../../../src/gdb/gdb/testsuite/gdb.trace/passc-dyn.exp ...
 PASS: gdb.trace/passc-dyn.exp: Current target does not support trace
@@ -11182,10 +11164,10 @@ PASS: gdb.trace/while-stepping.exp: 5.16
 
 		=== gdb Summary ===
 
-# of expected passes		10560
-# of unexpected failures	86
-# of expected failures		42
-# of known failures		78
+# of expected passes		10507
+# of unexpected failures	111
+# of expected failures		46
+# of known failures		84
 # of unresolved testcases	1
 # of untested testcases		8
 # of unsupported tests		16


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2006-09-30 19:32 ` Mark Kettenis
@ 2006-09-30 20:25   ` Daniel Jacobowitz
  2006-10-17 21:21   ` Daniel Jacobowitz
  1 sibling, 0 replies; 24+ messages in thread
From: Daniel Jacobowitz @ 2006-09-30 20:25 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Sat, Sep 30, 2006 at 09:32:00PM +0200, Mark Kettenis wrote:
> > Date: Fri, 29 Sep 2006 17:37:26 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > 
> > Any comments on this patch?  Otherwise, I'll plan to commit it in a few
> > days.
> 
> I get quite a few new regressions on OpenBSD/powerpc.  Please don't
> commit this.

That's bizarre; I wonder why they show up there, but not on
powerpc-linux?

The one dubiously-related regression was acceptable IMO, but your
results certainly aren't; I will not commit it, at least not until
we understand what happened.

No rush (not like I don't have plenty of other patches to deal with),
but if you find some time, I'd appreciate a better idea of what
changed.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2006-09-30 19:32 ` Mark Kettenis
  2006-09-30 20:25   ` Daniel Jacobowitz
@ 2006-10-17 21:21   ` Daniel Jacobowitz
  2006-10-17 22:15     ` Mark Kettenis
                       ` (2 more replies)
  1 sibling, 3 replies; 24+ messages in thread
From: Daniel Jacobowitz @ 2006-10-17 21:21 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Sat, Sep 30, 2006 at 09:32:00PM +0200, Mark Kettenis wrote:
> > Date: Fri, 29 Sep 2006 17:37:26 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > 
> > Any comments on this patch?  Otherwise, I'll plan to commit it in a few
> > days.
> 
> I get quite a few new regressions on OpenBSD/powerpc.  Please don't
> commit this.

Hi Mark,

Do you think you could try out this one, instead?  I worked out what
was going wrong for me: sign extension.  I was testing a 64-bit GDB
binary on 32-bit programs, which caused (op >> 22) == 0x20f to fail;
when it didn't fail, on a 32-bit host, that check allows any load into
r31 to be considered part of the prologue.  But it was advancing so far
that for small functions, the breakpoint was placed after the restore
of r31 in the epilogue - much too far.

This patch fixes the original bug, fixes the sign extension problem,
and generally overhauls the prologue skipping (as opposed to scanning)
to work more like MIPS's.  It tests with no regressions on
powerpc-linux, using a 32-bit binary this time.

-- 
Daniel Jacobowitz
CodeSourcery

2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>

	* rs6000-tdep.c (rs6000_skip_prologue): Use skip_prologue_using_sal.
	(rs6000_in_function_epilogue_p): Use extract_unsigned_integer.
	(refine_prologue_limit): Delete.
	(skip_prologue): Don't call it.  Use extract_unsigned_integer.
	Assume lim_pc is set.  Correct check for incomplete prologues.

2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>

	* gdb.arch/powerpc-prologue.c (optimized_1_marker, gdb2029_marker)
	(optimized_1): New.
	(main): Call optimized_1.
	(gdb2029): Correct typos.  Call gdb2029_marker.
	* gdb.arch/powerpc-prologue.exp: Run new test.  Use a breakpoint
	for gdb2029.

Index: rs6000-tdep.c
===================================================================
RCS file: /home/gcc/repos/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.258
diff -u -p -r1.258 rs6000-tdep.c
--- rs6000-tdep.c	23 Apr 2006 14:15:01 -0000	1.258
+++ rs6000-tdep.c	17 Oct 2006 21:15:47 -0000
@@ -487,7 +487,29 @@ static CORE_ADDR
 rs6000_skip_prologue (CORE_ADDR pc)
 {
   struct rs6000_framedata frame;
-  pc = skip_prologue (pc, 0, &frame);
+  CORE_ADDR limit_pc, func_addr;
+
+  /* See if we can determine the end of the prologue via the symbol table.
+     If so, then return either PC, or the PC after the prologue, whichever
+     is greater.  */
+  if (find_pc_partial_function (pc, NULL, &func_addr, NULL))
+    {
+      CORE_ADDR post_prologue_pc = skip_prologue_using_sal (func_addr);
+      if (post_prologue_pc != 0)
+	return max (pc, post_prologue_pc);
+    }
+
+  /* Can't determine prologue from the symbol table, need to examine
+     instructions.  */
+
+  /* Find an upper limit on the function prologue using the debug
+     information.  If the debug information could not be used to provide
+     that bound, then use an arbitrary large number as the upper bound.  */
+  limit_pc = skip_prologue_using_sal (pc);
+  if (limit_pc == 0)
+    limit_pc = pc + 100;          /* Magic.  */
+
+  pc = skip_prologue (pc, limit_pc, &frame);
   return pc;
 }
 
@@ -570,7 +592,7 @@ rs6000_in_function_epilogue_p (struct gd
     {
       if (!safe_frame_unwind_memory (curfrm, scan_pc, insn_buf, PPC_INSN_SIZE))
         return 0;
-      insn = extract_signed_integer (insn_buf, PPC_INSN_SIZE);
+      insn = extract_unsigned_integer (insn_buf, PPC_INSN_SIZE);
       if (insn == 0x4e800020)
         break;
       if (insn_changes_sp_or_jumps (insn))
@@ -585,7 +607,7 @@ rs6000_in_function_epilogue_p (struct gd
     {
       if (!safe_frame_unwind_memory (curfrm, scan_pc, insn_buf, PPC_INSN_SIZE))
         return 0;
-      insn = extract_signed_integer (insn_buf, PPC_INSN_SIZE);
+      insn = extract_unsigned_integer (insn_buf, PPC_INSN_SIZE);
       if (insn_changes_sp_or_jumps (insn))
         return 1;
     }
@@ -780,57 +802,6 @@ rs6000_software_single_step (enum target
    of the prologue is expensive.  */
 static int max_skip_non_prologue_insns = 10;
 
-/* Given PC representing the starting address of a function, and
-   LIM_PC which is the (sloppy) limit to which to scan when looking
-   for a prologue, attempt to further refine this limit by using
-   the line data in the symbol table.  If successful, a better guess
-   on where the prologue ends is returned, otherwise the previous
-   value of lim_pc is returned.  */
-
-/* FIXME: cagney/2004-02-14: This function and logic have largely been
-   superseded by skip_prologue_using_sal.  */
-
-static CORE_ADDR
-refine_prologue_limit (CORE_ADDR pc, CORE_ADDR lim_pc)
-{
-  struct symtab_and_line prologue_sal;
-
-  prologue_sal = find_pc_line (pc, 0);
-  if (prologue_sal.line != 0)
-    {
-      int i;
-      CORE_ADDR addr = prologue_sal.end;
-
-      /* Handle the case in which compiler's optimizer/scheduler
-         has moved instructions into the prologue.  We scan ahead
-	 in the function looking for address ranges whose corresponding
-	 line number is less than or equal to the first one that we
-	 found for the function.  (It can be less than when the
-	 scheduler puts a body instruction before the first prologue
-	 instruction.)  */
-      for (i = 2 * max_skip_non_prologue_insns; 
-           i > 0 && (lim_pc == 0 || addr < lim_pc);
-	   i--)
-        {
-	  struct symtab_and_line sal;
-
-	  sal = find_pc_line (addr, 0);
-	  if (sal.line == 0)
-	    break;
-	  if (sal.line <= prologue_sal.line 
-	      && sal.symtab == prologue_sal.symtab)
-	    {
-	      prologue_sal = sal;
-	    }
-	  addr = sal.end;
-	}
-
-      if (lim_pc == 0 || prologue_sal.end < lim_pc)
-	lim_pc = prologue_sal.end;
-    }
-  return lim_pc;
-}
-
 /* Return nonzero if the given instruction OP can be part of the prologue
    of a function and saves a parameter on the stack.  FRAMEP should be
    set if one of the previous instructions in the function has set the
@@ -926,21 +897,6 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
   int r0_contains_arg = 0;
   const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (current_gdbarch);
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-  
-  /* Attempt to find the end of the prologue when no limit is specified.
-     Note that refine_prologue_limit() has been written so that it may
-     be used to "refine" the limits of non-zero PC values too, but this
-     is only safe if we 1) trust the line information provided by the
-     compiler and 2) iterate enough to actually find the end of the
-     prologue.  
-     
-     It may become a good idea at some point (for both performance and
-     accuracy) to unconditionally call refine_prologue_limit().  But,
-     until we can make a clear determination that this is beneficial,
-     we'll play it safe and only use it to obtain a limit when none
-     has been specified.  */
-  if (lim_pc == 0)
-    lim_pc = refine_prologue_limit (pc, lim_pc);
 
   memset (fdata, 0, sizeof (struct rs6000_framedata));
   fdata->saved_gpr = -1;
@@ -961,7 +917,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
 	last_prologue_pc = pc;
 
       /* Stop scanning if we've hit the limit.  */
-      if (lim_pc != 0 && pc >= lim_pc)
+      if (pc >= lim_pc)
 	break;
 
       prev_insn_was_prologue_insn = 1;
@@ -969,7 +925,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
       /* Fetch the instruction and convert it to an integer.  */
       if (target_read_memory (pc, buf, 4))
 	break;
-      op = extract_signed_integer (buf, 4);
+      op = extract_unsigned_integer (buf, 4);
 
       if ((op & 0xfc1fffff) == 0x7c0802a6)
 	{			/* mflr Rx */
@@ -1414,8 +1370,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
 	     Handle optimizer code motions into the prologue by continuing
 	     the search if we have no valid frame yet or if the return
 	     address is not yet saved in the frame.  */
-	  if (fdata->frameless == 0
-	      && (lr_reg == -1 || fdata->nosavedpc == 0))
+	  if (fdata->frameless == 0 && fdata->nosavedpc == 0)
 	    break;
 
 	  if (op == 0x4e800020		/* blr */
Index: testsuite/gdb.arch/powerpc-prologue.c
===================================================================
RCS file: /home/gcc/repos/src/src/gdb/testsuite/gdb.arch/powerpc-prologue.c,v
retrieving revision 1.1
diff -u -p -r1.1 powerpc-prologue.c
--- testsuite/gdb.arch/powerpc-prologue.c	23 Jan 2006 01:47:32 -0000	1.1
+++ testsuite/gdb.arch/powerpc-prologue.c	17 Oct 2006 18:45:44 -0000
@@ -31,23 +31,54 @@ int
 main (void)
 {
   gdb2029 ();
+  optimized_1 ();
   return 0;
 }
 
+void
+optimized_1_marker (void)
+{
+}
+
+void
+gdb2029_marker (void)
+{
+}
+
 /* A typical PIC prologue from GCC.  */
 
 asm(".text\n"
-    "    .align 8\n"
+    "    .p2align 3\n"
     SYMBOL (gdb2029) ":\n"
-    "	stw	%r1, -32(%r1)\n"
+    "	stwu	%r1, -32(%r1)\n"
     "	mflr	%r0\n"
     "	bcl-	20,31,.+4\n"
     "	stw	%r30, 24(%r1)\n"
     "	mflr	%r30\n"
     "	stw	%r0, 36(%r1)\n"
-    "	twge	%r2, %r2\n"
+    "	bl	gdb2029_marker\n"
     "	lwz	%r0, 36(%r1)\n"
     "	lwz	%r30, 24(%r1)\n"
     "	mtlr	%r0\n"
-    "	addi	%r0, %r0, 32\n"
+    "	addi	%r1, %r1, 32\n"
+    "	blr");
+
+/* A heavily scheduled prologue.  */
+asm(".text\n"
+    "	.p2align 3\n"
+    SYMBOL (optimized_1) ":\n"
+    "	stwu	%r1,-32(%r1)\n"
+    "	lis	%r9,-16342\n"
+    "	lis	%r11,-16342\n"
+    "	mflr	%r0\n"
+    "	addi	%r11,%r11,3776\n"
+    "	stmw	%r27,12(%r1)\n"
+    "	addi	%r31,%r9,3152\n"
+    "	cmplw	%cr7,%r31,%r11\n"
+    "	stw	%r0,36(%r1)\n"
+    "	mr	%r30,%r3\n"
+    "	bl	optimized_1_marker\n"
+    "	lwz	%r0,36(%r1)\n"
+    "	lmw	%r27,12(%r1)\n"
+    "	addi	%r1,%r1,32\n"
     "	blr");
Index: testsuite/gdb.arch/powerpc-prologue.exp
===================================================================
RCS file: /home/gcc/repos/src/src/gdb/testsuite/gdb.arch/powerpc-prologue.exp,v
retrieving revision 1.1
diff -u -p -r1.1 powerpc-prologue.exp
--- testsuite/gdb.arch/powerpc-prologue.exp	23 Jan 2006 01:47:32 -0000	1.1
+++ testsuite/gdb.arch/powerpc-prologue.exp	17 Oct 2006 18:45:44 -0000
@@ -50,12 +50,40 @@ if ![runto_main] then {
 
 # Testcase for PIC prologue.
 
-gdb_test "continue" "Program received signal SIGTRAP.*" "continue to PIC"
+gdb_breakpoint "gdb2029_marker"
+gdb_test "continue" "Breakpoint $decimal, $hex in gdb2029_marker \\(\\)" \
+	"continue to PIC"
 
 gdb_test "backtrace 10" \
-	"#0\[ \t\]*$hex in gdb2029.*\r\n#1\[ \t\]*$hex in main.*" \
+	"#0\[ \t\]*$hex in gdb2029_marker.*\r\n#1\[ \t\]*$hex in gdb2029.*\r\n#2\[ \t\]*$hex in main.*" \
+	"backtrace in PIC marker"
+
+gdb_test "finish" ".*$hex in gdb2029 .*" "finish from PIC"
+
+gdb_test "backtrace 10" \
+	"#0\[ \t\]*$hex in gdb2029 .*\r\n#1\[ \t\]*$hex in main.*" \
 	"backtrace in PIC"
 
 gdb_test "info frame" \
 	".*Saved registers:.*r30 at.*r31 at.*pc at.*lr at.*" \
 	"saved registers in PIC"
+
+# Testcase for scheduled prologue.
+
+gdb_breakpoint "optimized_1_marker"
+gdb_test "continue" "Breakpoint $decimal, $hex in optimized_1_marker \\(\\)" \
+	"continue to optimized"
+
+gdb_test "backtrace 10" \
+	"#0\[ \t\]*$hex in optimized_1_marker.*\r\n#1\[ \t\]*$hex in optimized_1.*\r\n#2\[ \t\]*$hex in main.*" \
+	"backtrace in optimized marker"
+
+gdb_test "finish" ".*$hex in optimized_1 .*" "finish from optimized"
+
+gdb_test "backtrace 10" \
+	"#0\[ \t\]*$hex in optimized_1 .*\r\n#1\[ \t\]*$hex in main.*" \
+	"backtrace in optimized"
+
+gdb_test "info frame" \
+	".*Saved registers:.*r30 at.*r31 at.*pc at.*lr at.*" \
+	"saved registers in optimized"


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2006-10-17 21:21   ` Daniel Jacobowitz
@ 2006-10-17 22:15     ` Mark Kettenis
  2006-10-18  5:41     ` Wu Zhou
  2006-10-18 19:58     ` Mark Kettenis
  2 siblings, 0 replies; 24+ messages in thread
From: Mark Kettenis @ 2006-10-17 22:15 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

> Date: Tue, 17 Oct 2006 17:21:14 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> On Sat, Sep 30, 2006 at 09:32:00PM +0200, Mark Kettenis wrote:
> > > Date: Fri, 29 Sep 2006 17:37:26 -0400
> > > From: Daniel Jacobowitz <drow@false.org>
> > > 
> > > Any comments on this patch?  Otherwise, I'll plan to commit it in a few
> > > days.
> > 
> > I get quite a few new regressions on OpenBSD/powerpc.  Please don't
> > commit this.
> 
> Hi Mark,
> 
> Do you think you could try out this one, instead?  I worked out what
> was going wrong for me: sign extension.  I was testing a 64-bit GDB
> binary on 32-bit programs, which caused (op >> 22) == 0x20f to fail;
> when it didn't fail, on a 32-bit host, that check allows any load into
> r31 to be considered part of the prologue.  But it was advancing so far
> that for small functions, the breakpoint was placed after the restore
> of r31 in the epilogue - much too far.
> 
> This patch fixes the original bug, fixes the sign extension problem,
> and generally overhauls the prologue skipping (as opposed to scanning)
> to work more like MIPS's.  It tests with no regressions on
> powerpc-linux, using a 32-bit binary this time.

I'll try to check it out tomorrow night.  Time for me to go to zzz
now...

> 2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>
> 
> 	* rs6000-tdep.c (rs6000_skip_prologue): Use skip_prologue_using_sal.
> 	(rs6000_in_function_epilogue_p): Use extract_unsigned_integer.
> 	(refine_prologue_limit): Delete.
> 	(skip_prologue): Don't call it.  Use extract_unsigned_integer.
> 	Assume lim_pc is set.  Correct check for incomplete prologues.
> 
> 2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>
> 
> 	* gdb.arch/powerpc-prologue.c (optimized_1_marker, gdb2029_marker)
> 	(optimized_1): New.
> 	(main): Call optimized_1.
> 	(gdb2029): Correct typos.  Call gdb2029_marker.
> 	* gdb.arch/powerpc-prologue.exp: Run new test.  Use a breakpoint
> 	for gdb2029.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2006-10-17 21:21   ` Daniel Jacobowitz
  2006-10-17 22:15     ` Mark Kettenis
@ 2006-10-18  5:41     ` Wu Zhou
  2006-10-18 14:18       ` Daniel Jacobowitz
  2006-10-18 19:58     ` Mark Kettenis
  2 siblings, 1 reply; 24+ messages in thread
From: Wu Zhou @ 2006-10-18  5:41 UTC (permalink / raw)
  To: Mark Kettenis, gdb-patches; +Cc: brobecker

Daniel Jacobowitz wrote:
> On Sat, Sep 30, 2006 at 09:32:00PM +0200, Mark Kettenis wrote:
>>> Date: Fri, 29 Sep 2006 17:37:26 -0400
>>> From: Daniel Jacobowitz <drow@false.org>
>>>
>>> Any comments on this patch?  Otherwise, I'll plan to commit it in a few
>>> days.
>> I get quite a few new regressions on OpenBSD/powerpc.  Please don't
>> commit this.
> 
> Hi Mark,
> 
> Do you think you could try out this one, instead?  I worked out what
> was going wrong for me: sign extension.  I was testing a 64-bit GDB
> binary on 32-bit programs, which caused (op >> 22) == 0x20f to fail;
> when it didn't fail, on a 32-bit host, that check allows any load into
> r31 to be considered part of the prologue.  But it was advancing so far
> that for small functions, the breakpoint was placed after the restore
> of r31 in the epilogue - much too far.
> 
> This patch fixes the original bug, fixes the sign extension problem,
> and generally overhauls the prologue skipping (as opposed to scanning)
> to work more like MIPS's.  It tests with no regressions on
> powerpc-linux, using a 32-bit binary this time.

It seems that powerpc-linux is skipped as a whole:

if {[istarget *-*-aix*] || ![istarget "powerpc-*-*"]} then {
     verbose "Skipping PowerPC prologue tests."
     return
}

What about open this for powerpc-linux?  I commented the above code and have a test in both 32-bit 
and 64-bit mode on a ppc64 box.  For 32-bit mode, there are six more PASS.  And for 64-bit mode, we 
have still 1 PASS and 9 FAIL.  Why not just keep these FAIL there, to remind us that these are 
places we need to improve?   Just my two cents anyway.  :-)

I have yet another proposal to incorporate the bl_to_blrl patch, which is discussed in 
http://sources.redhat.com/ml/gdb/2006-10/msg00085.html, into this one.  Both are improvement for 
rs6000 prologue analyzer.  And I don't find any regression for bl_to_blrl patch right now.  When the 
inferior has more than 600 checkpoints, it is easy to see internal buffer full error. And when I run 
it manually, no error is reported.  For the 15 more PASS and 5 more FAIL in tls.exp, it is indeed a 
progress:

un-patched gdb will display a backtrace at sem_wait like this:

where^M
#0  0x0fc3ba38 in sem_wait@GLIBC_2.0 () from /lib/tls/libpthread.so.0^M
#1  0x0fc3ba1c in sem_wait@GLIBC_2.0 () from /lib/tls/libpthread.so.0^M
#2  0x0fc3ba1c in sem_wait@GLIBC_2.0 () from /lib/tls/libpthread.so.0^M
#3  0x0fc3ba1c in sem_wait@GLIBC_2.0 () from /lib/tls/libpthread.so.0^M
Previous frame inner to this frame (corrupt stack?)^M
(gdb) PASS: gdb.threads/tls.exp: backtrace of thread number 4 not relevant
FAIL: gdb.threads/tls.exp: No thread backtrace reported spin (vsyscall kernel problem?)

and it doesn't find a frame for spin, so it skip some tests.

And patched gdb will display a backtrace like this:

where^M
#0  0x0fc3ba38 in sem_wait@GLIBC_2.0 () from /lib/tls/libpthread.so.0^M
#1  0x10000834 in spin (vp=0x0) at ../../../src/gdb/testsuite/gdb.threads/tls.c:97^M
#2  0x0fc359ec in start_thread () from /lib/tls/libpthread.so.0^M
#3  0x0ff31ed8 in clone () from /lib/tls/libc.so.6^M
Previous frame inner to this frame (corrupt stack?)

which is much more correct.

What is more, all these FAIL are on the valueprint and typeprint of the TLS variables, which are 
already there (for a long time I guess) in tls-shared.exp and tls-nodebug.exp.  There TLS errors 
occurs where td_thr_tls_get_addr return TD_ERR, so I guess this is related to libthread_db.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2006-10-18  5:41     ` Wu Zhou
@ 2006-10-18 14:18       ` Daniel Jacobowitz
  0 siblings, 0 replies; 24+ messages in thread
From: Daniel Jacobowitz @ 2006-10-18 14:18 UTC (permalink / raw)
  To: Wu Zhou; +Cc: Mark Kettenis, gdb-patches, brobecker

On Wed, Oct 18, 2006 at 01:41:31PM +0800, Wu Zhou wrote:
> It seems that powerpc-linux is skipped as a whole:
> 
> if {[istarget *-*-aix*] || ![istarget "powerpc-*-*"]} then {
>     verbose "Skipping PowerPC prologue tests."
>     return
> }
> 
> What about open this for powerpc-linux?  I commented the above code and 
> have a test in both 32-bit and 64-bit mode on a ppc64 box.  For 32-bit 
> mode, there are six more PASS.  And for 64-bit mode, we have still 1 PASS 
> and 9 FAIL.  Why not just keep these FAIL there, to remind us that these 
> are places we need to improve?   Just my two cents anyway.  :-)

Thanks for catching this.  It's a bug in the patch: I was testing
in 32-bit mode on a powerpc64 system, so I removed the "64" from that
skip, but I forgot to put it back!  It should be skipping
powerpc64-*-*; the test won't work there because the asm isn't 64-bit
safe.

> I have yet another proposal to incorporate the bl_to_blrl patch, which is 
> discussed in http://sources.redhat.com/ml/gdb/2006-10/msg00085.html, into 
> this one.  Both are improvement for rs6000 prologue analyzer.

They're not related patches.  We'll deal with them separately.  I just
haven't had a chance to look at it yet, nor has anyone else, I suppose.


-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2006-10-17 21:21   ` Daniel Jacobowitz
  2006-10-17 22:15     ` Mark Kettenis
  2006-10-18  5:41     ` Wu Zhou
@ 2006-10-18 19:58     ` Mark Kettenis
  2006-10-18 20:06       ` Daniel Jacobowitz
  2007-03-09 15:05       ` Daniel Jacobowitz
  2 siblings, 2 replies; 24+ messages in thread
From: Mark Kettenis @ 2006-10-18 19:58 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

> Date: Tue, 17 Oct 2006 17:21:14 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> Hi Mark,
> 
> Do you think you could try out this one, instead?  I worked out what
> was going wrong for me: sign extension.  I was testing a 64-bit GDB
> binary on 32-bit programs, which caused (op >> 22) == 0x20f to fail;
> when it didn't fail, on a 32-bit host, that check allows any load into
> r31 to be considered part of the prologue.  But it was advancing so far
> that for small functions, the breakpoint was placed after the restore
> of r31 in the epilogue - much too far.
> 
> This patch fixes the original bug, fixes the sign extension problem,
> and generally overhauls the prologue skipping (as opposed to scanning)
> to work more like MIPS's.  It tests with no regressions on
> powerpc-linux, using a 32-bit binary this time.

Unfortunately, I still get a few regressions, see below.  They all
seem to be problems with not skipping the complete prologue.  I get
the feeling that using line number information for prologue skipping
is just not reliable :(.

--- gdb.sum.2	Wed Oct 18 19:44:32 2006
+++ gdb.sum	Wed Oct 18 20:44:26 2006
@@ -1,4 +1,4 @@
-Test Run By kettenis on Wed Oct 18 19:25:55 2006
+Test Run By kettenis on Wed Oct 18 20:25:47 2006
 Native configuration is powerpc-unknown-openbsd3.9
 
 		=== gdb tests ===
@@ -5011,7 +5011,7 @@
 PASS: gdb.base/sepdebug.exp: breakpoint function, optimized file
 PASS: gdb.base/sepdebug.exp: breakpoint small function, optimized file
 PASS: gdb.base/sepdebug.exp: run until function breakpoint, optimized file
-PASS: gdb.base/sepdebug.exp: run until breakpoint set at small function, optimized file
+FAIL: gdb.base/sepdebug.exp: run until breakpoint set at small function, optimized file
 Running ../../../../src/gdb/gdb/testsuite/gdb.base/sepsymtab.exp ...
 PASS: gdb.base/sepsymtab.exp: info sym main
 Running ../../../../src/gdb/gdb/testsuite/gdb.base/setshow.exp ...
@@ -8540,7 +8540,7 @@
 PASS: gdb.cp/m-data.exp: template object, base enum
 PASS: gdb.cp/m-data.exp: template object, derived enum
 PASS: gdb.cp/m-data.exp: continue to breakpoint: continue to shadow breakpoint
-PASS: gdb.cp/m-data.exp: shadowing member
+FAIL: gdb.cp/m-data.exp: shadowing member
 PASS: gdb.cp/m-data.exp: shadowed global variable
 Running ../../../../src/gdb/gdb/testsuite/gdb.cp/m-static.exp ...
 PASS: gdb.cp/m-static.exp: continue to breakpoint: end of constructors
@@ -9314,6 +9314,21 @@
 PASS: gdb.gdb/selftest.exp: set listsize to 1
 PASS: gdb.gdb/selftest.exp: run until breakpoint at captured_main
 PASS: gdb.gdb/selftest.exp: printed version as string
+PASS: gdb.gdb/selftest.exp: step over ttyarg initialization
+FAIL: gdb.gdb/selftest.exp: step over ttyarg initialization ended up at odd location
+PASS: gdb.gdb/selftest.exp: step over ttyarg initialization
+PASS: gdb.gdb/selftest.exp: step over cdarg initialization
+FAIL: gdb.gdb/selftest.exp: step over cdarg initialization ended up at odd location
+PASS: gdb.gdb/selftest.exp: step over cdarg initialization
+PASS: gdb.gdb/selftest.exp: step over corearg initialization
+FAIL: gdb.gdb/selftest.exp: step over corearg initialization ended up at odd location
+PASS: gdb.gdb/selftest.exp: step over corearg initialization
+PASS: gdb.gdb/selftest.exp: step over execarg initialization
+FAIL: gdb.gdb/selftest.exp: step over execarg initialization ended up at odd location
+PASS: gdb.gdb/selftest.exp: step over execarg initialization
+PASS: gdb.gdb/selftest.exp: step over symarg initialization
+FAIL: gdb.gdb/selftest.exp: step over symarg initialization ended up at odd location
+PASS: gdb.gdb/selftest.exp: step over symarg initialization
 PASS: gdb.gdb/selftest.exp: step over argc initialization
 PASS: gdb.gdb/selftest.exp: step over argv initialization
 PASS: gdb.gdb/selftest.exp: next over get_run_time and everything it calls
@@ -9334,7 +9349,7 @@
 PASS: gdb.gdb/selftest.exp: Set xgdb prompt
 PASS: gdb.gdb/selftest.exp: send ^C to child process
 PASS: gdb.gdb/selftest.exp: send SIGINT signal to child process
-PASS: gdb.gdb/selftest.exp: backtrace through signal handler
+FAIL: gdb.gdb/selftest.exp: backtrace through signal handler
 Running ../../../../src/gdb/gdb/testsuite/gdb.gdb/xfullpath.exp ...
 PASS: gdb.gdb/xfullpath.exp: breakpoint in captured_main
 PASS: gdb.gdb/xfullpath.exp: run until breakpoint at captured_main
@@ -11227,8 +11242,8 @@
 
 		=== gdb Summary ===
 
-# of expected passes		10594
-# of unexpected failures	89
+# of expected passes		10605
+# of unexpected failures	93
 # of expected failures		42
 # of known failures		79
 # of unresolved testcases	1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2006-10-18 19:58     ` Mark Kettenis
@ 2006-10-18 20:06       ` Daniel Jacobowitz
  2006-11-30 20:12         ` Daniel Jacobowitz
  2007-03-09 15:05       ` Daniel Jacobowitz
  1 sibling, 1 reply; 24+ messages in thread
From: Daniel Jacobowitz @ 2006-10-18 20:06 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Wed, Oct 18, 2006 at 09:58:08PM +0200, Mark Kettenis wrote:
> Unfortunately, I still get a few regressions, see below.  They all
> seem to be problems with not skipping the complete prologue.  I get
> the feeling that using line number information for prologue skipping
> is just not reliable :(.

It's true that it isn't completely reliable, but it's usually "good
enough" and has its own advantages - it's better than accidentally
walking off into the epilogue, for instance, as this code is currently
somewhat prone to.

What version of GCC are you using?  Perhaps I can reproduce it with a
different version.

> @@ -9334,7 +9349,7 @@
>  PASS: gdb.gdb/selftest.exp: Set xgdb prompt
>  PASS: gdb.gdb/selftest.exp: send ^C to child process
>  PASS: gdb.gdb/selftest.exp: send SIGINT signal to child process
> -PASS: gdb.gdb/selftest.exp: backtrace through signal handler
> +FAIL: gdb.gdb/selftest.exp: backtrace through signal handler
>  Running ../../../../src/gdb/gdb/testsuite/gdb.gdb/xfullpath.exp ...
>  PASS: gdb.gdb/xfullpath.exp: breakpoint in captured_main
>  PASS: gdb.gdb/xfullpath.exp: run until breakpoint at captured_main

This, though, I probably can't without access to an OpenBSD system...

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2006-10-18 20:06       ` Daniel Jacobowitz
@ 2006-11-30 20:12         ` Daniel Jacobowitz
  2007-02-15 20:20           ` Aman Wardak
  0 siblings, 1 reply; 24+ messages in thread
From: Daniel Jacobowitz @ 2006-11-30 20:12 UTC (permalink / raw)
  To: Mark Kettenis, gdb-patches

On Wed, Oct 18, 2006 at 04:05:54PM -0400, Daniel Jacobowitz wrote:
> On Wed, Oct 18, 2006 at 09:58:08PM +0200, Mark Kettenis wrote:
> > Unfortunately, I still get a few regressions, see below.  They all
> > seem to be problems with not skipping the complete prologue.  I get
> > the feeling that using line number information for prologue skipping
> > is just not reliable :(.
> 
> It's true that it isn't completely reliable, but it's usually "good
> enough" and has its own advantages - it's better than accidentally
> walking off into the epilogue, for instance, as this code is currently
> somewhat prone to.
> 
> What version of GCC are you using?  Perhaps I can reproduce it with a
> different version.

Hi Mark, did you miss this question?  I'd really like to figure out why
this patch causes regressions for you.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2006-11-30 20:12         ` Daniel Jacobowitz
@ 2007-02-15 20:20           ` Aman Wardak
  0 siblings, 0 replies; 24+ messages in thread
From: Aman Wardak @ 2007-02-15 20:20 UTC (permalink / raw)
  To: Mark Kettenis, gdb-patches

FYI. Below are my results before and after applying this patch on top of 
gdb-6.6.50.20061206 (+some local patches).

--- log.orig.full/gdb.sum 2007-02-15 00:32:04.000000000 +0000
+++ log.new.full/gdb.sum 2007-02-15 01:42:08.000000000 +0000
@@ -1,4 +1,4 @@
-Test Run By root on Thu Jan 1 19:57:48 1970
+Test Run By root on Thu Jan 1 21:07:00 1970
Native configuration is powerpc-unknown-linux-gnu

=== gdb tests ===
@@ -9,7 +9,7 @@
Running target unix
Running /testsuite/gdb/testsuite/gdb.arch/alpha-step.exp ...
Running /testsuite/gdb/testsuite/gdb.arch/altivec-abi.exp ...
-gdb compile failed, vmx2337.c:1: error: AltiVec and E500 instructions 
cannot coexist
+gdb compile failed, vmx9608.c:1: error: AltiVec and E500 instructions 
cannot coexist
Running /testsuite/gdb/testsuite/gdb.arch/altivec-regs.exp ...
Running /testsuite/gdb/testsuite/gdb.arch/e500-abi.exp ...
Running /testsuite/gdb/testsuite/gdb.arch/e500-prologue.exp ...
@@ -488,7 +488,7 @@
PASS: gdb.base/break.exp: run until file:function(3) breakpoint
PASS: gdb.base/break.exp: run until file:function(2) breakpoint
PASS: gdb.base/break.exp: run until file:function(1) breakpoint
-FAIL: gdb.base/break.exp: run until quoted breakpoint
+PASS: gdb.base/break.exp: run until quoted breakpoint
PASS: gdb.base/break.exp: run until file:linenum breakpoint
PASS: gdb.base/break.exp: breakpoint offset +1
PASS: gdb.base/break.exp: step onto breakpoint
@@ -1192,7 +1192,8 @@
PASS: gdb.base/checkpoint.exp: set checkpoint breakpoint
FAIL: gdb.base/checkpoint.exp: break2 with many checkpoints (timeout)
FAIL: gdb.base/checkpoint.exp: info checkpoints with at least 600 
checkpoints
-PASS: gdb.base/checkpoint.exp: kill all one
+ERROR: internal buffer is full.
+UNRESOLVED: gdb.base/checkpoint.exp: kill all one
Running /testsuite/gdb/testsuite/gdb.base/chng-syms.exp ...
PASS: gdb.base/chng-syms.exp: setting conditional breakpoint on function
PASS: gdb.base/chng-syms.exp: continue until exit at breakpoint first 
time through
@@ -1434,8 +1435,8 @@
PASS: gdb.base/condbreak.exp: breakpoint info
PASS: gdb.base/condbreak.exp: rerun to main
PASS: gdb.base/condbreak.exp: run until breakpoint set at a line number
-XFAIL: gdb.base/condbreak.exp: run until breakpoint at marker1
-FAIL: gdb.base/condbreak.exp: run until breakpoint at marker2
+PASS: gdb.base/condbreak.exp: run until breakpoint at marker1
+PASS: gdb.base/condbreak.exp: run until breakpoint at marker2
Running /testsuite/gdb/testsuite/gdb.base/consecutive.exp ...
PASS: gdb.base/consecutive.exp: continue to breakpoint in foo
PASS: gdb.base/consecutive.exp: get breakpoint address for foo
@@ -2227,12 +2228,12 @@
PASS: gdb.base/ena-dis-br.exp: break marker1
PASS: gdb.base/ena-dis-br.exp: enable break marker1
PASS: gdb.base/ena-dis-br.exp: info break marker1
-XFAIL: gdb.base/ena-dis-br.exp: continue to break marker1
+PASS: gdb.base/ena-dis-br.exp: continue to break marker1
PASS: gdb.base/ena-dis-br.exp: delete break marker1
PASS: gdb.base/ena-dis-br.exp: break marker2
PASS: gdb.base/ena-dis-br.exp: enable once break marker2
PASS: gdb.base/ena-dis-br.exp: info auto-disabled break marker2
-XFAIL: gdb.base/ena-dis-br.exp: continue to auto-disabled break marker2
+PASS: gdb.base/ena-dis-br.exp: continue to auto-disabled break marker2
PASS: gdb.base/ena-dis-br.exp: info auto-disabled break marker2
PASS: gdb.base/ena-dis-br.exp: continue until exit at no stop
PASS: gdb.base/ena-dis-br.exp: rerun to main
@@ -2254,7 +2255,7 @@
PASS: gdb.base/ena-dis-br.exp: info ignored break marker1
PASS: gdb.base/ena-dis-br.exp: continue until exit at no stop at ignored 
break marker1
PASS: gdb.base/ena-dis-br.exp: rerun to main
-XFAIL: gdb.base/ena-dis-br.exp: continue to break marker1, 2nd time
+PASS: gdb.base/ena-dis-br.exp: continue to break marker1, 2nd time
PASS: gdb.base/ena-dis-br.exp: break marker1
PASS: gdb.base/ena-dis-br.exp: ignore break marker1
PASS: gdb.base/ena-dis-br.exp: enable del break marker1
@@ -2811,14 +2812,14 @@
PASS: gdb.base/funcargs.exp: print *fp
PASS: gdb.base/funcargs.exp: print *dp
PASS: gdb.base/funcargs.exp: run to call4a
-FAIL: gdb.base/funcargs.exp: print *stp
+PASS: gdb.base/funcargs.exp: print *stp
PASS: gdb.base/funcargs.exp: continue to call4b
PASS: gdb.base/funcargs.exp: print *unp (sizeof long == sizeof int)
PASS: gdb.base/funcargs.exp: locate actual args, structs/unions passed 
by reference
-FAIL: gdb.base/funcargs.exp: run to call5a
-FAIL: gdb.base/funcargs.exp: print st
-FAIL: gdb.base/funcargs.exp: continue to call5b (sizeof long == sizeof int)
-FAIL: gdb.base/funcargs.exp: print un (sizeof long == sizeof int)
+PASS: gdb.base/funcargs.exp: run to call5a
+PASS: gdb.base/funcargs.exp: print st
+PASS: gdb.base/funcargs.exp: continue to call5b (sizeof long == sizeof int)
+PASS: gdb.base/funcargs.exp: print un (sizeof long == sizeof int)
PASS: gdb.base/funcargs.exp: run to call6a
PASS: gdb.base/funcargs.exp: backtrace from call6a
PASS: gdb.base/funcargs.exp: continue to call6b
@@ -5242,7 +5243,7 @@
PASS: gdb.base/sepdebug.exp: run until file:function(3) breakpoint
PASS: gdb.base/sepdebug.exp: run until file:function(2) breakpoint
PASS: gdb.base/sepdebug.exp: run until file:function(1) breakpoint
-FAIL: gdb.base/sepdebug.exp: run until quoted breakpoint
+PASS: gdb.base/sepdebug.exp: run until quoted breakpoint
PASS: gdb.base/sepdebug.exp: run until file:linenum breakpoint
PASS: gdb.base/sepdebug.exp: breakpoint offset +1
PASS: gdb.base/sepdebug.exp: step onto breakpoint
@@ -5299,7 +5300,7 @@
PASS: gdb.base/sepdebug.exp: breakpoint function, optimized file
PASS: gdb.base/sepdebug.exp: breakpoint small function, optimized file
PASS: gdb.base/sepdebug.exp: run until function breakpoint, optimized file
-FAIL: gdb.base/sepdebug.exp: run until breakpoint set at small 
function, optimized file
+PASS: gdb.base/sepdebug.exp: run until breakpoint set at small 
function, optimized file
Running /testsuite/gdb/testsuite/gdb.base/sepsymtab.exp ...
PASS: gdb.base/sepsymtab.exp: info sym main
Running /testsuite/gdb/testsuite/gdb.base/setshow.exp ...
@@ -8838,7 +8839,7 @@
PASS: gdb.cp/m-data.exp: template object, base enum
PASS: gdb.cp/m-data.exp: template object, derived enum
PASS: gdb.cp/m-data.exp: continue to breakpoint: continue to shadow 
breakpoint
-FAIL: gdb.cp/m-data.exp: shadowing member
+PASS: gdb.cp/m-data.exp: shadowing member
PASS: gdb.cp/m-data.exp: shadowed global variable
Running /testsuite/gdb/testsuite/gdb.cp/m-static.exp ...
PASS: gdb.cp/m-static.exp: continue to breakpoint: end of constructors
@@ -9063,17 +9064,17 @@
PASS: gdb.cp/ovldbreak.exp: set bp on overload1arg all
PASS: gdb.cp/ovldbreak.exp: breakpoint info (after setting on all)
PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : (void|)
-KFAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : char (PRMS: 
gdb/1025)
-KFAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : signed char 
(PRMS: gdb/1025)
-KFAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : unsigned char 
(PRMS: gdb/1025)
-KFAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : short (PRMS: 
gdb/1025)-KFAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : 
unsigned short (PRMS: gdb/1025)
-FAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : int
-FAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : 
(unsigned|unsigned int)-FAIL: gdb.cp/ovldbreak.exp: continue to bp 
overloaded : long
-FAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : unsigned long
-FAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : float
-KFAIL: gdb.cp/ovldbreak.exp: continue to bp overloaded : double (PRMS: 
gdb/1025)
+PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : char
+PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : signed char
+PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : unsigned char
+PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : short
+PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : unsigned short
+PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : int
+PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : 
(unsigned|unsigned int)+PASS: gdb.cp/ovldbreak.exp: continue to bp 
overloaded : long
+PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : unsigned long
+PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : float
+PASS: gdb.cp/ovldbreak.exp: continue to bp overloaded : double
PASS: gdb.cp/ovldbreak.exp: continue until exit at finish program
Running /testsuite/gdb/testsuite/gdb.cp/pr-1023.exp ...
PASS: gdb.cp/pr-1023.exp: break myClass::performBlocking
@@ -11032,10 +11033,10 @@
PASS: gdb.threads/schedlock.exp: listed args (2)
PASS: gdb.threads/schedlock.exp: thread 0 ran
PASS: gdb.threads/schedlock.exp: thread 1 ran
-FAIL: gdb.threads/schedlock.exp: thread 2 ran (didn't run)
+PASS: gdb.threads/schedlock.exp: thread 2 ran
PASS: gdb.threads/schedlock.exp: thread 3 ran
PASS: gdb.threads/schedlock.exp: thread 4 ran
-FAIL: gdb.threads/schedlock.exp: thread 5 ran (didn't run)
+PASS: gdb.threads/schedlock.exp: thread 5 ran
PASS: gdb.threads/schedlock.exp: find current thread (1)
PASS: gdb.threads/schedlock.exp: set scheduler-locking off
PASS: gdb.threads/schedlock.exp: step to increment (unlocked 0)
@@ -11063,8 +11064,8 @@
PASS: gdb.threads/schedlock.exp: other thread 0 didn't run
PASS: gdb.threads/schedlock.exp: other thread 1 didn't run
PASS: gdb.threads/schedlock.exp: other thread 2 didn't run
+PASS: gdb.threads/schedlock.exp: other thread 3 didn't run
PASS: gdb.threads/schedlock.exp: current thread ran
-PASS: gdb.threads/schedlock.exp: other thread 4 didn't run
PASS: gdb.threads/schedlock.exp: other thread 5 didn't run
PASS: gdb.threads/schedlock.exp: step to increment (locked 0)
PASS: gdb.threads/schedlock.exp: step to increment (locked 1)
@@ -11082,8 +11083,8 @@
PASS: gdb.threads/schedlock.exp: other thread 0 didn't run (stepping)
PASS: gdb.threads/schedlock.exp: other thread 1 didn't run (stepping)
PASS: gdb.threads/schedlock.exp: other thread 2 didn't run (stepping)
+PASS: gdb.threads/schedlock.exp: other thread 3 didn't run (stepping)
PASS: gdb.threads/schedlock.exp: current thread stepped locked
-PASS: gdb.threads/schedlock.exp: other thread 4 didn't run (stepping)
PASS: gdb.threads/schedlock.exp: other thread 5 didn't run (stepping)
Running /testsuite/gdb/testsuite/gdb.threads/staticthreads.exp ...
PASS: gdb.threads/staticthreads.exp: successfully compiled posix threads 
test case
@@ -11348,11 +11349,11 @@

=== gdb Summary ===

-# of expected passes 10692
-# of unexpected failures 177
-# of expected failures 45
-# of known failures 70
-# of unresolved testcases 9
+# of expected passes 10718
+# of unexpected failures 160
+# of expected failures 41
+# of known failures 64
+# of unresolved testcases 10
# of untested testcases 5
# of unsupported tests 3
/usr/bin/gdb version 6.6.50.20061206 -nx

-Aman


Daniel Jacobowitz wrote:
> On Wed, Oct 18, 2006 at 04:05:54PM -0400, Daniel Jacobowitz wrote:
>   
>> On Wed, Oct 18, 2006 at 09:58:08PM +0200, Mark Kettenis wrote:
>>     
>>> Unfortunately, I still get a few regressions, see below.  They all
>>> seem to be problems with not skipping the complete prologue.  I get
>>> the feeling that using line number information for prologue skipping
>>> is just not reliable :(.
>>>       
>> It's true that it isn't completely reliable, but it's usually "good
>> enough" and has its own advantages - it's better than accidentally
>> walking off into the epilogue, for instance, as this code is currently
>> somewhat prone to.
>>
>> What version of GCC are you using?  Perhaps I can reproduce it with a
>> different version.
>>     
>
> Hi Mark, did you miss this question?  I'd really like to figure out why
> this patch causes regressions for you.
>
>   


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2006-10-18 19:58     ` Mark Kettenis
  2006-10-18 20:06       ` Daniel Jacobowitz
@ 2007-03-09 15:05       ` Daniel Jacobowitz
  2007-03-11 19:13         ` Mark Kettenis
  2007-04-17  2:02         ` Andreas Schwab
  1 sibling, 2 replies; 24+ messages in thread
From: Daniel Jacobowitz @ 2007-03-09 15:05 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

Mark told me that OpenBSD is using gcc 3.3.5.  I tried to get qemu to
run an OpenBSD image, but it ended poorly.  I did find a powerpc-linux
system using GCC 3.3.3, though.

Short version: I reproduced one failure and fixed it, and I expect
that to fix the second failure too, but I'm not sure about the
selftest.exp problems.

Mark, could you try the patch at the bottom of this message?  If it
still causes selftest.exp "odd location" failures, I would appreciate
a copy of the GDB binary.  I can probably figure out what's happened
from that.  I don't think I'm going to get OpenBSD to run any time
soon, though I am going to keep trying.

On Wed, Oct 18, 2006 at 09:58:08PM +0200, Mark Kettenis wrote:
> @@ -5011,7 +5011,7 @@
>  PASS: gdb.base/sepdebug.exp: breakpoint function, optimized file
>  PASS: gdb.base/sepdebug.exp: breakpoint small function, optimized file
>  PASS: gdb.base/sepdebug.exp: run until function breakpoint, optimized file
> -PASS: gdb.base/sepdebug.exp: run until breakpoint set at small function, optimized file
> +FAIL: gdb.base/sepdebug.exp: run until breakpoint set at small function, optimized file
>  Running ../../../../src/gdb/gdb/testsuite/gdb.base/sepsymtab.exp ...
>  PASS: gdb.base/sepsymtab.exp: info sym main
>  Running ../../../../src/gdb/gdb/testsuite/gdb.base/setshow.exp ...

I can reproduce this one.  Here's the difference:

-Breakpoint 2, 0x10000500 in marker4 (d=177601976) at
 ../../../src/gdb/testsuite/gdb.base/sepdebug.c:71
 71     void marker4 (d) long d; {}  /* set breakpoint 13 here */
-PASS: gdb.base/sepdebug.exp: run until breakpoint set at small
 function, optimized file

+Breakpoint 2, marker4 (d=1) at
 ../../../src/gdb/testsuite/gdb.base/sepdebug.c:71
 71     void marker4 (d) long d; {}  /* set breakpoint 13 here */
+(gdb) FAIL: gdb.base/sepdebug.exp: run until breakpoint set at small
 function, optimized file

The argument value is wrong.  The old version stopped at 0x10000500,
which the debug info reports as being in the middle of a line.  The
new version stopped at 0x100004f0, which is the very start of the
function.

0x100004f0 <marker4+0>: stwu    r1,-32(r1)
0x100004f4 <marker4+4>: stw     r31,28(r1)
0x100004f8 <marker4+8>: mr      r31,r1
0x100004fc <marker4+12>:        stw     r3,8(r31)
0x10000500 <marker4+16>:        lwz     r11,0(r1)
0x10000504 <marker4+20>:        lwz     r31,-4(r11)
0x10000508 <marker4+24>:        mr      r1,r11
0x1000050c <marker4+28>:        blr

GCC doesn't generate a second line note for this function.  It's just
got the one for the start, and GDB trusted it.  That's easy to fix -
skip_prologue_using_sal says "returns 0 if the skip fails", but in
this case it returns the start of the function instead of 0.  Another
fix is needed to make the prologue analyzer not analyze right through
into the epilogue, treating it as optimized code moved into the
prologue.

With those changes, I get no regressions.  My GCC 3.3.3 didn't
show the m-data.exp or selftest.exp regressions to begin with, so I
can't be sure I fixed them - there were some changes in selftest.exp
but no failures.  But I'm pretty sure m-data.exp will be fixed now,
since that failure is also at an empty one line marker function.

-- 
Daniel Jacobowitz
CodeSourcery

2007-03-09  Daniel Jacobowitz  <dan@codesourcery.com>

	* rs6000-tdep.c (rs6000_skip_prologue): Use skip_prologue_using_sal.
	(rs6000_in_function_epilogue_p): Use extract_unsigned_integer.
	(refine_prologue_limit): Delete.
	(skip_prologue): Don't call it.  Use extract_unsigned_integer.
	Assume lim_pc is set.  Correct check for incomplete prologues.
	Do not skip clobbers of the frame pointer.
	* symtab.c (skip_prologue_using_sal): Fail if there is only one
	sal.

2007-03-09  Daniel Jacobowitz  <dan@codesourcery.com>

	* gdb.arch/powerpc-prologue.c (optimized_1_marker, gdb2029_marker)
	(optimized_1): New.
	(main): Call optimized_1.
	(gdb2029): Correct typos.  Call gdb2029_marker.
	* gdb.arch/powerpc-prologue.exp: Run new test.  Use a breakpoint
	for gdb2029.

Index: rs6000-tdep.c
===================================================================
RCS file: /home/gcc/repos/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.265
diff -u -p -r1.265 rs6000-tdep.c
--- rs6000-tdep.c	27 Feb 2007 23:04:28 -0000	1.265
+++ rs6000-tdep.c	9 Mar 2007 14:01:26 -0000
@@ -482,7 +482,29 @@ static CORE_ADDR
 rs6000_skip_prologue (CORE_ADDR pc)
 {
   struct rs6000_framedata frame;
-  pc = skip_prologue (pc, 0, &frame);
+  CORE_ADDR limit_pc, func_addr;
+
+  /* See if we can determine the end of the prologue via the symbol table.
+     If so, then return either PC, or the PC after the prologue, whichever
+     is greater.  */
+  if (find_pc_partial_function (pc, NULL, &func_addr, NULL))
+    {
+      CORE_ADDR post_prologue_pc = skip_prologue_using_sal (func_addr);
+      if (post_prologue_pc != 0)
+	return max (pc, post_prologue_pc);
+    }
+
+  /* Can't determine prologue from the symbol table, need to examine
+     instructions.  */
+
+  /* Find an upper limit on the function prologue using the debug
+     information.  If the debug information could not be used to provide
+     that bound, then use an arbitrary large number as the upper bound.  */
+  limit_pc = skip_prologue_using_sal (pc);
+  if (limit_pc == 0)
+    limit_pc = pc + 100;          /* Magic.  */
+
+  pc = skip_prologue (pc, limit_pc, &frame);
   return pc;
 }
 
@@ -565,7 +587,7 @@ rs6000_in_function_epilogue_p (struct gd
     {
       if (!safe_frame_unwind_memory (curfrm, scan_pc, insn_buf, PPC_INSN_SIZE))
         return 0;
-      insn = extract_signed_integer (insn_buf, PPC_INSN_SIZE);
+      insn = extract_unsigned_integer (insn_buf, PPC_INSN_SIZE);
       if (insn == 0x4e800020)
         break;
       if (insn_changes_sp_or_jumps (insn))
@@ -580,7 +602,7 @@ rs6000_in_function_epilogue_p (struct gd
     {
       if (!safe_frame_unwind_memory (curfrm, scan_pc, insn_buf, PPC_INSN_SIZE))
         return 0;
-      insn = extract_signed_integer (insn_buf, PPC_INSN_SIZE);
+      insn = extract_unsigned_integer (insn_buf, PPC_INSN_SIZE);
       if (insn_changes_sp_or_jumps (insn))
         return 1;
     }
@@ -775,57 +797,6 @@ rs6000_software_single_step (enum target
    of the prologue is expensive.  */
 static int max_skip_non_prologue_insns = 10;
 
-/* Given PC representing the starting address of a function, and
-   LIM_PC which is the (sloppy) limit to which to scan when looking
-   for a prologue, attempt to further refine this limit by using
-   the line data in the symbol table.  If successful, a better guess
-   on where the prologue ends is returned, otherwise the previous
-   value of lim_pc is returned.  */
-
-/* FIXME: cagney/2004-02-14: This function and logic have largely been
-   superseded by skip_prologue_using_sal.  */
-
-static CORE_ADDR
-refine_prologue_limit (CORE_ADDR pc, CORE_ADDR lim_pc)
-{
-  struct symtab_and_line prologue_sal;
-
-  prologue_sal = find_pc_line (pc, 0);
-  if (prologue_sal.line != 0)
-    {
-      int i;
-      CORE_ADDR addr = prologue_sal.end;
-
-      /* Handle the case in which compiler's optimizer/scheduler
-         has moved instructions into the prologue.  We scan ahead
-	 in the function looking for address ranges whose corresponding
-	 line number is less than or equal to the first one that we
-	 found for the function.  (It can be less than when the
-	 scheduler puts a body instruction before the first prologue
-	 instruction.)  */
-      for (i = 2 * max_skip_non_prologue_insns; 
-           i > 0 && (lim_pc == 0 || addr < lim_pc);
-	   i--)
-        {
-	  struct symtab_and_line sal;
-
-	  sal = find_pc_line (addr, 0);
-	  if (sal.line == 0)
-	    break;
-	  if (sal.line <= prologue_sal.line 
-	      && sal.symtab == prologue_sal.symtab)
-	    {
-	      prologue_sal = sal;
-	    }
-	  addr = sal.end;
-	}
-
-      if (lim_pc == 0 || prologue_sal.end < lim_pc)
-	lim_pc = prologue_sal.end;
-    }
-  return lim_pc;
-}
-
 /* Return nonzero if the given instruction OP can be part of the prologue
    of a function and saves a parameter on the stack.  FRAMEP should be
    set if one of the previous instructions in the function has set the
@@ -945,21 +916,6 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
   int r0_contains_arg = 0;
   const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (current_gdbarch);
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-  
-  /* Attempt to find the end of the prologue when no limit is specified.
-     Note that refine_prologue_limit() has been written so that it may
-     be used to "refine" the limits of non-zero PC values too, but this
-     is only safe if we 1) trust the line information provided by the
-     compiler and 2) iterate enough to actually find the end of the
-     prologue.  
-     
-     It may become a good idea at some point (for both performance and
-     accuracy) to unconditionally call refine_prologue_limit().  But,
-     until we can make a clear determination that this is beneficial,
-     we'll play it safe and only use it to obtain a limit when none
-     has been specified.  */
-  if (lim_pc == 0)
-    lim_pc = refine_prologue_limit (pc, lim_pc);
 
   memset (fdata, 0, sizeof (struct rs6000_framedata));
   fdata->saved_gpr = -1;
@@ -980,7 +936,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
 	last_prologue_pc = pc;
 
       /* Stop scanning if we've hit the limit.  */
-      if (lim_pc != 0 && pc >= lim_pc)
+      if (pc >= lim_pc)
 	break;
 
       prev_insn_was_prologue_insn = 1;
@@ -988,7 +944,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
       /* Fetch the instruction and convert it to an integer.  */
       if (target_read_memory (pc, buf, 4))
 	break;
-      op = extract_signed_integer (buf, 4);
+      op = extract_unsigned_integer (buf, 4);
 
       if ((op & 0xfc1fffff) == 0x7c0802a6)
 	{			/* mflr Rx */
@@ -1221,9 +1177,11 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
  	  offset = fdata->offset;
  	  continue;
  	}
-      /* Load up minimal toc pointer */
+      /* Load up minimal toc pointer.  Do not treat an epilogue restore
+	 of r31 as a minimal TOC load.  */
       else if (((op >> 22) == 0x20f	||	/* l r31,... or l r30,... */
 	       (op >> 22) == 0x3af)		/* ld r31,... or ld r30,... */
+	       && !framep
 	       && !minimal_toc_loaded)
 	{
 	  minimal_toc_loaded = 1;
@@ -1446,8 +1404,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
 	     Handle optimizer code motions into the prologue by continuing
 	     the search if we have no valid frame yet or if the return
 	     address is not yet saved in the frame.  */
-	  if (fdata->frameless == 0
-	      && (lr_reg == -1 || fdata->nosavedpc == 0))
+	  if (fdata->frameless == 0 && fdata->nosavedpc == 0)
 	    break;
 
 	  if (op == 0x4e800020		/* blr */
Index: symtab.c
===================================================================
RCS file: /home/gcc/repos/src/src/gdb/symtab.c,v
retrieving revision 1.154
diff -u -p -r1.154 symtab.c
--- symtab.c	21 Jan 2007 16:55:49 -0000	1.154
+++ symtab.c	9 Mar 2007 13:48:32 -0000
@@ -4092,7 +4092,7 @@ skip_prologue_using_sal (CORE_ADDR func_
 	 then it is probably a single line function, like
 	 "foo(){}". */
       if (prologue_sal.end == end_pc)
-	return start_pc;
+	return 0;
       while (prologue_sal.end < end_pc)
 	{
 	  struct symtab_and_line sal;
Index: testsuite/gdb.arch/powerpc-prologue.c
===================================================================
RCS file: /home/gcc/repos/src/src/gdb/testsuite/gdb.arch/powerpc-prologue.c,v
retrieving revision 1.2
diff -u -p -r1.2 powerpc-prologue.c
--- testsuite/gdb.arch/powerpc-prologue.c	9 Jan 2007 17:59:09 -0000	1.2
+++ testsuite/gdb.arch/powerpc-prologue.c	9 Mar 2007 12:46:28 -0000
@@ -31,23 +31,54 @@ int
 main (void)
 {
   gdb2029 ();
+  optimized_1 ();
   return 0;
 }
 
+void
+optimized_1_marker (void)
+{
+}
+
+void
+gdb2029_marker (void)
+{
+}
+
 /* A typical PIC prologue from GCC.  */
 
 asm(".text\n"
-    "    .align 8\n"
+    "    .p2align 3\n"
     SYMBOL (gdb2029) ":\n"
-    "	stw	%r1, -32(%r1)\n"
+    "	stwu	%r1, -32(%r1)\n"
     "	mflr	%r0\n"
     "	bcl-	20,31,.+4\n"
     "	stw	%r30, 24(%r1)\n"
     "	mflr	%r30\n"
     "	stw	%r0, 36(%r1)\n"
-    "	twge	%r2, %r2\n"
+    "	bl	gdb2029_marker\n"
     "	lwz	%r0, 36(%r1)\n"
     "	lwz	%r30, 24(%r1)\n"
     "	mtlr	%r0\n"
-    "	addi	%r0, %r0, 32\n"
+    "	addi	%r1, %r1, 32\n"
+    "	blr");
+
+/* A heavily scheduled prologue.  */
+asm(".text\n"
+    "	.p2align 3\n"
+    SYMBOL (optimized_1) ":\n"
+    "	stwu	%r1,-32(%r1)\n"
+    "	lis	%r9,-16342\n"
+    "	lis	%r11,-16342\n"
+    "	mflr	%r0\n"
+    "	addi	%r11,%r11,3776\n"
+    "	stmw	%r27,12(%r1)\n"
+    "	addi	%r31,%r9,3152\n"
+    "	cmplw	%cr7,%r31,%r11\n"
+    "	stw	%r0,36(%r1)\n"
+    "	mr	%r30,%r3\n"
+    "	bl	optimized_1_marker\n"
+    "	lwz	%r0,36(%r1)\n"
+    "	lmw	%r27,12(%r1)\n"
+    "	addi	%r1,%r1,32\n"
     "	blr");
Index: testsuite/gdb.arch/powerpc-prologue.exp
===================================================================
RCS file: /home/gcc/repos/src/src/gdb/testsuite/gdb.arch/powerpc-prologue.exp,v
retrieving revision 1.2
diff -u -p -r1.2 powerpc-prologue.exp
--- testsuite/gdb.arch/powerpc-prologue.exp	9 Jan 2007 17:59:09 -0000	1.2
+++ testsuite/gdb.arch/powerpc-prologue.exp	9 Mar 2007 12:46:28 -0000
@@ -50,12 +50,40 @@ if ![runto_main] then {
 
 # Testcase for PIC prologue.
 
-gdb_test "continue" "Program received signal SIGTRAP.*" "continue to PIC"
+gdb_breakpoint "gdb2029_marker"
+gdb_test "continue" "Breakpoint $decimal, $hex in gdb2029_marker \\(\\)" \
+	"continue to PIC"
 
 gdb_test "backtrace 10" \
-	"#0\[ \t\]*$hex in gdb2029.*\r\n#1\[ \t\]*$hex in main.*" \
+	"#0\[ \t\]*$hex in gdb2029_marker.*\r\n#1\[ \t\]*$hex in gdb2029.*\r\n#2\[ \t\]*$hex in main.*" \
+	"backtrace in PIC marker"
+
+gdb_test "finish" ".*$hex in gdb2029 .*" "finish from PIC"
+
+gdb_test "backtrace 10" \
+	"#0\[ \t\]*$hex in gdb2029 .*\r\n#1\[ \t\]*$hex in main.*" \
 	"backtrace in PIC"
 
 gdb_test "info frame" \
 	".*Saved registers:.*r30 at.*r31 at.*pc at.*lr at.*" \
 	"saved registers in PIC"
+
+# Testcase for scheduled prologue.
+
+gdb_breakpoint "optimized_1_marker"
+gdb_test "continue" "Breakpoint $decimal, $hex in optimized_1_marker \\(\\)" \
+	"continue to optimized"
+
+gdb_test "backtrace 10" \
+	"#0\[ \t\]*$hex in optimized_1_marker.*\r\n#1\[ \t\]*$hex in optimized_1.*\r\n#2\[ \t\]*$hex in main.*" \
+	"backtrace in optimized marker"
+
+gdb_test "finish" ".*$hex in optimized_1 .*" "finish from optimized"
+
+gdb_test "backtrace 10" \
+	"#0\[ \t\]*$hex in optimized_1 .*\r\n#1\[ \t\]*$hex in main.*" \
+	"backtrace in optimized"
+
+gdb_test "info frame" \
+	".*Saved registers:.*r30 at.*r31 at.*pc at.*lr at.*" \
+	"saved registers in optimized"


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2007-03-09 15:05       ` Daniel Jacobowitz
@ 2007-03-11 19:13         ` Mark Kettenis
  2007-03-12 12:19           ` Daniel Jacobowitz
  2007-04-17  2:02         ` Andreas Schwab
  1 sibling, 1 reply; 24+ messages in thread
From: Mark Kettenis @ 2007-03-11 19:13 UTC (permalink / raw)
  To: drow; +Cc: mark.kettenis, gdb-patches

> Date: Fri, 9 Mar 2007 10:05:04 -0500
> From: Daniel Jacobowitz <drow@false.org>
> 
> Mark told me that OpenBSD is using gcc 3.3.5.  I tried to get qemu to
> run an OpenBSD image, but it ended poorly.  I did find a powerpc-linux
> system using GCC 3.3.3, though.
> 
> Short version: I reproduced one failure and fixed it, and I expect
> that to fix the second failure too, but I'm not sure about the
> selftest.exp problems.
> 
> Mark, could you try the patch at the bottom of this message?  If it
> still causes selftest.exp "odd location" failures, I would appreciate
> a copy of the GDB binary.

Here's a diff of gdb.sum without and with your diff (testsuite with
your diff).  The gdb.base/attach.exp failure is "normal"; the result
of that test flips between PASS and FAIL.  As you can see, there are
still "odd location failures".  Here is an excerpt from gdb.log for one:

(gdb) list
134       char *ttyarg = NULL;
(gdb) step
120     {
(gdb) PASS: gdb.gdb/selftest.exp: step over ttyarg initialization
list
120     {
(gdb) FAIL: gdb.gdb/selftest.exp: step over ttyarg initialization ended up at odd location
step
133       char *cdarg = NULL;
(gdb) PASS: gdb.gdb/selftest.exp: step over ttyarg initialization

This looks as pretty acceptable behaviour.  The initializations have
been moved into the prologue so while stepping over the
initializations, we hop back and forth.  I'm willing to accept this as
a testsuite problem ;-).

But just in case you want to check things out for yourself, you can
find the gdb binarie at:

http://www.xs4all.nl/~sibelius/gdb.macppc.gz

Mark


--- gdb.sum.2	Sun Mar 11 17:52:11 2007
+++ gdb.sum	Sun Mar 11 18:44:45 2007
@@ -1,4 +1,4 @@
-Test Run By kettenis on Sun Mar 11 17:31:35 2007
+Test Run By kettenis on Sun Mar 11 18:24:00 2007
 Native configuration is powerpc-unknown-openbsd3.9
 
 		=== gdb tests ===
@@ -52,8 +52,8 @@
 UNTESTED: gdb.arch/altivec-regs.exp: altivec-regs.exp
 Running ../../../../src/gdb/gdb/testsuite/gdb.arch/e500-abi.exp ...
 Running ../../../../src/gdb/gdb/testsuite/gdb.arch/e500-prologue.exp ...
-gdb compile failed, /tmp//ccxyb831.s: Assembler messages:
-/tmp//ccxyb831.s:31: Error: Unrecognized opcode: `evstdd'
+gdb compile failed, /tmp//cca22559.s: Assembler messages:
+/tmp//cca22559.s:31: Error: Unrecognized opcode: `evstdd'
 UNSUPPORTED: gdb.arch/e500-prologue.exp: Testcase compile failed.
 Running ../../../../src/gdb/gdb/testsuite/gdb.arch/e500-regs.exp ...
 Running ../../../../src/gdb/gdb/testsuite/gdb.arch/gdb1291.exp ...
@@ -76,10 +76,10 @@
 PASS: gdb.arch/powerpc-prologue.exp: backtrace in PIC
 PASS: gdb.arch/powerpc-prologue.exp: saved registers in PIC
 PASS: gdb.arch/powerpc-prologue.exp: continue to optimized
-FAIL: gdb.arch/powerpc-prologue.exp: backtrace in optimized marker
+PASS: gdb.arch/powerpc-prologue.exp: backtrace in optimized marker
 PASS: gdb.arch/powerpc-prologue.exp: finish from optimized
-FAIL: gdb.arch/powerpc-prologue.exp: backtrace in optimized
-FAIL: gdb.arch/powerpc-prologue.exp: saved registers in optimized
+PASS: gdb.arch/powerpc-prologue.exp: backtrace in optimized
+PASS: gdb.arch/powerpc-prologue.exp: saved registers in optimized
 Running ../../../../src/gdb/gdb/testsuite/gdb.arch/thumb-prologue.exp ...
 Running ../../../../src/gdb/gdb/testsuite/gdb.asm/asm-source.exp ...
 PASS: gdb.asm/asm-source.exp: f at main
@@ -344,7 +344,7 @@
 FAIL: gdb.base/attach.exp: after attach2, set tbreak postloop
 FAIL: gdb.base/attach.exp: (timeout) after attach2, reach tbreak postloop
 FAIL: gdb.base/attach.exp: after attach2, exit (timeout)
-PASS: gdb.base/attach.exp: set source path
+FAIL: gdb.base/attach.exp: set source path
 PASS: gdb.base/attach.exp: cd away from process working directory
 PASS: gdb.base/attach.exp: before attach3, flush symbols
 PASS: gdb.base/attach.exp: before attach3, flush exec
@@ -9458,6 +9458,21 @@
 PASS: gdb.gdb/selftest.exp: set listsize to 1
 PASS: gdb.gdb/selftest.exp: run until breakpoint at captured_main
 PASS: gdb.gdb/selftest.exp: printed version as string
+PASS: gdb.gdb/selftest.exp: step over ttyarg initialization
+FAIL: gdb.gdb/selftest.exp: step over ttyarg initialization ended up at odd location
+PASS: gdb.gdb/selftest.exp: step over ttyarg initialization
+PASS: gdb.gdb/selftest.exp: step over cdarg initialization
+FAIL: gdb.gdb/selftest.exp: step over cdarg initialization ended up at odd location
+PASS: gdb.gdb/selftest.exp: step over cdarg initialization
+PASS: gdb.gdb/selftest.exp: step over corearg initialization
+FAIL: gdb.gdb/selftest.exp: step over corearg initialization ended up at odd location
+PASS: gdb.gdb/selftest.exp: step over corearg initialization
+PASS: gdb.gdb/selftest.exp: step over execarg initialization
+FAIL: gdb.gdb/selftest.exp: step over execarg initialization ended up at odd location
+PASS: gdb.gdb/selftest.exp: step over execarg initialization
+PASS: gdb.gdb/selftest.exp: step over symarg initialization
+FAIL: gdb.gdb/selftest.exp: step over symarg initialization ended up at odd location
+PASS: gdb.gdb/selftest.exp: step over symarg initialization
 PASS: gdb.gdb/selftest.exp: step over argc initialization
 PASS: gdb.gdb/selftest.exp: step over argv initialization
 PASS: gdb.gdb/selftest.exp: next over get_run_time and everything it calls
@@ -11461,8 +11476,8 @@
 
 		=== gdb Summary ===
 
-# of expected passes		10807
-# of unexpected failures	108
+# of expected passes		10819
+# of unexpected failures	111
 # of expected failures		42
 # of known failures		60
 # of unresolved testcases	1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2007-03-11 19:13         ` Mark Kettenis
@ 2007-03-12 12:19           ` Daniel Jacobowitz
  2007-03-12 21:02             ` Mark Kettenis
  0 siblings, 1 reply; 24+ messages in thread
From: Daniel Jacobowitz @ 2007-03-12 12:19 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Sun, Mar 11, 2007 at 08:13:14PM +0100, Mark Kettenis wrote:
> Here's a diff of gdb.sum without and with your diff (testsuite with
> your diff).  The gdb.base/attach.exp failure is "normal"; the result
> of that test flips between PASS and FAIL.  As you can see, there are
> still "odd location failures".  Here is an excerpt from gdb.log for one:
> 
> (gdb) list
> 134       char *ttyarg = NULL;
> (gdb) step
> 120     {
> (gdb) PASS: gdb.gdb/selftest.exp: step over ttyarg initialization
> list
> 120     {
> (gdb) FAIL: gdb.gdb/selftest.exp: step over ttyarg initialization ended up at odd location
> step
> 133       char *cdarg = NULL;
> (gdb) PASS: gdb.gdb/selftest.exp: step over ttyarg initialization
> 
> This looks as pretty acceptable behaviour.  The initializations have
> been moved into the prologue so while stepping over the
> initializations, we hop back and forth.  I'm willing to accept this as
> a testsuite problem ;-).

Me too.  But one thing is really puzzling!  We're testing the result
of "list" here.  The huge gdb_expect includes these two:

            -re "\[0-9\]*\t\{\r\n$gdb_prompt $" {
                set description "step over initial brace"
                set command "step"
            }

            -re "\[ \t\]+\{\r\n$gdb_prompt $" {
                setup_xfail "mips-*-irix5*"
                fail "$description ended up at odd location"
            }

I would the first one to match.  It does plenty of times in my
selftest.exp run.  The only way I can imagine for that second pattern
to match would be for <space>{, but there shouldn't be a space there,
just a tab - it comes from print_source_lines_base.  Any idea what
happened?

If you'd like me to beat the testcase into submission, please run
"runtest --debug selftest.exp" and send me the dbg.log it generates;
that will include every pattern matching attempt.  Or, if you don't
care, I can just check it in and we can worry about it later.
Whichever you prefer :-)

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2007-03-12 12:19           ` Daniel Jacobowitz
@ 2007-03-12 21:02             ` Mark Kettenis
  2007-03-12 21:09               ` Daniel Jacobowitz
  0 siblings, 1 reply; 24+ messages in thread
From: Mark Kettenis @ 2007-03-12 21:02 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

> Date: Mon, 12 Mar 2007 08:18:43 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> On Sun, Mar 11, 2007 at 08:13:14PM +0100, Mark Kettenis wrote:
> > Here's a diff of gdb.sum without and with your diff (testsuite with
> > your diff).  The gdb.base/attach.exp failure is "normal"; the result
> > of that test flips between PASS and FAIL.  As you can see, there are
> > still "odd location failures".  Here is an excerpt from gdb.log for one:
> > 
> > (gdb) list
> > 134       char *ttyarg = NULL;
> > (gdb) step
> > 120     {
> > (gdb) PASS: gdb.gdb/selftest.exp: step over ttyarg initialization
> > list
> > 120     {
> > (gdb) FAIL: gdb.gdb/selftest.exp: step over ttyarg initialization ended up at odd location
> > step
> > 133       char *cdarg = NULL;
> > (gdb) PASS: gdb.gdb/selftest.exp: step over ttyarg initialization
> > 
> > This looks as pretty acceptable behaviour.  The initializations have
> > been moved into the prologue so while stepping over the
> > initializations, we hop back and forth.  I'm willing to accept this as
> > a testsuite problem ;-).
> 
> Me too.  But one thing is really puzzling!  We're testing the result
> of "list" here.  The huge gdb_expect includes these two:
> 
>             -re "\[0-9\]*\t\{\r\n$gdb_prompt $" {
>                 set description "step over initial brace"
>                 set command "step"
>             }
> 
>             -re "\[ \t\]+\{\r\n$gdb_prompt $" {
>                 setup_xfail "mips-*-irix5*"
>                 fail "$description ended up at odd location"
>             }
> 
> I would the first one to match.  It does plenty of times in my
> selftest.exp run.  The only way I can imagine for that second pattern
> to match would be for <space>{, but there shouldn't be a space there,
> just a tab - it comes from print_source_lines_base.  Any idea what
> happened?

Ah, I think I've seen this before.  On OpenBSD the tty subsystem does
tab expansion, wheras on Linux this doesn't happen by default.  So we
must match spaces as well as tabs here.  I think that means the second
pattern is really redundant.  How about the attached patch?


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* gdb.gdb/selftest.exp (do_steps_and_nexts): Match spaces as well
	as tabs.  Remove redundant test pattern.

Index: gdb.gdb/selftest.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.gdb/selftest.exp,v
retrieving revision 1.11
diff -u -p -r1.11 selftest.exp
--- gdb.gdb/selftest.exp 31 Jan 2007 19:32:12 -0000 1.11
+++ gdb.gdb/selftest.exp 12 Mar 2007 21:00:28 -0000
@@ -159,7 +159,7 @@ proc do_steps_and_nexts {} {
 		set description "next over textdomain PACKAGE"
 		set command "next"
 	    }
-	    -re "\[0-9\]*\t\{\r\n$gdb_prompt $" {
+	    -re "\[0-9\]+\[\t \]+\{\r\n$gdb_prompt $" {
 		set description "step over initial brace"
 		set command "step"
 	    }
@@ -197,10 +197,6 @@ proc do_steps_and_nexts {} {
 		set description "step over gdb_stderr initialization"
 		set command "step"
 	    }
-	    -re "\[ \t\]+\{\r\n$gdb_prompt $" {
-		setup_xfail "mips-*-irix5*"
-		fail "$description ended up at odd location"
-	    }
 	    -re ".*main.c.*No such file or directory.*$gdb_prompt $" {
 		setup_xfail "rs6000-*-aix3*"
 		fail "must be able to list source lines"


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2007-03-12 21:02             ` Mark Kettenis
@ 2007-03-12 21:09               ` Daniel Jacobowitz
  2007-03-12 23:05                 ` Mark Kettenis
  0 siblings, 1 reply; 24+ messages in thread
From: Daniel Jacobowitz @ 2007-03-12 21:09 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Mon, Mar 12, 2007 at 10:02:08PM +0100, Mark Kettenis wrote:
> Ah, I think I've seen this before.  On OpenBSD the tty subsystem does
> tab expansion, wheras on Linux this doesn't happen by default.  So we
> must match spaces as well as tabs here.  I think that means the second
> pattern is really redundant.  How about the attached patch?

Yeesh!  I didn't know that.  Is there somewhere we could write it down
for test writers who make this same mistake, maybe?  I would have
merrily written tests that expected the tab :-(

Your patch looks right to me.  I know that I hit the "step over
initial brace" on all platforms on a regular basis - it's not like
this is a new problem.  But letting it pass is probably relatively
newer than the IRIX-specific xfail.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2007-03-12 21:09               ` Daniel Jacobowitz
@ 2007-03-12 23:05                 ` Mark Kettenis
  2007-03-13  4:24                   ` Eli Zaretskii
  2007-03-13 17:37                   ` Daniel Jacobowitz
  0 siblings, 2 replies; 24+ messages in thread
From: Mark Kettenis @ 2007-03-12 23:05 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

> Date: Mon, 12 Mar 2007 17:08:56 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> On Mon, Mar 12, 2007 at 10:02:08PM +0100, Mark Kettenis wrote:
> > Ah, I think I've seen this before.  On OpenBSD the tty subsystem does
> > tab expansion, wheras on Linux this doesn't happen by default.  So we
> > must match spaces as well as tabs here.  I think that means the second
> > pattern is really redundant.  How about the attached patch?
> 
> Yeesh!  I didn't know that.  Is there somewhere we could write it down
> for test writers who make this same mistake, maybe?  I would have
> merrily written tests that expected the tab :-(

Hmm, I'm not sure we have any documentation on this.  Eli, do you know
a good location to put this info.

> 
> Your patch looks right to me.  I know that I hit the "step over
> initial brace" on all platforms on a regular basis - it's not like
> this is a new problem.  But letting it pass is probably relatively
> newer than the IRIX-specific xfail.

Comitted.

Daniel, this means that as far as I am concerned this patch can go in.

Mark


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2007-03-12 23:05                 ` Mark Kettenis
@ 2007-03-13  4:24                   ` Eli Zaretskii
  2007-04-10 21:10                     ` Daniel Jacobowitz
  2007-03-13 17:37                   ` Daniel Jacobowitz
  1 sibling, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2007-03-13  4:24 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: drow, gdb-patches

> Date: Tue, 13 Mar 2007 00:05:10 +0100 (CET)
> From: Mark Kettenis <mark.kettenis@xs4all.nl>
> CC: gdb-patches@sourceware.org
> 
> > Yeesh!  I didn't know that.  Is there somewhere we could write it down
> > for test writers who make this same mistake, maybe?  I would have
> > merrily written tests that expected the tab :-(
> 
> Hmm, I'm not sure we have any documentation on this.  Eli, do you know
> a good location to put this info.

There's a section in gdbint.texinfo about the test suite, which seems
a suitable place.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2007-03-12 23:05                 ` Mark Kettenis
  2007-03-13  4:24                   ` Eli Zaretskii
@ 2007-03-13 17:37                   ` Daniel Jacobowitz
  1 sibling, 0 replies; 24+ messages in thread
From: Daniel Jacobowitz @ 2007-03-13 17:37 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Tue, Mar 13, 2007 at 12:05:10AM +0100, Mark Kettenis wrote:
> Daniel, this means that as far as I am concerned this patch can go in.

Thanks a lot.  I've checked it in now.  I'll leave PowerPC alone for a
few days to make sure this doesn't turn up any issues before I turn on CFI.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2007-03-13  4:24                   ` Eli Zaretskii
@ 2007-04-10 21:10                     ` Daniel Jacobowitz
  2007-04-11  3:35                       ` Eli Zaretskii
  0 siblings, 1 reply; 24+ messages in thread
From: Daniel Jacobowitz @ 2007-04-10 21:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Mark Kettenis, gdb-patches

On Tue, Mar 13, 2007 at 06:24:17AM +0200, Eli Zaretskii wrote:
> > Date: Tue, 13 Mar 2007 00:05:10 +0100 (CET)
> > From: Mark Kettenis <mark.kettenis@xs4all.nl>
> > CC: gdb-patches@sourceware.org
> > 
> > > Yeesh!  I didn't know that.  Is there somewhere we could write it down
> > > for test writers who make this same mistake, maybe?  I would have
> > > merrily written tests that expected the tab :-(
> > 
> > Hmm, I'm not sure we have any documentation on this.  Eli, do you know
> > a good location to put this info.
> 
> There's a section in gdbint.texinfo about the test suite, which seems
> a suitable place.

Yes indeed.  Is this OK?

-- 
Daniel Jacobowitz
CodeSourcery

2007-04-10  Daniel Jacobowitz  <dan@codesourcery.com>

	* gdbint.texinfo (Writing Tests): Mention gdb_test_multiple
	and tab expansion.

Index: gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.258
diff -u -p -r1.258 gdbint.texinfo
--- gdbint.texinfo	10 Apr 2007 11:58:15 -0000	1.258
+++ gdbint.texinfo	10 Apr 2007 21:09:34 -0000
@@ -7144,7 +7144,14 @@ instance, @file{gdb.base/exprs.exp} defi
 calls @code{gdb_test} multiple times.
 
 Only use @code{send_gdb} and @code{gdb_expect} when absolutely
-necessary, such as when @value{GDBN} has several valid responses to a command.
+necessary.  Even if @value{GDBN} has several valid responses to
+a command, you can use @code{gdb_test_multiple}.  Like @code{gdb_test},
+@code{gdb_test_multiple} recognizes internal errors and unexpected
+prompts.
+
+Do not write tests which expect a literal tab character from @value{GDBN}.
+On some operating systems (e.g.@: OpenBSD) the TTY layer expands tabs to
+spaces, so by the time @value{GDBN}'s output reaches expect the tab is gone.
 
 The source language programs do @emph{not} need to be in a consistent
 style.  Since @value{GDBN} is used to debug programs written in many different


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2007-04-10 21:10                     ` Daniel Jacobowitz
@ 2007-04-11  3:35                       ` Eli Zaretskii
  2007-04-11 11:11                         ` Daniel Jacobowitz
  0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2007-04-11  3:35 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: mark.kettenis, gdb-patches

> Date: Tue, 10 Apr 2007 17:10:34 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Mark Kettenis <mark.kettenis@xs4all.nl>,
> 	gdb-patches@sourceware.org
> 
> On Tue, Mar 13, 2007 at 06:24:17AM +0200, Eli Zaretskii wrote:
> > > Date: Tue, 13 Mar 2007 00:05:10 +0100 (CET)
> > > From: Mark Kettenis <mark.kettenis@xs4all.nl>
> > > CC: gdb-patches@sourceware.org
> > > 
> > > > Yeesh!  I didn't know that.  Is there somewhere we could write it down
> > > > for test writers who make this same mistake, maybe?  I would have
> > > > merrily written tests that expected the tab :-(
> > > 
> > > Hmm, I'm not sure we have any documentation on this.  Eli, do you know
> > > a good location to put this info.
> > 
> > There's a section in gdbint.texinfo about the test suite, which seems
> > a suitable place.
> 
> Yes indeed.  Is this OK?

Yes, thanks.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2007-04-11  3:35                       ` Eli Zaretskii
@ 2007-04-11 11:11                         ` Daniel Jacobowitz
  0 siblings, 0 replies; 24+ messages in thread
From: Daniel Jacobowitz @ 2007-04-11 11:11 UTC (permalink / raw)
  To: gdb-patches

On Wed, Apr 11, 2007 at 06:35:48AM +0300, Eli Zaretskii wrote:
> Yes, thanks.

Thanks, I committed it.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2007-03-09 15:05       ` Daniel Jacobowitz
  2007-03-11 19:13         ` Mark Kettenis
@ 2007-04-17  2:02         ` Andreas Schwab
  2007-04-17 15:02           ` Daniel Jacobowitz
  1 sibling, 1 reply; 24+ messages in thread
From: Andreas Schwab @ 2007-04-17  2:02 UTC (permalink / raw)
  To: gdb-patches

Daniel Jacobowitz <drow@false.org> writes:

> 2007-03-09  Daniel Jacobowitz  <dan@codesourcery.com>
> 
> 	* rs6000-tdep.c (rs6000_skip_prologue): Use skip_prologue_using_sal.

This is causing a regression when the function is very small.

$ cat prologue.c
int foo ()
{
  return 0;
}

int main (void)
{
  return foo ();
}
$ gcc -O2 -g prologue.c
$ gdb a.out
GNU gdb 6.6.50.20070416-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-suse-linux"...
Using host libthread_db library "/lib/power4/libthread_db.so.1".
(gdb) b foo
Breakpoint 1 at 0x10000490: file prologue.c, line 8.
(gdb) i b
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x10000490 in main at prologue.c:8
(gdb) 

Note that the breakpoint is actually in main, not in foo.  The problem is
that skip_prologue_using_sal does not properly handle a function with only
one sal if the pc of the next line is bigger than the end pc of the
current function.

Andreas.

2007-04-16  Andreas Schwab  <schwab@suse.de>

	* symtab.c (skip_prologue_using_sal): Allow the end of the prologue
	sal to be bigger than the end of the function.

--- gdb/symtab.c.~1.156.~	2007-03-28 12:57:45.000000000 +0200
+++ gdb/symtab.c	2007-04-16 17:39:04.000000000 +0200
@@ -4111,7 +4111,7 @@ skip_prologue_using_sal (CORE_ADDR func_
       /* If there is only one sal that covers the entire function,
 	 then it is probably a single line function, like
 	 "foo(){}". */
-      if (prologue_sal.end == end_pc)
+      if (prologue_sal.end >= end_pc)
 	return 0;
       while (prologue_sal.end < end_pc)
 	{

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Improve end check on rs6000 prologue analyzer
  2007-04-17  2:02         ` Andreas Schwab
@ 2007-04-17 15:02           ` Daniel Jacobowitz
  0 siblings, 0 replies; 24+ messages in thread
From: Daniel Jacobowitz @ 2007-04-17 15:02 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb-patches

On Mon, Apr 16, 2007 at 06:02:56PM +0200, Andreas Schwab wrote:
> Note that the breakpoint is actually in main, not in foo.  The problem is
> that skip_prologue_using_sal does not properly handle a function with only
> one sal if the pc of the next line is bigger than the end pc of the
> current function.

Whoops.

> 2007-04-16  Andreas Schwab  <schwab@suse.de>
> 
> 	* symtab.c (skip_prologue_using_sal): Allow the end of the prologue
> 	sal to be bigger than the end of the function.

This is OK, and thank you.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2007-04-17 15:00 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-29 21:37 Improve end check on rs6000 prologue analyzer Daniel Jacobowitz
2006-09-30 19:32 ` Mark Kettenis
2006-09-30 20:25   ` Daniel Jacobowitz
2006-10-17 21:21   ` Daniel Jacobowitz
2006-10-17 22:15     ` Mark Kettenis
2006-10-18  5:41     ` Wu Zhou
2006-10-18 14:18       ` Daniel Jacobowitz
2006-10-18 19:58     ` Mark Kettenis
2006-10-18 20:06       ` Daniel Jacobowitz
2006-11-30 20:12         ` Daniel Jacobowitz
2007-02-15 20:20           ` Aman Wardak
2007-03-09 15:05       ` Daniel Jacobowitz
2007-03-11 19:13         ` Mark Kettenis
2007-03-12 12:19           ` Daniel Jacobowitz
2007-03-12 21:02             ` Mark Kettenis
2007-03-12 21:09               ` Daniel Jacobowitz
2007-03-12 23:05                 ` Mark Kettenis
2007-03-13  4:24                   ` Eli Zaretskii
2007-04-10 21:10                     ` Daniel Jacobowitz
2007-04-11  3:35                       ` Eli Zaretskii
2007-04-11 11:11                         ` Daniel Jacobowitz
2007-03-13 17:37                   ` Daniel Jacobowitz
2007-04-17  2:02         ` Andreas Schwab
2007-04-17 15:02           ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox