[OBV] Remove any_running

Message ID 1403157035-13558-1-git-send-email-yao@codesourcery.com
State Committed
Headers

Commit Message

Yao Qi June 19, 2014, 5:50 a.m. UTC
  Function any_running isn't used.  This patch is to remove it.
Rebuild GDB for linux and mingw.

gdb:

2014-06-19  Yao Qi  <yao@codesourcery.com>

	* gdbthread.h (any_running): Remove the declaration.
	* thread.c (any_running): Remove.
---
 gdb/gdbthread.h |  3 ---
 gdb/thread.c    | 12 ------------
 2 files changed, 15 deletions(-)
  

Comments

Doug Evans July 10, 2014, 6:18 p.m. UTC | #1
On Wed, Jun 18, 2014 at 10:50 PM, Yao Qi <yao@codesourcery.com> wrote:
> Function any_running isn't used.  This patch is to remove it.
> Rebuild GDB for linux and mingw.
>
> gdb:
>
> 2014-06-19  Yao Qi  <yao@codesourcery.com>
>
>         * gdbthread.h (any_running): Remove the declaration.
>         * thread.c (any_running): Remove.

Hi.
As it turns out I need this in a patch so I've recommitted it.

2014-07-10  Doug Evans  <dje@google.com>

        * gdbthread.h (any_running): Declare.
        * thread.c (any_running): New function.
  
Tom Tromey July 10, 2014, 7:14 p.m. UTC | #2
>>>>> "Doug" == Doug Evans <dje@google.com> writes:

Doug> On Wed, Jun 18, 2014 at 10:50 PM, Yao Qi <yao@codesourcery.com> wrote:
>> Function any_running isn't used.  This patch is to remove it.
>> Rebuild GDB for linux and mingw.
>> 
>> gdb:
>> 
>> 2014-06-19  Yao Qi  <yao@codesourcery.com>
>> 
>> * gdbthread.h (any_running): Remove the declaration.
>> * thread.c (any_running): Remove.

Doug> Hi.
Doug> As it turns out I need this in a patch so I've recommitted it.

I think it's better to wait until the using patch is posted.
If something happens in the meantime, there is dead code again.
It should be no trouble to make the resurrection part of your series.

Tom
  
Doug Evans July 10, 2014, 7:21 p.m. UTC | #3
On Thu, Jul 10, 2014 at 12:14 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> On Wed, Jun 18, 2014 at 10:50 PM, Yao Qi <yao@codesourcery.com> wrote:
>>> Function any_running isn't used.  This patch is to remove it.
>>> Rebuild GDB for linux and mingw.
>>>
>>> gdb:
>>>
>>> 2014-06-19  Yao Qi  <yao@codesourcery.com>
>>>
>>> * gdbthread.h (any_running): Remove the declaration.
>>> * thread.c (any_running): Remove.
>
> Doug> Hi.
> Doug> As it turns out I need this in a patch so I've recommitted it.
>
> I think it's better to wait until the using patch is posted.
> If something happens in the meantime, there is dead code again.
> It should be no trouble to make the resurrection part of your series.

It was posted.  Three months ago.  1/2 :-)
Apologies for not marking this as 1/2 - I was about to check in 2/2 ...
[See, the community really is pedantic about its attention to rules.]
Otherwise, I wouldn't have checked this in ...

No worries. Patch reverted.
  
Tom Tromey July 10, 2014, 7:35 p.m. UTC | #4
>>>>> "Doug" == Doug Evans <dje@google.com> writes:

Doug> [See, the community really is pedantic about its attention to rules.]

I am not "the community", I'm a person.  Please address me as such.

I'm not sure what to say about this other than there is no rule here, I
am expressing my opinion.  You may consider it pedantic, but I on the
other hand consider it just common sense not to push in code without a
use.

Doug> Otherwise, I wouldn't have checked this in ...

Doug> No worries. Patch reverted.

All you had to do was mention the patch.  It was not mentioned in your
email, and I think it's unreasonably to expect that I, or anyone, would
remember some other series from 3 months ago.

Tom
  
Doug Evans July 14, 2014, 7 p.m. UTC | #5
On Thu, Jul 10, 2014 at 12:35 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> [See, the community really is pedantic about its attention to rules.]
>
> I am not "the community", I'm a person.  Please address me as such.

As you wish.

> I'm not sure what to say about this other than there is no rule here, I
> am expressing my opinion.  You may consider it pedantic, but I on the
> other hand consider it just common sense not to push in code without a
> use.
>
> Doug> Otherwise, I wouldn't have checked this in ...
>
> Doug> No worries. Patch reverted.
>
> All you had to do was mention the patch.  It was not mentioned in your
> email, and I think it's unreasonably to expect that I, or anyone, would
> remember some other series from 3 months ago.

It seemed obvious (common sensical (sp?) :-)) that I wouldn't be
committing the patch if there wasn't another patch about to be
committed that depended on it.
Noted for next time.
  

Patch

diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 1f10469..689fe9e 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -361,9 +361,6 @@  extern int is_exited (ptid_t ptid);
 /* In the frontend's perpective, is this thread stopped?  */
 extern int is_stopped (ptid_t ptid);
 
-/* In the frontend's perpective is there any thread running?  */
-extern int any_running (void);
-
 /* Marks thread PTID as executing, or not.  If ptid_get_pid (PTID) is -1,
    marks all threads.
 
diff --git a/gdb/thread.c b/gdb/thread.c
index 7bc5271..0c40b80 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -648,18 +648,6 @@  is_running (ptid_t ptid)
 }
 
 int
-any_running (void)
-{
-  struct thread_info *tp;
-
-  for (tp = thread_list; tp; tp = tp->next)
-    if (tp->state == THREAD_RUNNING)
-      return 1;
-
-  return 0;
-}
-
-int
 is_executing (ptid_t ptid)
 {
   struct thread_info *tp;