From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3631 invoked by alias); 15 May 2008 19:06:02 -0000 Received: (qmail 3605 invoked by uid 22791); 15 May 2008 19:05:54 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 15 May 2008 19:05:36 +0000 Received: (qmail 12161 invoked from network); 15 May 2008 19:05:32 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 15 May 2008 19:05:32 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Remove trap_ptid Date: Thu, 15 May 2008 19:40:00 -0000 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_JmILIa5JUMsQXXn" Message-Id: <200805152005.45028.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00481.txt.bz2 --Boundary-00=_JmILIa5JUMsQXXn Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 360 Any objection to garbage collecting this? This stopped being needed with the switch to generic_prepare_to_proceed (nowadays prepare_to_proceed in infrun.c) a few years ago. Tested on x86_64-unknown-linux-gnu, just in case. I'm leaving the debug output that used it in place, in case someone would miss it; just say so, and I'll zap it too. -- Pedro Alves --Boundary-00=_JmILIa5JUMsQXXn Content-Type: text/x-diff; charset="utf-8"; name="trap_ptid.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="trap_ptid.diff" Content-length: 2725 2008-05-15 Pedro Alves * linux-nat.c (trap_ptid): Delete. (linux_nat_detach, linux_nat_wait, linux_nat_mourn_inferior) (thread_db_wait): Adjust. --- gdb/linux-nat.c | 16 ++-------------- gdb/linux-thread-db.c | 5 ----- 2 files changed, 2 insertions(+), 19 deletions(-) Index: src/gdb/linux-nat.c =================================================================== --- src.orig/gdb/linux-nat.c 2008-05-15 17:54:26.000000000 +0100 +++ src/gdb/linux-nat.c 2008-05-15 17:55:45.000000000 +0100 @@ -790,11 +790,6 @@ struct lwp_info *lwp_list; static int num_lwps; -/* If the last reported event was a SIGTRAP, this variable is set to - the process id of the LWP/thread that got it. */ -ptid_t trap_ptid; - - /* Since we cannot wait (in linux_nat_wait) for the initial process and any cloned processes with a single call to waitpid, we have to use the WNOHANG flag and call waitpid in a loop. To optimize @@ -1404,8 +1399,6 @@ linux_nat_detach (char *args, int from_t target_pid_to_str (lwp_list->ptid)); } - trap_ptid = null_ptid; - /* Destroy LWP info; it's no longer valid. */ init_lwp_list (); @@ -2777,14 +2770,11 @@ retry: if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP) { - trap_ptid = lp->ptid; if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, - "LLW: trap_ptid is %s.\n", - target_pid_to_str (trap_ptid)); + "LLW: trap ptid is %s.\n", + target_pid_to_str (lp->ptid)); } - else - trap_ptid = null_ptid; if (lp->waitstatus.kind != TARGET_WAITKIND_IGNORE) { @@ -2916,8 +2906,6 @@ linux_nat_kill (void) static void linux_nat_mourn_inferior (void) { - trap_ptid = null_ptid; - /* Destroy LWP info; it's no longer valid. */ init_lwp_list (); Index: src/gdb/linux-thread-db.c =================================================================== --- src.orig/gdb/linux-thread-db.c 2008-05-15 17:54:23.000000000 +0100 +++ src/gdb/linux-thread-db.c 2008-05-15 17:55:58.000000000 +0100 @@ -823,8 +823,6 @@ check_event (ptid_t ptid) static ptid_t thread_db_wait (ptid_t ptid, struct target_waitstatus *ourstatus) { - extern ptid_t trap_ptid; - ptid = target_beneath->to_wait (ptid, ourstatus); if (ourstatus->kind == TARGET_WAITKIND_IGNORE) @@ -861,9 +859,6 @@ thread_db_wait (ptid_t ptid, struct targ event gets postponed by other simultaneous events. In such a case, we want to just ignore the event and continue on. */ - if (!ptid_equal (trap_ptid, null_ptid)) - trap_ptid = thread_from_lwp (trap_ptid); - ptid = thread_from_lwp (ptid); if (GET_PID (ptid) == -1) ourstatus->kind = TARGET_WAITKIND_SPURIOUS; --Boundary-00=_JmILIa5JUMsQXXn--