From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116461 invoked by alias); 16 Aug 2017 16:25:48 -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 116437 invoked by uid 89); 16 Aug 2017 16:25:46 -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=his 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, 16 Aug 2017 16:25:44 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB1D912B2E for ; Wed, 16 Aug 2017 16:25:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AB1D912B2E Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kevinb@redhat.com Received: from pinnacle.lan (ovpn-117-126.phx2.redhat.com [10.3.117.126]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 831A76062A for ; Wed, 16 Aug 2017 16:25:43 +0000 (UTC) Date: Wed, 16 Aug 2017 16:25:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Subject: [PATCH v4 0/7] Thread handle to thread info mapping Message-ID: <20170816092542.6d2deb00@pinnacle.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00316.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 non-documentation parts of the v3 version of this patch set. I think I have addressed all of his concerns from that review. Eli approved the two documentation patches. There have been no changes from v3 to v4, but I'm including them here for completeness. 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. Part 2 adds a python interface for the mechanism introduced in part 1. Part 3 is a documentation patch. As noted above, Eli has already approved this patch which is unchanged from the v3 patch set. Part 4 adds a test case. I've incorporated all of Simon's suggestions from his review of the v3 patch. I've also added three new tests which check the behavior of thread_from_thread_handle when passing a bad thread handle. After making this change, I found a problem in part 6. Part 5 is a bug fix for a problem discovered while working on part 6. Part 6 adds support for remote targets. In addition to making several v3 changes requested by Simon, I adjusted remote_thread_handle_to_thread_info so that would throw an exception (via a call to error()) when the handle sizes are mismatched. Part 7 is a documentation patch for the remote protocol changes that were implemented in part 6. This patch is unchanged from the v3 version and has already been approved by Eli. Kevin