* [RFA/RFC] Prec multi-thread support [3/4] thread.c
@ 2009-11-25 8:06 Hui Zhu
2009-11-25 20:10 ` Michael Snyder
0 siblings, 1 reply; 3+ messages in thread
From: Hui Zhu @ 2009-11-25 8:06 UTC (permalink / raw)
To: gdb-patches ml; +Cc: Michael Snyder
[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]
1. Move thread_state to gdbthread.h because record target need get the
status of each thread. Sometime, GDB will not remove the thread entry
when it exit.
2. record_is_waiting is to flag that mean this thread is still
running. I will introduce in next mail.
2009-11-25 Hui Zhu <teawater@gmail.com>
gdbthread.h (thread_state): New enum.
(thread_info): Add record_is_waiting.
thread.c (thread_state): Deleted.
---
gdbthread.h | 11 +++++++++++
thread.c | 9 ---------
2 files changed, 11 insertions(+), 9 deletions(-)
--- a/gdbthread.h
+++ b/gdbthread.h
@@ -29,6 +29,15 @@ struct symtab;
#include "ui-out.h"
#include "inferior.h"
+/* Frontend view of the thread state. Possible extensions: stepping,
+ finishing, until(ling),... */
+enum thread_state
+{
+ THREAD_STOPPED,
+ THREAD_RUNNING,
+ THREAD_EXITED,
+};
+
struct thread_info
{
struct thread_info *next;
@@ -37,6 +46,8 @@ struct thread_info
kernel thread id, etc. */
int num; /* Convenient handle (GDB thread id) */
+ int record_is_waiting;
+
/* Non-zero means the thread is executing. Note: this is different
from saying that there is an active target and we are stopped at
a breakpoint, for instance. This is a real indicator whether the
--- a/thread.c
+++ b/thread.c
@@ -63,15 +63,6 @@ static void thread_apply_command (char *
static void restore_current_thread (ptid_t);
static void prune_threads (void);
-/* Frontend view of the thread state. Possible extensions: stepping,
- finishing, until(ling),... */
-enum thread_state
-{
- THREAD_STOPPED,
- THREAD_RUNNING,
- THREAD_EXITED,
-};
-
struct thread_info*
inferior_thread (void)
{
[-- Attachment #2: prec-thread-c.txt --]
[-- Type: text/plain, Size: 1258 bytes --]
---
gdbthread.h | 11 +++++++++++
thread.c | 9 ---------
2 files changed, 11 insertions(+), 9 deletions(-)
--- a/gdbthread.h
+++ b/gdbthread.h
@@ -29,6 +29,15 @@ struct symtab;
#include "ui-out.h"
#include "inferior.h"
+/* Frontend view of the thread state. Possible extensions: stepping,
+ finishing, until(ling),... */
+enum thread_state
+{
+ THREAD_STOPPED,
+ THREAD_RUNNING,
+ THREAD_EXITED,
+};
+
struct thread_info
{
struct thread_info *next;
@@ -37,6 +46,8 @@ struct thread_info
kernel thread id, etc. */
int num; /* Convenient handle (GDB thread id) */
+ int record_is_waiting;
+
/* Non-zero means the thread is executing. Note: this is different
from saying that there is an active target and we are stopped at
a breakpoint, for instance. This is a real indicator whether the
--- a/thread.c
+++ b/thread.c
@@ -63,15 +63,6 @@ static void thread_apply_command (char *
static void restore_current_thread (ptid_t);
static void prune_threads (void);
-/* Frontend view of the thread state. Possible extensions: stepping,
- finishing, until(ling),... */
-enum thread_state
-{
- THREAD_STOPPED,
- THREAD_RUNNING,
- THREAD_EXITED,
-};
-
struct thread_info*
inferior_thread (void)
{
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA/RFC] Prec multi-thread support [3/4] thread.c
2009-11-25 8:06 [RFA/RFC] Prec multi-thread support [3/4] thread.c Hui Zhu
@ 2009-11-25 20:10 ` Michael Snyder
2009-11-26 6:46 ` Hui Zhu
0 siblings, 1 reply; 3+ messages in thread
From: Michael Snyder @ 2009-11-25 20:10 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches ml
This one's OK. In fact, congratulations for keeping this part
of your change so neat and concise! ;-)
Hui Zhu wrote:
> 1. Move thread_state to gdbthread.h because record target need get the
> status of each thread. Sometime, GDB will not remove the thread entry
> when it exit.
> 2. record_is_waiting is to flag that mean this thread is still
> running. I will introduce in next mail.
>
> 2009-11-25 Hui Zhu <teawater@gmail.com>
>
> gdbthread.h (thread_state): New enum.
> (thread_info): Add record_is_waiting.
> thread.c (thread_state): Deleted.
>
> ---
> gdbthread.h | 11 +++++++++++
> thread.c | 9 ---------
> 2 files changed, 11 insertions(+), 9 deletions(-)
>
> --- a/gdbthread.h
> +++ b/gdbthread.h
> @@ -29,6 +29,15 @@ struct symtab;
> #include "ui-out.h"
> #include "inferior.h"
>
> +/* Frontend view of the thread state. Possible extensions: stepping,
> + finishing, until(ling),... */
> +enum thread_state
> +{
> + THREAD_STOPPED,
> + THREAD_RUNNING,
> + THREAD_EXITED,
> +};
> +
> struct thread_info
> {
> struct thread_info *next;
> @@ -37,6 +46,8 @@ struct thread_info
> kernel thread id, etc. */
> int num; /* Convenient handle (GDB thread id) */
>
> + int record_is_waiting;
> +
> /* Non-zero means the thread is executing. Note: this is different
> from saying that there is an active target and we are stopped at
> a breakpoint, for instance. This is a real indicator whether the
> --- a/thread.c
> +++ b/thread.c
> @@ -63,15 +63,6 @@ static void thread_apply_command (char *
> static void restore_current_thread (ptid_t);
> static void prune_threads (void);
>
> -/* Frontend view of the thread state. Possible extensions: stepping,
> - finishing, until(ling),... */
> -enum thread_state
> -{
> - THREAD_STOPPED,
> - THREAD_RUNNING,
> - THREAD_EXITED,
> -};
> -
> struct thread_info*
> inferior_thread (void)
> {
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA/RFC] Prec multi-thread support [3/4] thread.c
2009-11-25 20:10 ` Michael Snyder
@ 2009-11-26 6:46 ` Hui Zhu
0 siblings, 0 replies; 3+ messages in thread
From: Hui Zhu @ 2009-11-26 6:46 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches ml
Thanks.
Hui
On Thu, Nov 26, 2009 at 04:05, Michael Snyder <msnyder@vmware.com> wrote:
> This one's OK. In fact, congratulations for keeping this part
> of your change so neat and concise! ;-)
>
> Hui Zhu wrote:
>>
>> 1. Move thread_state to gdbthread.h because record target need get the
>> status of each thread. Sometime, GDB will not remove the thread entry
>> when it exit.
>> 2. record_is_waiting is to flag that mean this thread is still
>> running. I will introduce in next mail.
>>
>> 2009-11-25 Hui Zhu <teawater@gmail.com>
>>
>> gdbthread.h (thread_state): New enum.
>> (thread_info): Add record_is_waiting.
>> thread.c (thread_state): Deleted.
>>
>> ---
>> gdbthread.h | 11 +++++++++++
>> thread.c | 9 ---------
>> 2 files changed, 11 insertions(+), 9 deletions(-)
>>
>> --- a/gdbthread.h
>> +++ b/gdbthread.h
>> @@ -29,6 +29,15 @@ struct symtab;
>> #include "ui-out.h"
>> #include "inferior.h"
>>
>> +/* Frontend view of the thread state. Possible extensions: stepping,
>> + finishing, until(ling),... */
>> +enum thread_state
>> +{
>> + THREAD_STOPPED,
>> + THREAD_RUNNING,
>> + THREAD_EXITED,
>> +};
>> +
>> struct thread_info
>> {
>> struct thread_info *next;
>> @@ -37,6 +46,8 @@ struct thread_info
>> kernel thread id, etc. */
>> int num; /* Convenient handle (GDB thread id) */
>>
>> + int record_is_waiting;
>> +
>> /* Non-zero means the thread is executing. Note: this is different
>> from saying that there is an active target and we are stopped at
>> a breakpoint, for instance. This is a real indicator whether the
>> --- a/thread.c
>> +++ b/thread.c
>> @@ -63,15 +63,6 @@ static void thread_apply_command (char *
>> static void restore_current_thread (ptid_t);
>> static void prune_threads (void);
>>
>> -/* Frontend view of the thread state. Possible extensions: stepping,
>> - finishing, until(ling),... */
>> -enum thread_state
>> -{
>> - THREAD_STOPPED,
>> - THREAD_RUNNING,
>> - THREAD_EXITED,
>> -};
>> -
>> struct thread_info*
>> inferior_thread (void)
>> {
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-26 6:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-25 8:06 [RFA/RFC] Prec multi-thread support [3/4] thread.c Hui Zhu
2009-11-25 20:10 ` Michael Snyder
2009-11-26 6:46 ` Hui Zhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox