From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4312 invoked by alias); 26 Nov 2009 06:46:38 -0000 Received: (qmail 4303 invoked by uid 22791); 26 Nov 2009 06:46:37 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pz0-f189.google.com (HELO mail-pz0-f189.google.com) (209.85.222.189) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Nov 2009 06:46:30 +0000 Received: by pzk27 with SMTP id 27so341275pzk.12 for ; Wed, 25 Nov 2009 22:46:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.143.21.36 with SMTP id y36mr1024412wfi.211.1259217989206; Wed, 25 Nov 2009 22:46:29 -0800 (PST) In-Reply-To: <4B0D8E26.9050701@vmware.com> References: <4B0D8E26.9050701@vmware.com> From: Hui Zhu Date: Thu, 26 Nov 2009 06:46:00 -0000 Message-ID: Subject: Re: [RFA/RFC] Prec multi-thread support [3/4] thread.c To: Michael Snyder Cc: gdb-patches ml Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2009-11/txt/msg00567.txt.bz2 Thanks. Hui On Thu, Nov 26, 2009 at 04:05, Michael Snyder wrote: > This one's OK. =A0In fact, congratulations for keeping this part > of your change so neat and concise! =A0 ;-) > > Hui Zhu wrote: >> >> 1. Move thread_state to gdbthread.h because record target need get the >> status of each thread. =A0Sometime, GDB will not remove the thread entry >> when it exit. >> 2. record_is_waiting is to flag that mean this thread is still >> running. =A0I will introduce in next mail. >> >> 2009-11-25 =A0Hui Zhu =A0 >> >> =A0 =A0 =A0 =A0gdbthread.h (thread_state): New enum. >> =A0 =A0 =A0 =A0(thread_info): Add record_is_waiting. >> =A0 =A0 =A0 =A0thread.c (thread_state): Deleted. >> >> --- >> =A0gdbthread.h | =A0 11 +++++++++++ >> =A0thread.c =A0 =A0| =A0 =A09 --------- >> =A02 files changed, 11 insertions(+), 9 deletions(-) >> >> --- a/gdbthread.h >> +++ b/gdbthread.h >> @@ -29,6 +29,15 @@ struct symtab; >> =A0#include "ui-out.h" >> =A0#include "inferior.h" >> >> +/* Frontend view of the thread state. =A0Possible extensions: stepping, >> + =A0 finishing, until(ling),... =A0*/ >> +enum thread_state >> +{ >> + =A0THREAD_STOPPED, >> + =A0THREAD_RUNNING, >> + =A0THREAD_EXITED, >> +}; >> + >> =A0struct thread_info >> =A0{ >> =A0 struct thread_info *next; >> @@ -37,6 +46,8 @@ struct thread_info >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0k= ernel thread id, etc. =A0*/ >> =A0 int num; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Convenient handl= e (GDB thread id) */ >> >> + =A0int record_is_waiting; >> + >> =A0 /* Non-zero means the thread is executing. =A0Note: this is different >> =A0 =A0 =A0from saying that there is an active target and we are stopped= at >> =A0 =A0 =A0a breakpoint, for instance. =A0This is a real indicator wheth= er the >> --- a/thread.c >> +++ b/thread.c >> @@ -63,15 +63,6 @@ static void thread_apply_command (char * >> =A0static void restore_current_thread (ptid_t); >> =A0static void prune_threads (void); >> >> -/* Frontend view of the thread state. =A0Possible extensions: stepping, >> - =A0 finishing, until(ling),... =A0*/ >> -enum thread_state >> -{ >> - =A0THREAD_STOPPED, >> - =A0THREAD_RUNNING, >> - =A0THREAD_EXITED, >> -}; >> - >> =A0struct thread_info* >> =A0inferior_thread (void) >> =A0{ > >