From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by sourceware.org (Postfix) with ESMTP id D6AF53939C09 for ; Thu, 18 Jun 2020 22:30:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D6AF53939C09 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-499-GgbeH3P_PeiXgTJ3WPcoaQ-1; Thu, 18 Jun 2020 18:30:16 -0400 X-MC-Unique: GgbeH3P_PeiXgTJ3WPcoaQ-1 Received: by mail-wr1-f72.google.com with SMTP id f5so3368260wrv.22 for ; Thu, 18 Jun 2020 15:30:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Fm9rCMDXrWPvhM26brB8fl6lgJqDkvjIQOzm60PkWio=; b=QKda6LI5xa0c6f9q6ytfkxuvlFjSI17V0M4MwhCFmiN1xuo5jrYaiQJTOcki6rps5X N27UnR1xGKivnZo7T3TxRBVjVA2iVaf/FTAkCUPQEV1LQ0B3VYvnzqplacGXmV2ARjgW oV7rCaZ+PzzvdneJq/UVNU8NjasjddMudXmH5Nb+6lHgmsiMWr8v+dttVxSfGKKqjoMi 4hBaAGruzr56qXijNJmP19WmY/Wq9eizhfLP4c8pJEeinKKegDlvRhxLIWvvfZQazumR 55uIVp40Xr9rDEOFqOyEhG6MxBWZqy0W3gAfwxb1L1RuP3Ltp2W+G3uKIMtNPAlI36Wj /jCA== X-Gm-Message-State: AOAM530a8WMJ+OOi2b2SoW2MnKoZCWErzI25SUNTpokovGALvN4P/fZg ZhCByd64m6odRJnHEk+lQ6s2oPEUCMEQbTEDAs0S13tQ9EV0iQrZ5M2wNsCH0lvDYRQPMh03zXI qKCSaEvLDyT7UqFU7EsSUcw== X-Received: by 2002:a1c:7f87:: with SMTP id a129mr552284wmd.10.1592519415448; Thu, 18 Jun 2020 15:30:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxE2u+hFc7YFGUaYYOWeMxjYGyKItMKttKKaiaNM/trd9X6s9UR/Cbuq2wl8ZDmacnbx+pc5g== X-Received: by 2002:a1c:7f87:: with SMTP id a129mr552270wmd.10.1592519415252; Thu, 18 Jun 2020 15:30:15 -0700 (PDT) Received: from ?IPv6:2001:8a0:f922:c400:d9b9:b3d0:d289:9385? ([2001:8a0:f922:c400:d9b9:b3d0:d289:9385]) by smtp.gmail.com with ESMTPSA id u12sm5198638wrq.90.2020.06.18.15.30.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jun 2020 15:30:14 -0700 (PDT) Subject: Re: [PATCH 00/28] Decouple inferior_ptid/inferior_thread(); dup ptids in thread list (PR/25412) To: gdb-patches@sourceware.org References: <20200414175434.8047-1-palves@redhat.com> From: Pedro Alves Message-ID: <4a20aa0b-13ed-d3fc-3e2c-965e0a95a19b@redhat.com> Date: Thu, 18 Jun 2020 23:30:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20200414175434.8047-1-palves@redhat.com> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 22:30:19 -0000 On 4/14/20 6:54 PM, Pedro Alves via Gdb-patches wrote: > In PR/25412, Simon noticed that after the multi-target series, the > tid-reuse.exp testcase manages to create a duplicate thread in the > thread list. Or rather, two threads with the same PTID. > > This in turn exposes a design problem in GDB. The inferior_thread() > function looks up the current thread based on inferior_ptid: > ... > This series fixes this by making the current thread be a global > thread_info pointer that is written to directly by switch_to_thread, > etc., and making inferior_thread() return that pointer, instead of > having inferior_thread() lookup up the inferior_ptid thread, by > ptid_t. You can look at this as a continuation of the effort of using > more thread_info pointers instead of ptids when possible. I've pushed this now. Thanks, Pedro Alves