From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50700 invoked by alias); 22 Mar 2017 15:37:25 -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 50677 invoked by uid 89); 22 Mar 2017 15:37:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.8 required=5.0 tests=BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=undertake, Freddie, freddie, providers X-HELO: mail-wm0-f52.google.com Received: from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com) (74.125.82.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Mar 2017 15:37:24 +0000 Received: by mail-wm0-f52.google.com with SMTP id u132so40351627wmg.0 for ; Wed, 22 Mar 2017 08:37:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :mime-version:in-reply-to:content-transfer-encoding; bh=fj3vauPGr+gmu64DulHgo65uROt6EJWmaTG/N5VDXTM=; b=V2Y9GaqcoE691nr26Ca7rutOmOqsppwJP3RNx9El8oW9na5uqHa7GSJK7D84EcnaZ5 lcbfmPIzBo7cTZRxABh4HSOuvRLgxCTOMC1NDjAO/u9NNPVXenpB+Fs34A77oTmw3OlF GrafJOeoyYfbyytGcLck65kZUycmRg41Se99m0p9ehw9XKg54tHHNc8BAn2om2SOFBxx JbWuTPLMRHDVRopM3kEPzK85WwARaibG5E6HWPwsTY60hS8gu0qGN8KoGlpiNXYksa0R wjmtLmjIG3vAh1MehCldMBFsf52XOH/GivICC7NX6rPbm6LTqbySrTBqTZkta2+/Z+Fx 926Q== X-Gm-Message-State: AFeK/H0wCSv2EbbOG2RAcxRWXO2twB+iCf2KB5REa0mAs2XNIWw4DluFGNR6EvMsTB2O+gTt X-Received: by 10.28.141.201 with SMTP id p192mr8957103wmd.66.1490197043003; Wed, 22 Mar 2017 08:37:23 -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 o2sm705646wmb.28.2017.03.22.08.37.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 08:37:22 -0700 (PDT) From: Phil Muldoon Subject: Re: Python API for supplying thread information? To: Freddie Chopin References: <1490175792.1242.7.camel@op.pl> Cc: gdb@sourceware.org, openocd-devel@lists.sourceforge.net Message-ID: <4b310e40-3f39-feed-6134-d2cfe68c4423@redhat.com> Date: Wed, 22 Mar 2017 15:37: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/msg00041.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 ). (Resending to include correct CC's/To's) 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