From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99418 invoked by alias); 21 Mar 2019 04:32:54 -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 99405 invoked by uid 89); 21 Mar 2019 04:32:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1591 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; Thu, 21 Mar 2019 04:32:52 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 275D08535D for ; Thu, 21 Mar 2019 04:32:51 +0000 (UTC) Received: from f29-4.lan (ovpn-117-184.phx2.redhat.com [10.3.117.184]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 06ADE5D6A6 for ; Thu, 21 Mar 2019 04:32:50 +0000 (UTC) Date: Thu, 21 Mar 2019 04:32:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Subject: [PATCH v3 0/6] Add python method gdb.InferiorThread.handle Message-ID: <20190320213250.718c4c19@f29-4.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-03/txt/msg00448.txt.bz2 This six part series adds a python method named "handle" which is used to obtain the thread handle from a thread object. It will eventually be used as part of the implementation of the "thread parent" operation for the OpenMP work that I've been doing. While thread handles are normally opaque, for my OpenMP work, it's become necessary to convert a handle to a form upon which arithmetic may be performed. Via some simple arithmetic manipulations, it's possible to find the handle associated with a GOMP thread. If you want details on this, see: https://www.sourceware.org/ml/gdb-patches/2018-09/msg00719.html This is version 3 of a series that I first posted in Sept, 2018. In v1, InferiorThread.thread_handle was passed a type and returned a gdb.Value object representing the handle (of the type passed in). In v2, InferiorThread.thread_handle is a nullary method. It returns the thread handle represented as a Python bytes object. If it's necessary to pierce the opacity of this object, as it is for my use case, the two argument form of the gdb.Value constructor may be used to make an object of some suitable type. In v3, this version, the name has been changed to "handle" instead of "thread_handle" at the suggestion of Tom Tromey. I've also fixed a few other small problems identified by Tom. Also, in order to stay consistent with the new naming, "thread_from_thread_handle", an existing python method, has been renamed to "thread_from_handle". The old name may still be used, but is considered deprecated. Kevin