Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Pedro Alves <palves@redhat.com>, <gdb-patches@sourceware.org>
Cc: <bug-hurd@gnu.org>
Subject: Re: [PATCH 2/4] Push pruning old threads down to the target
Date: Fri, 09 Dec 2016 06:38:00 -0000	[thread overview]
Message-ID: <87k2b9ip4p.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <1412266896-28210-3-git-send-email-palves@redhat.com>

Hi!

On Thu,  2 Oct 2014 17:21:34 +0100, Pedro Alves <palves@redhat.com> wrote:
> When GDB wants to sync the thread list with the target's [...]

> --- a/gdb/thread.c
> +++ b/gdb/thread.c

>  void
>  update_thread_list (void)
>  {
> -  prune_threads ();
> -  target_find_new_threads ();
> +  target_update_thread_list ();
>    update_threads_executing ();
>  }

Pushed to master:

commit c752a4cccb99ba73f51eff74b394dcdcd26d4c59
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Wed May 25 18:54:40 2016 +0200

    Hurd: Adjust to changes to "push pruning old threads down to the target"
    
    For "info threads", we currently run into:
    
        $ gdb/gdb -q -nw -nx --batch -ex start -ex info\ threads bfd/doc/chew
        Temporary breakpoint 1 at 0x80486e0: file ../../../W._C._Handy/bfd/doc/chew.c, line 1535.
        [New Thread 10656.5]
    
        Thread 4 hit Temporary breakpoint 1, main (ac=1, av=0x102cd84) at ../../../W._C._Handy/bfd/doc/chew.c:1535
        1535    {
          Id   Target Id         Frame
          1    bogus thread id 1 Can't fetch registers from thread bogus thread id 1: No such thread
    
    Before commit e8032dde10b743253125d7defb5f5503b21c1d26,
    gdb/thread.c:update_thread_list used to call prune_threads, after that change
    it doesn't anymore, and we don't implement the to_update_thread_list target
    method where the prune_threads call got moved.  For now, apply a fix, related
    to commit c82f56d9d760a9b4034eeaac44f2f0fa5779ff69 "Hurd: Adjust to
    startup-with-shell changes", which restores the previous behavior:
    
          Id   Target Id         Frame
        * 4    Thread 10688.4    main (ac=1, av=0x102cd84) at ../../../W._C._Handy/bfd/doc/chew.c:1535
          5    Thread 10688.5    0x0106096c in ?? () from /lib/i386-gnu/libc.so.0.3
    
    Not perfect, but at least better.
    
            gdb/
            * gnu-nat.c (gnu_create_inferior): After startup_inferior, call
            prune_threads.
---
 gdb/ChangeLog | 3 +++
 gdb/gnu-nat.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git gdb/ChangeLog gdb/ChangeLog
index 302eb6e..7fd5d32 100644
--- gdb/ChangeLog
+++ gdb/ChangeLog
@@ -1,5 +1,8 @@
 2016-12-09  Thomas Schwinge  <thomas@codesourcery.com>
 
+	* gnu-nat.c (gnu_create_inferior): After startup_inferior, call
+	prune_threads.
+
 	* inferior.c (print_selected_inferior): Avoid PATH_MAX usage.
 
 2016-12-08  Simon Marchi  <simon.marchi@ericsson.com>
diff --git gdb/gnu-nat.c gdb/gnu-nat.c
index 124574e..85a53b8 100644
--- gdb/gnu-nat.c
+++ gdb/gnu-nat.c
@@ -2163,6 +2163,8 @@ gnu_create_inferior (struct target_ops *ops,
 
   startup_inferior (START_INFERIOR_TRAPS_EXPECTED);
   inf->pending_execs = 0;
+  /* Get rid of the old shell threads.  */
+  prune_threads ();
 
   inf_validate_procinfo (inf);
   inf_update_signal_thread (inf);


Grüße
 Thomas


  reply	other threads:[~2016-12-09  6:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02 16:21 [PATCH 0/4] remote thread listing: get rid of unnecessary "thread alive?" traffic Pedro Alves
2014-10-02 16:21 ` [PATCH 1/4] Merge remote thread listing methods Pedro Alves
2014-10-17  8:57   ` Jiong Wang
2014-10-17 10:17     ` [PATCH] Fix build without libexpat (Re: [PATCH 1/4] Merge remote thread listing methods) Pedro Alves
2014-10-17 10:21       ` Jiong Wang
2014-10-02 16:21 ` [PATCH 3/4] remote: get rid of all the T packets when synching the thread list Pedro Alves
2014-10-02 16:21 ` [PATCH 2/4] Push pruning old threads down to the target Pedro Alves
2016-12-09  6:38   ` Thomas Schwinge [this message]
2014-10-02 16:21 ` [PATCH 4/4] DEC threads: Simplify updating the thread list Pedro Alves
2014-10-02 18:46   ` Mark Kettenis
2014-10-03  9:12     ` Pedro Alves
2014-10-15 22:01 ` [pushed] Re: [PATCH 0/4] remote thread listing: get rid of unnecessary "thread alive?" traffic Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k2b9ip4p.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=bug-hurd@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox