public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  archer-jankratochvil-watchpoint3: Merge branch 'cleanup-fork-multi-kernel' into archer-jankratochvil-watchpoint3
Date: Sun, 12 Dec 2010 07:59:00 -0000	[thread overview]
Message-ID: <20101212075925.28339.qmail@sourceware.org> (raw)

The branch, archer-jankratochvil-watchpoint3 has been updated
       via  a3828361bbbc39c546b7ece28777842cefff5712 (commit)
       via  7b1a369e35be961cc09450969dff4f9b8c175589 (commit)
       via  2128006bbd02f230496c8f9be03843aa41cd4e1a (commit)
       via  f0e2c8e25d121c93ef1b00761b7bde4afba2df54 (commit)
       via  b3274e3d5c678dafe10385b4fed7d91308e45073 (commit)
       via  2f1ba57a86354cfedb94116002e37031bf3078aa (commit)
       via  147ae723841f440c6379d09cebdf44a36b899b90 (commit)
      from  940fc080a370235a1b515265d066876193e7028e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit a3828361bbbc39c546b7ece28777842cefff5712
Merge: 940fc08 7b1a369
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Dec 12 08:58:55 2010 +0100

    Merge branch 'cleanup-fork-multi-kernel' into archer-jankratochvil-watchpoint3

commit 7b1a369e35be961cc09450969dff4f9b8c175589
Merge: f0e2c8e 2128006
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Dec 12 08:54:16 2010 +0100

    Merge branch 'cleanup-fork-multi' into cleanup-fork-multi-kernel

commit 2128006bbd02f230496c8f9be03843aa41cd4e1a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Dec 12 08:54:08 2010 +0100

    fix

commit f0e2c8e25d121c93ef1b00761b7bde4afba2df54
Merge: 2f1ba57 b3274e3
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Dec 12 07:17:04 2010 +0100

    Merge branch 'cleanup-fork-multi' into cleanup-fork-multi-kernel

commit b3274e3d5c678dafe10385b4fed7d91308e45073
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Dec 12 07:15:39 2010 +0100

    testcase update

commit 2f1ba57a86354cfedb94116002e37031bf3078aa
Merge: 5b687cf 147ae72
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Dec 12 06:51:26 2010 +0100

    Merge branch 'cleanup-fork-multi' into cleanup-fork-multi-kernel

commit 147ae723841f440c6379d09cebdf44a36b899b90
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sun Dec 12 06:49:42 2010 +0100

    multifix

-----------------------------------------------------------------------

Summary of changes:
 gdb/breakpoint.c                             |   18 +++++++---
 gdb/testsuite/gdb.multi/watchpoint-multi.c   |   25 +++++++++++---
 gdb/testsuite/gdb.multi/watchpoint-multi.exp |   43 +++++++++++++++++++++----
 3 files changed, 67 insertions(+), 19 deletions(-)

First 500 lines of diff:
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index be0d262..2949316 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1941,13 +1941,19 @@ insert_breakpoint_locations (void)
 
       if (bpt->disposition == disp_del_at_next_stop)
 	continue;
-      
+
       for (loc = bpt->loc; loc; loc = loc->next)
-	if (!loc->inserted && should_be_inserted (loc))
-	  {
-	    some_failed = 1;
-	    break;
-	  }
+	{
+	  /* Verify the first loop above really tried to insert this LOC.  */
+	  if (!loc->inserted && should_be_inserted (loc)
+	      && (gdbarch_has_global_breakpoints (target_gdbarch)
+		  || (!ptid_equal (inferior_ptid, null_ptid)
+		      && loc->pspace == saved_current_program_space)))
+	    {
+	      some_failed = 1;
+	      break;
+	    }
+	}
       if (some_failed)
 	{
 	  for (loc = bpt->loc; loc; loc = loc->next)
diff --git a/gdb/testsuite/gdb.multi/watchpoint-multi.c b/gdb/testsuite/gdb.multi/watchpoint-multi.c
index f9f52e8..153c18b 100644
--- a/gdb/testsuite/gdb.multi/watchpoint-multi.c
+++ b/gdb/testsuite/gdb.multi/watchpoint-multi.c
@@ -15,6 +15,9 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include <pthread.h>
+#include <assert.h>
+
 static volatile int a, b, c;
 
 static void
@@ -30,15 +33,25 @@ marker_exit2 (void)
   a = 1;
 }
 
