From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27130 invoked by alias); 22 Mar 2017 15:32:04 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 26468 invoked by uid 89); 22 Mar 2017 15:32:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=BAYES_40,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=undertake, Freddie, freddie, providers X-HELO: mail-wm0-f50.google.com Received: from mail-wm0-f50.google.com (HELO mail-wm0-f50.google.com) (74.125.82.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Mar 2017 15:32:02 +0000 Received: by mail-wm0-f50.google.com with SMTP id n11so40014618wma.1 for ; Wed, 22 Mar 2017 08:32:02 -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 :mime-version:in-reply-to:content-transfer-encoding; bh=Ov2ONHrsUeaj7TFkt6sUXr4/R7MmsjMy/i8PthOJVMI=; b=JmMdjbq/5UihlOJ0rWc9HnpcNSbsgEojY7BpFolt4ZpDXxO5LgLqckYHhE6fnRzwTO oz1tiqpKuhYxqKM65KvwX27WrnMpVwVFm6UszsvJsWYUSfIqLPb2lSYkqr/IqvFTZvXc /1wC5ofWhpoTz/bfsMK26xME1ho0MFLJAZ3z9il9ikxBFaafd83PegMMlKzOiRrLV5Y1 RaZKdEaQveGHtu0oBSW6Y8wljljGsW6hJSp/SskzVUTcY4ydbPShWuI8d90Au5iGiX7e 50cA4IBM0LgrtBiWOmoNpwI4rT2/I454Mr2uSl75kOm2q5w840026osuVhOM4kVKEuh4 eezA== X-Gm-Message-State: AFeK/H2w8x0y+zYVL3sgIgXpfdzGIludPBMK5mEOVdi2Fu3dxk+er6N3J5dxVagJXhVsr1Y/ X-Received: by 10.28.92.212 with SMTP id q203mr8256095wmb.73.1490196720923; Wed, 22 Mar 2017 08:32:00 -0700 (PDT) Received: from ?IPv6:2a02:c7f:ae15:7800:4685:ff:fe66:9f4? ([2a02:c7f:ae15:7800:4685:ff:fe66:9f4]) by smtp.gmail.com with ESMTPSA id 60sm2210475wrg.60.2017.03.22.08.31.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 08:32:00 -0700 (PDT) Subject: Re: Python API for supplying thread information? To: gdb@sourceware.org References: <1490175792.1242.7.camel@op.pl> From: Phil Muldoon Message-ID: Date: Wed, 22 Mar 2017 15:32:00 -0000 MIME-Version: 1.0 In-Reply-To: <1490175792.1242.7.camel@op.pl> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00040.txt.bz2 On 22/03/17 09:43, Freddie Chopin wrote: > Hello! > > The idea I'm asking about is related to the Pretty Printing API in > Python, which allows one to extend behaviour of GDB completely on > "client side" - there's absolutely no need to modify any component of > the toolchain to print your own types in any way you like. > > It would be really great if something like this existed for _supplying_ > thread information to GDB. I'm not talking about the Python API to > _query_ GDB about threads. > ( https://sourceware.org/gdb/onlinedocs/gdb/Threads-In-Python.html ). Is it possible? Sure. But without looking at it in any real depth it would be a major undertaking. GDB does not have the concept of "Providers", it assembles state from many different sources: kernel, glibc, libthread_db etc. This state is internally structured and relevant to GDB and is not really structured to receive arbitrary input from an API at the moment. It could, but I think it would require major surgery. Currently the Scripting API is almost entirely focused with providing information and not really designed to take information. You have information providers APIs and data decorators APIs. My advice would be to undertake a study to estimate the work needed. Cheers Phil