From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by sourceware.org (Postfix) with ESMTPS id 462BA3858D28 for ; Mon, 18 Apr 2022 10:30:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 462BA3858D28 Received: by mail-lj1-x230.google.com with SMTP id h11so16333893ljb.2 for ; Mon, 18 Apr 2022 03:30:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1cUjPqVOOAn2Dm08pJa6U66LXL8NVhRhLKk84qMKmAc=; b=0IIIoQkAyMZ9tDGMxvynfBqvUMuIegiDRvG4feT7/QU4Vc8Ud++kEp6eYgW1NmUtdV +AYFR7dG5XzGwLmoFX6exANqAaEKCZ2p0TP06xA9/+Jq8VPHW60Jif76Lt4elXu7SDU9 0ftVUxR6zBkGfDaPcCLUvhIVyAWSA+F2uy8HIUaSWVAPzQhbIz3KKzbeJ5Qv7YzMD/Iz vR3phOsmynCgXF4aQwIdsuh7kVvoxt9FXAQs+qX4cysuQCIRjGftnpXMtaZSQpWjdW/x fNv4dhXkqoTVGH46p7Wl9tQOTKiINy6H6z1z7xUkgvpwOY1Z+EuSoXTJ7ngdMQ9PxYsZ q/rg== X-Gm-Message-State: AOAM531P7aUdaiQ2tJv+xOhHUKN01uoPk5AcYGiKyCn2Gk5Yz3/2eb4/ Poxez7JKMW/GFBMVzfIXrt/QT9wqqlikJJbbpHPm4FawoPBZAg== X-Google-Smtp-Source: ABdhPJw4AzmLY70TbvYT5yMHog5fBcIsawxRMrqE9tPOZyZnDXEpa0rMRzdWGMh+j92gmdum5kX64zZlIGjplLvlPiQ= X-Received: by 2002:a2e:a7c1:0:b0:24b:63a5:2fc1 with SMTP id x1-20020a2ea7c1000000b0024b63a52fc1mr6959565ljp.13.1650277833927; Mon, 18 Apr 2022 03:30:33 -0700 (PDT) MIME-Version: 1.0 References: <20220412090315.1142824-1-simon.farre.cx@gmail.com> <87bkx2z0e6.fsf@tromey.com> In-Reply-To: <87bkx2z0e6.fsf@tromey.com> From: Simon Farre Date: Mon, 18 Apr 2022 12:30:22 +0200 Message-ID: Subject: Re: [PATCH v2] gdb/Python: Added ThreadExitedEvent To: Tom Tromey Cc: Simon Farre via Gdb-patches X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: , X-List-Received-Date: Mon, 18 Apr 2022 10:30:36 -0000 Tom> Space before open paren here. I'll go over and fix white spacing and formatting in the next patch version (finally getting the hang of it more or less). Tom> I'm curious why the event has various attributes of the thread object Tom> but not a reference to the thread object itself. That seems a little Tom> odd. So my reasoning for this was; since the thread is exiting it is dying, and from a Python perspective I thought it proper not to hold on to any resources that GDB otherwise would dispose of. I'm open to suggestions for whether or not this logic is sound. So if we are to return the thread object itself, I would probably have to change the function from where the event is emitted, or perhaps some other change. It's currently emitted inside `delete_thread_object` which is a function that is attached to the observer `gdb::observers::thread_exit` in py-inferior.c. So if we are to return a reference to the thread object, the function attached here should probably be removed entirely and replaced with just emitting the newly introduced "thread exit event" (and handle the de-allocation of the thread object inside the thread exit event type tp_dealloc function). Thanks for taking your time to review! Simon F.