-int
-main (void)
+static void *
+start (void *arg)
 {
-  a = 1;
-  a = 1;
-  b = 2;
   b = 2;
   c = 3;
-  c = 3;
+
+  return NULL;
+}
+
+int
+main (void)
+{
+  pthread_t thread;
+  int i;
+
+  i = pthread_create (&thread, NULL, start, NULL);
+  assert (i == 0);
+  i = pthread_join (thread, NULL);
+  assert (i == 0);
 
   marker_exit1 ();
   marker_exit2 ();
diff --git a/gdb/testsuite/gdb.multi/watchpoint-multi.exp b/gdb/testsuite/gdb.multi/watchpoint-multi.exp
index 99809b4..3b5d040 100644
--- a/gdb/testsuite/gdb.multi/watchpoint-multi.exp
+++ b/gdb/testsuite/gdb.multi/watchpoint-multi.exp
@@ -23,10 +23,13 @@ set executable ${testfile}
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${executable}
 
-if { [prepare_for_testing ${testfile}.exp ${executable} ${srcfile}] } {
+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+    untested ${testfile}.exp
     return -1
 }
 
+clean_restart $executable
+
 if ![runto_main] {
     return
 }
@@ -44,12 +47,17 @@ delete_breakpoints
 
 # Simulate non-stop+target-async which also uses breakpoint always-inserted.
 gdb_test_no_output "set breakpoint always-inserted on"
+# displaced-stepping is also needed as other GDB sometimes still removes the
+# breakpoints, even with always-inserted on.
+gdb_test_no_output "set displaced-stepping on"
 
 # Debugging of this testcase:
 #gdb_test_no_output "maintenance set show-debug-regs on"
 #gdb_test_no_output "set debug infrun 1"
 
-gdb_test "watch c" "Hardware watchpoint \[0-9\]+: c"
+# Do not use simple hardware watchpoint ("watch") as its false hit may be
+# unnoticed by GDB if it reads it still has the same value.
+gdb_test "awatch c" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: c"
 # Never keep/use any non-hw breakpoints to workaround a multi-inferior bug.
 # Use `*' to workaround a multi-inferior bug.
 set test "hbreak *marker_exit2"
@@ -66,19 +74,40 @@ gdb_test_multiple $test $test {
 
 gdb_test "inferior 1" "witching to inferior 1 .*"
 
-gdb_test "watch b" "Hardware watchpoint \[0-9\]+: b"
+gdb_test "awatch b" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: b"
 gdb_test "hbreak *marker_exit1" {Hardware assisted breakpoint [0-9]+ at .*}
 
 gdb_test "inferior 2" "witching to inferior 2 .*"
 
 # FAIL would be a hit on watchpoint for `b' - that one is for the other
 # inferior.
-gdb_test "continue" "Hardware watchpoint \[0-9\]+: c\r\n\r\nOld value = 0\r\nNew value = 3\r\n.*" "catch c"
+gdb_test "continue" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: c\r\n\r\nOld value = 0\r\nNew value = 3\r\n.*" "catch c"
 
-gdb_test "continue" {Breakpoint [0-9]+, marker_exit2 .*} "catch marker_exit2"
+set test "catch marker_exit2"
+gdb_test_multiple "continue" $test {
+    -re "Breakpoint \[0-9\]+, marker_exit2 .*\r\n$gdb_prompt $" {
+	setup_kfail breakpoints/12312 *-*-*
+	pass $test
+    }
+    -re "Hardware access \\(read/write\\) watchpoint \[0-9\]+: c\r\n\r\nValue = 3\r\n.* in __nptl_death_event .*\r\n$gdb_prompt $" {
+	setup_kfail breakpoints/12312 *-*-*
+	fail $test
+    }
+}
 
 gdb_test "inferior 1" "witching to inferior 1 .*"
 
-gdb_test "continue" "Hardware watchpoint \[0-9\]+: b\r\n\r\nOld value = 0\r\nNew value = 2\r\n.*" "catch b"
+gdb_test "continue" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: b\r\n\r\nOld value = 0\r\nNew value = 2\r\n.*" "catch b"
+
+set test "catch marker_exit1"
+gdb_test_multiple "continue" $test {
+    -re "Breakpoint \[0-9\]+, marker_exit1 .*\r\n$gdb_prompt $" {
+	setup_kfail breakpoints/12312 *-*-*
+	pass $test
+    }
+    -re "Hardware access \\(read/write\\) watchpoint \[0-9\]+: b\r\n\r\nValue = 2\r\n.* in __nptl_death_event .*\r\n$gdb_prompt $" {
+	setup_kfail breakpoints/12312 *-*-*
+	fail $test
+    }
+}
 
-gdb_test "continue" {Breakpoint [0-9]+, marker_exit1 .*} "catch marker_exit2"


hooks/post-receive
--
Repository for Project Archer.


             reply	other threads:[~2010-12-12  7:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-12  7:59 jkratoch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-02-06 19:35 jkratoch
2011-01-29 18:15 jkratoch
2010-12-11  5:16 jkratoch
2010-12-11  1:46 jkratoch

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=20101212075925.28339.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).