public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-sergio-catch-syscall: Fixing a little bug regarding stale entrybp.
@ 2009-01-09 15:47 sergio
  0 siblings, 0 replies; only message in thread
From: sergio @ 2009-01-09 15:47 UTC (permalink / raw)
  To: archer-commits

The branch, archer-sergio-catch-syscall has been updated
       via  f86c10ae2cb1c899883b11e79998e4a275332a2c (commit)
       via  4a253ce0af0dc8800c52c949a1bc836e9b949cc0 (commit)
       via  c7f553af5a8f90c628ca56225fb1889ee9199930 (commit)
      from  328651b6dc2f7a87319f57db8dfb4ac0860b7144 (commit)

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

- Log -----------------------------------------------------------------
commit f86c10ae2cb1c899883b11e79998e4a275332a2c
Author: Sergio Durigan Junior <sergiosdj@gmail.com>
Date:   Fri Jan 9 13:46:35 2009 -0200

    Fixing a little bug regarding stale entrybp.

commit 4a253ce0af0dc8800c52c949a1bc836e9b949cc0
Merge: c7f553af5a8f90c628ca56225fb1889ee9199930 328651b6dc2f7a87319f57db8dfb4ac0860b7144
Author: Sergio Durigan Junior <sergiosdj@gmail.com>
Date:   Thu Jan 8 23:12:04 2009 -0200

    Merge branch 'archer-sergio-catch-syscall' of ssh://sourceware.org/git/archer into archer-sergio-catch-syscall

commit c7f553af5a8f90c628ca56225fb1889ee9199930
Author: Sergio Durigan Junior <sergiosdj@gmail.com>
Date:   Tue Nov 18 02:59:04 2008 -0200

    Build system, testcase and documentation.

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

Summary of changes:
 gdb/breakpoint.c |   18 +++++++++++++++++-
 gdb/breakpoint.h |    3 +++
 gdb/linux-nat.c  |    8 ++++++++
 3 files changed, 28 insertions(+), 1 deletions(-)

First 500 lines of diff:
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 143d4b0..09b3171 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -4403,11 +4403,13 @@ disable_overlay_breakpoints (void)
 }
 
 int
-create_entry_breakpoint ()
+create_entry_breakpoint (void)
 {
   CORE_ADDR taddr, entry_addr;
   struct breakpoint *b;
 
+  delete_entry_breakpoint ();
+
   taddr = entry_point_address ();
   /* Make certain that the address points at real code, and not a
      function descriptor.  */
@@ -4427,6 +4429,20 @@ create_entry_breakpoint ()
   return 1;
 }
 
+/* Remove the breakpoint from create_entry_breakpoint.  To be called in the
+   same moments as remove_thread_event_breakpoints (or its caller
+   disable_thread_event_reporting) are being called.  */
+
+void
+delete_entry_breakpoint (void)
+{
+  struct breakpoint *b, *temp;
+
+  ALL_BREAKPOINTS_SAFE (b, temp)
+    if (b->type == bp_entry_breakpoint)
+      delete_breakpoint (b);
+}
+
 struct breakpoint *
 create_thread_event_breakpoint (CORE_ADDR address)
 {
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 384a156..4ef3c78 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -913,6 +913,9 @@ extern int catching_syscall_number (int syscall_number);
    or 1 if everything went OK.  */
 extern int create_entry_breakpoint (void);
 
+/* Remove the breakpoint from create_entry_breakpoint.  */
+extern void delete_entry_breakpoint (void);
+
 /* Tell a breakpoint to be quiet.  */
 extern void make_breakpoint_silent (struct breakpoint *);
 
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 4b317f6..20a85d1 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1681,6 +1681,8 @@ linux_nat_detach (struct target_ops *ops, char *args, int from_tty)
   int status;
   enum target_signal sig;
 
+  delete_entry_breakpoint ();
+
   if (target_can_async_p ())
     linux_nat_async (NULL, 0);
 
@@ -2896,6 +2898,9 @@ linux_nat_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
   if (debug_linux_nat_async)
     fprintf_unfiltered (gdb_stdlog, "LLW: enter\n");
 
+  if (ourstatus->kind == TARGET_WAITKIND_EXECD)
+    delete_entry_breakpoint ();
+
   /* The first time we get here after starting a new inferior, we may
      not have added it to the LWP list yet - this is the earliest
      moment at which we know its PID.  */
@@ -3330,6 +3335,9 @@ linux_nat_mourn_inferior (struct target_ops *ops)
        there are other viable forks to debug.  Delete the exiting
        one and context-switch to the first available.  */
     linux_fork_mourn_inferior ();
+
+  /* It would fail with a warning before the inherited mourn calls above.  */
+  delete_entry_breakpoint ();
 }
 
 static LONGEST


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-09 15:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-09 15:47 [SCM] archer-sergio-catch-syscall: Fixing a little bug regarding stale entrybp sergio

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).