From: Yao Qi <yao@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: [patch] XFAIL gdb.cp/mb-inline.exp conditionaly
Date: Thu, 16 Jun 2011 06:17:00 -0000 [thread overview]
Message-ID: <4DF8BEEF.5010308@codesourcery.com> (raw)
[-- 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;
}
next reply other threads:[~2011-06-16 6:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-16 6:17 Yao Qi [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DF8BEEF.5010308@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox