From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 9L1uIJaPXWLgBAAAWB0awg (envelope-from ) for ; Mon, 18 Apr 2022 12:19:34 -0400 Received: by simark.ca (Postfix, from userid 112) id 7429D1F327; Mon, 18 Apr 2022 12:19:34 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_DYNAMIC autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id DBDE61E150 for ; Mon, 18 Apr 2022 12:19:33 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0B22A3858434 for ; Mon, 18 Apr 2022 16:19:33 +0000 (GMT) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by sourceware.org (Postfix) with ESMTPS id 62DF33858D1E for ; Mon, 18 Apr 2022 16:19:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 62DF33858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f44.google.com with SMTP id m14so19105310wrb.6 for ; Mon, 18 Apr 2022 09:19:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=QZzYPtXRtthlJVY71KdYl5aFWkjBfZhJKdUqn39N1z0=; b=bK5Y99SixQYhC69hS507EJkyOp2RAX8zBd6YgECtbEaAuc9tTqKNXKWFrNWPXDBiNf L0bSU+QgF/uKuXhLniiuG7Zt7uCeW7tg2Y+bZxY+bi6CSn2HL+BbEB8+ze70w7ZfodN2 xNqXCMPUJkqabMjwv7IfbDum0kOYL//wCzl0RrwvzHz/KdWjegeTt6flbYpAV2vgwR8I cKN/nSwEJeNKJiy7fKv1XgSgrFEYMem6W8zOrcQyQHWWUJ0RGJfYRnJRt1A4wHkEY8hB El7zCA8NBuYPbfUeEHJe6UZykPGWwaqw/UkFVBEutPUsIwf3mkLVHIl7bGYLYmXCwUjK ROHQ== X-Gm-Message-State: AOAM5300vqWorGsryZfwjaCHp/pCrciZXCWCfwmPaHtPAWVmPETeceY/ UU2K4KtUirUQ8dFnFqLlBIbSwf7csLw= X-Google-Smtp-Source: ABdhPJwEDCy2b4ajVet815HDAKRzcQzj0Thmix44MlhgzviO6kQYesmyPEcguPSZh+UvnC6xzLdDZQ== X-Received: by 2002:a5d:6e84:0:b0:206:147b:1f59 with SMTP id k4-20020a5d6e84000000b00206147b1f59mr8805559wrz.86.1650298760336; Mon, 18 Apr 2022 09:19:20 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id k63-20020a1ca142000000b0038ff2c38e85sm13652222wme.39.2022.04.18.09.19.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Apr 2022 09:19:19 -0700 (PDT) Message-ID: Date: Mon, 18 Apr 2022 17:19:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v2] gdb/Python: Added ThreadExitedEvent Content-Language: en-US To: Simon Farre , gdb-patches@sourceware.org References: <20220412090315.1142824-1-simon.farre.cx@gmail.com> From: Pedro Alves In-Reply-To: <20220412090315.1142824-1-simon.farre.cx@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2022-04-12 10:03, Simon Farre via Gdb-patches wrote: > > +@item events.thread_exited > +This is emitted when @value{GDBN} notices a thread has exited. The event > +is of type @code{gdb.ThreadExitedEvent}. This has three attributes: > + > +@defvar ThreadExitedEvent.num > +Global thread number. > +@end defvar > + > +@defvar ThreadExitedEvent.lwp > +The light weight process ID. > +@end defvar > + > +@defvar ThreadExitedEvent.tid > +The thread's thread id > +@end defvar Do other thread events have these same attributes? It seems odd to print lwp and tid, but not pid. But why not a ptid object instead? InferiorThread has: ~~~ Variable: InferiorThread.ptid ID of the thread, as assigned by the operating system. This attribute is a tuple containing three integers. The first is the Process ID (PID); the second is the Lightweight Process ID (LWPID), and the third is the Thread ID (TID). Either the LWPID or TID may be 0, which indicates that the operating system does not use that identifier. ~~~ And other events use it too, like: ~~~ Variable: InferiorCallPreEvent.ptid The thread in which the call will be run. gdb.InferiorCallPostEvent Indicates that a function in the inferior has just been called. Variable: InferiorCallPostEvent.ptid ~~~ I think not using ptid requires a strong justification. But I also think that it might be useful to contrast the attributes included in the Python event to what MI events include.