Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] XFAIL gdb.cp/mb-inline.exp conditionaly
@ 2011-06-16  6:17 Yao Qi
  2011-06-22 15:38 ` Pedro Alves
  0 siblings, 1 reply; 8+ messages in thread
From: Yao Qi @ 2011-06-16  6:17 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]

In mb-inline.exp, breakpoint 1.2 is disabled, re-run program, and make
sure breakpoint 1.2 is still disabled and program will not hit it.  The
pre-condition is new inferior created by re-run is loaded at the exactly
same address as previous one.  However, it is not true on some systems,
such as uclinux.

On uclinux, new inferior is created on the different address, so status
of breakpoint location (enabled or disabled) will not be kept during
breakpoint updates.  breakpoint 1.2 become enabled, instead of disabled.
 This will make this FAIL,

  FAIL: gdb.cp/mb-inline.exp: continue with disabled breakpoint 1.2

This patch is to address this issue.  After this patch, in my uclinux
port, the test result is like this,

# of expected passes            9
# of expected failures          1

but, some times, we can get 10 PASSes, because the new inferior may be
created/loaded on the same address as previous one.

Note that I also considered to use setup_xfail for uclinux target, but
we may get a XPASS, so I didn't write patch in that way.

OK for mainline?

-- 
Yao (齐尧)

[-- Attachment #2: uclinux_mb_inline.patch --]
[-- Type: text/x-patch, Size: 1651 bytes --]

2011-06-15  Yao Qi  <yao@codesourcery.com>

	gdb/testsuite/
	* gdb.cp/mb-inline.exp: Set breakpoint on function marker.
	XFAIL for uclinux.
	* gdb.cp/mb-inline1.cc (marker): New.

diff --git a/gdb/testsuite/gdb.cp/mb-inline.exp b/gdb/testsuite/gdb.cp/mb-inline.exp
index 86cb5ba..62708b0 100644
--- a/gdb/testsuite/gdb.cp/mb-inline.exp
+++ b/gdb/testsuite/gdb.cp/mb-inline.exp
@@ -101,7 +101,24 @@ gdb_expect {
     }
 }
 
-gdb_continue_to_end "disabled breakpoint 1.2"
+
+gdb_test "break marker" \
+    "Breakpoint.*at.* file .*, line.*" \
+    "set breakpoint on marker"
+
+gdb_test_multiple "continue" "continue with disabled breakpoint 1.2" {
+    -re "Breakpoint \[0-9\]+,.*marker.*$gdb_prompt $" {
+       pass "continue with disabled breakpoint 1.2"
+    }
+    -re "Breakpoint \[0-9\]+,.*foo \\(i=1\\).*$gdb_prompt $" {
+       # When inferior is restarted, breakpoint locations will be updated.
+       # On uclinux, it is not guaranteed that new inferior is located the
+       # same address as previous one, so status/state of breakpoint location
+       # will loose.
+       setup_xfail "*-*-uclinux*"
+       fail "continue with disabled breakpoint 1.2"
+    }
+}
 
 # Make sure we can set a breakpoint on a source statement that spans
 # multiple lines.
diff --git a/gdb/testsuite/gdb.cp/mb-inline1.cc b/gdb/testsuite/gdb.cp/mb-inline1.cc
index 3259002..86dc697 100644
--- a/gdb/testsuite/gdb.cp/mb-inline1.cc
+++ b/gdb/testsuite/gdb.cp/mb-inline1.cc
@@ -26,10 +26,15 @@ afn ()
   return foo (0) + multi_line_foo (0);
 }
 
+void
+marker ()
+{}
+
 int
 main ()
 {
   int a = afn ();
   int b = bfn ();
+  marker ();
   return a * b;
 }

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

end of thread, other threads:[~2011-06-23 14:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-16  6:17 [patch] XFAIL gdb.cp/mb-inline.exp conditionaly Yao Qi
2011-06-22 15:38 ` Pedro Alves
2011-06-23  9:21   ` Yao Qi
2011-06-23 10:28     ` Pedro Alves
2011-06-23 13:40       ` Yao Qi
2011-06-23 14:00         ` Pedro Alves
2011-06-23 10:37     ` Pedro Alves
2011-06-23 14:41       ` Yao Qi

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