This is the mail archive of the archer-commits@sourceware.org mailing list for the Archer project.


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

[SCM] archer-jankratochvil-fedora12: Fix assertion failure with `set debug infrun 1'.


The branch, archer-jankratochvil-fedora12 has been updated
       via  9502d9fe8f4a9f9388b48a87354ac815a0b5df9e (commit)
       via  c0e0f7c6577b4de094b5922bd0fd885d3d7d4408 (commit)
      from  821e089b4dcbd1366f75225b73f2024d4abc177d (commit)

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

- Log -----------------------------------------------------------------
commit 9502d9fe8f4a9f9388b48a87354ac815a0b5df9e
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Oct 2 23:32:09 2009 +0200

    Fix assertion failure with `set debug infrun 1'.
    
    gdb/
            Fix assertion failure with `set debug infrun 1'.
            * gdb/infrun.c (handle_inferior_event <debug_infrun>): New variable
            old_chain.  Temporarily switch INFERIOR_PTID.
            * target.h (target_stopped_by_watchpoint): Extend the comment.
            (target_stopped_data_address): New comment.
    
    gdb/testsuite/
            * gdb.threads/watchthreads-reorder.exp: Call `set debug infrun 1'.

commit c0e0f7c6577b4de094b5922bd0fd885d3d7d4408
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Oct 2 23:33:41 2009 +0200

    Fix comment typo.
    
    	* amd64-linux-nat.c (amd64_linux_dr_unset_status): Fix comment typo.
    	* i386-linux-nat.c (i386_linux_dr_unset_status): Likewise.

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

Summary of changes:
 gdb/amd64-linux-nat.c                              |    2 +-
 gdb/i386-linux-nat.c                               |    2 +-
 gdb/infrun.c                                       |    5 +++++
 gdb/target.h                                       |    9 ++++++---
 gdb/testsuite/gdb.threads/watchthreads-reorder.exp |    4 ++++
 5 files changed, 17 insertions(+), 5 deletions(-)

First 500 lines of diff:
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index a6d35d7..fc4b3e0 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -332,7 +332,7 @@ amd64_linux_dr_get_status (void)
   return amd64_linux_dr_get (inferior_ptid, DR_STATUS);
 }
 
-/* Unset VALUE bits in DR_STATUS in all LWPs of LWP_LIST.  */
+/* Unset MASK bits in DR_STATUS in all LWPs of LWP_LIST.  */
 
 static void
 amd64_linux_dr_unset_status (unsigned long mask)
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 170e6cd..905dcc3 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -678,7 +678,7 @@ i386_linux_dr_get_status (void)
   return i386_linux_dr_get (inferior_ptid, DR_STATUS);
 }
 
-/* Unset VALUE bits in DR_STATUS in all LWPs of LWP_LIST.  */
+/* Unset MASK bits in DR_STATUS in all LWPs of LWP_LIST.  */
 
 static void
 i386_linux_dr_unset_status (unsigned long mask)
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 2ee2164..b132928 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2857,6 +2857,9 @@ targets should add new threads to the thread list themselves in non-stop mode.")
     {
       struct regcache *regcache = get_thread_regcache (ecs->ptid);
       struct gdbarch *gdbarch = get_regcache_arch (regcache);
+      struct cleanup *old_chain = save_inferior_ptid ();
+
+      inferior_ptid = ecs->ptid;
 
       fprintf_unfiltered (gdb_stdlog, "infrun: stop_pc = %s\n",
                           paddress (gdbarch, stop_pc));
@@ -2873,6 +2876,8 @@ targets should add new threads to the thread list themselves in non-stop mode.")
             fprintf_unfiltered (gdb_stdlog,
                                 "infrun: (no data address available)\n");
 	}
+
+      do_cleanups (old_chain);
     }
 
   if (stepping_past_singlestep_breakpoint)
diff --git a/gdb/target.h b/gdb/target.h
index adff946..3c06eba 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1125,7 +1125,7 @@ extern char *normal_pid_to_str (ptid_t ptid);
 /* Hardware watchpoint interfaces.  */
 
 /* Returns non-zero if we were stopped by a hardware watchpoint (memory read or
-   write).  */
+   write).  Only the INFERIOR_PTID task is being queried.  */
 
 #define target_stopped_by_watchpoint \
    (*current_target.to_stopped_by_watchpoint)
@@ -1182,8 +1182,11 @@ extern char *normal_pid_to_str (ptid_t ptid);
 #define target_remove_hw_breakpoint(gdbarch, bp_tgt) \
      (*current_target.to_remove_hw_breakpoint) (gdbarch, bp_tgt)
 
-#define target_stopped_data_address(target, x) \
-    (*target.to_stopped_data_address) (target, x)
+/* Return non-zero if target knows the data address which triggered this
+   target_stopped_by_watchpoint, in such case place it to *ADDR_P.  Only the
+   INFERIOR_PTID task is being queried.  */
+#define target_stopped_data_address(target, addr_p) \
+    (*target.to_stopped_data_address) (target, addr_p)
 
 #define target_watchpoint_addr_within_range(target, addr, start, length) \
   (*target.to_watchpoint_addr_within_range) (target, addr, start, length)
diff --git a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp
index 8f65364..5ad1a4e 100644
--- a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp
+++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp
@@ -95,6 +95,10 @@ foreach reorder {0 1} {
 	     "Hardware read watchpoint \[0-9\]+: thread\[12\]_rwatch\r\n\r\nValue = 0\r\n0x\[0-9a-f\]+ in thread\[12\]_func .*" \
 	     "continue b"
 
+    # While the debug output itself is not checked in this testcase one bug was
+    # found in the DEBUG_INFRUN code path.
+    gdb_test "set debug infrun 1"
+
     gdb_continue_to_breakpoint "break-at-exit" ".*break-at-exit.*"
 
     set pf_prefix $prefix_test


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


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