From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26782 invoked by alias); 9 Jan 2009 15:47:53 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 26752 invoked by uid 9782); 9 Jan 2009 15:47:53 -0000 Date: Fri, 09 Jan 2009 15:47:00 -0000 Message-ID: <20090109154753.26737.qmail@sourceware.org> From: sergio@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-sergio-catch-syscall: Fixing a little bug regarding stale entrybp. X-Git-Refname: refs/heads/archer-sergio-catch-syscall X-Git-Reftype: branch X-Git-Oldrev: 328651b6dc2f7a87319f57db8dfb4ac0860b7144 X-Git-Newrev: f86c10ae2cb1c899883b11e79998e4a275332a2c X-SW-Source: 2009-q1/txt/msg00022.txt.bz2 List-Id: 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 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 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 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.