From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62977 invoked by alias); 19 Jul 2017 00:42:04 -0000 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 Received: (qmail 62931 invoked by uid 89); 19 Jul 2017 00:42:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*MI:lan, fundamental, Hx-languages-length:1755, atop X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Jul 2017 00:41:59 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 968AAC04B92E for ; Wed, 19 Jul 2017 00:41:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 968AAC04B92E Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kevinb@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 968AAC04B92E Received: from pinnacle.lan (ovpn-116-35.phx2.redhat.com [10.3.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A2B577D59 for ; Wed, 19 Jul 2017 00:41:58 +0000 (UTC) Date: Wed, 19 Jul 2017 00:42:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Subject: [PATCH v3 0/7] Thread handle to thread info mapping Message-ID: <20170718174156.5da204b0@pinnacle.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg00269.txt.bz2 This patch set introduces support for mapping thread handles to the thread_info structs which GDB uses to keep track of threads in the inferiors which it's debugging. I need this in order to find the GDB thread which corresponds to a saved thread handle (e.g. pthread_t) within an implementation of a thread library built atop pthreads. The mechanism is general enough however to support other thread handle representations as well. Simon reviewed the v2 version of these patches and found a number of problems. I believe I have addressed all of these in this new patch set. Pedro noticed a fundamental problem with v2 patch series - the mapping operation did not take into account the inferior! After a fork, the parent and the child will have the same sets of thread handles at the same addresses. These v3 patches also address this problem. Part 1 introduces a target method which maps a thread handle to the corresponding internal GDB thread object, i.e. something of type `struct thread_info *'. An implementation of this new method is provided for the Linux thread target. Additional work will be required, over time, for other thread targets. Part 2 adds a python interface for the mechanism introduced in part 1. Part 3 is a documentation patch. It has been adjusted to address Eli's concerns in an earlier patch series. Simon also proposed some changes which I've incorporated. Part 4 adds a test case. I've incorporated Simon's suggestions from his review of the v2 patchset. Part 5 is a bug fix for a problem discovered while working on part 6. Part 6 adds support for remote targets. Part 7 is a documentation patch for the remote protocol changes that were implemented in part 6.