From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 3WSwDLLYhGXjJScAWB0awg (envelope-from ) for ; Thu, 21 Dec 2023 19:30:42 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=G7tXJrqB; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 243471E0C3; Thu, 21 Dec 2023 19:30:42 -0500 (EST) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 102B01E0AC for ; Thu, 21 Dec 2023 19:30:40 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5AAC93858402 for ; Fri, 22 Dec 2023 00:30:39 +0000 (GMT) Received: from omta034.useast.a.cloudfilter.net (omta034.useast.a.cloudfilter.net [44.202.169.33]) by sourceware.org (Postfix) with ESMTPS id B06D23858C66 for ; Fri, 22 Dec 2023 00:30:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B06D23858C66 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B06D23858C66 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703205021; cv=none; b=s/L2R1ocBdoUWG4Y+CpfOCd+vAM66G7VbqAXO2uKxlFK9f5sLz0OJYzwOGfFhdafnxIGG3dCFJkG69DHwulwRGaYMwMAM9XxqMX15fkfkUBViJnJceNrJ/d0N80Yw0ADeWEHuXnYLARp/Qby7q+Zw+J2R2VM+EwdHrtFN4yeekw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703205021; c=relaxed/simple; bh=HZyeZZGP4XuLbq/dMMahU5QNsXT5GBKvnK2qFDCJxec=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=rNvwchxuZm5zUFT1p4O4MGX/rMS5mBKeaddhTnFceVU93cGLWPz+3DiNmnCb/2RLnpxyCPJ4YWr0p46R3JJyNyHyYk1sdgfMN8u25Iw5ADdGgNGP7Nm2d66ZHtCcqNKXgFEXujJLVr0zT24bBDiI8xq1VWzrPnqNt5DbARiVkSQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5001a.ext.cloudfilter.net ([10.0.29.139]) by cmsmtp with ESMTPS id GNy0r0PacjtZ3GTQrr2qiE; Fri, 22 Dec 2023 00:30:29 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id GTQfrKgXH3WZAGTQfrMj4j; Fri, 22 Dec 2023 00:30:17 +0000 X-Authority-Analysis: v=2.4 cv=c9W4/Dxl c=1 sm=1 tr=0 ts=6584d899 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=e2cXIFwxEfEA:10 a=Qbun_eYptAEA:10 a=czcGM37D0KunDj0kszQA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9trdbZwTSvlSk45EipqkR1134syGj0kKs8btp6VIuqU=; b=G7tXJrqBjLK4wvwzWaafn4n1Pt oTO94+QsY3iorSHft3kv2xgykQDGF1onRiFN8khhSpdoDeu+eCCoxKcc7azz8mjGdzdvC6ZZApCI6 ibzBR1ndpa1rlQRwx+AdK2sw8; Received: from 71-211-161-25.hlrn.qwest.net ([71.211.161.25]:56954 helo=prentzel) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rGTQf-000uTT-08; Thu, 21 Dec 2023 17:30:17 -0700 From: Tom Tromey To: Andrey Turkin Cc: Tom Tromey , Andrey Turkin via Gdb Subject: Re: "previous frame inner to this frame" error when unwinding fibers References: <874jgp7ksd.fsf@tromey.com> <87plzceio4.fsf@tromey.com> X-Attribution: Tom Date: Thu, 21 Dec 2023 17:30:15 -0700 In-Reply-To: (Andrey Turkin's message of "Wed, 20 Dec 2023 17:18:55 +0300") Message-ID: <87msu3dqp4.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.161.25 X-Source-L: No X-Exim-ID: 1rGTQf-000uTT-08 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-161-25.hlrn.qwest.net (prentzel) [71.211.161.25]:56954 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfMAd5KBKcsOK0gkwb5VKoIlnnt+rcJHtjr/8zfG5fZv0Jyr4sI3pHTKG4c2Jnt1W7zR1p/AKi8gFc5R7Uy++kdFIJ+xZujoTmgHSCXJGEQpS4jcVcZOk JqWT0xJvDzv38IeIAFAEq9lruLrUi+TLANZrbTaO73apve+bnOSLiuiXLVwJHu89WybzjmTZ9kYW6Q== X-Spam-Status: No, score=-3016.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" Andrey> Stackful coroutines I've ever encountered are very close to Andrey> cooperative green threads - minus an underlying scheduler - in their Andrey> implementation (separate stack + ucontext to store ABI-saved Andrey> registers); a mental model is a bit different. I like the idea you Andrey> proposed in that thread, with a caveat that the green threads would be Andrey> more ephemeral. E.g. if I want to see the state of a coroutine, I'd Andrey> spin up a green thread for it, switch to it and do whatever I'd Andrey> usually do with a thread of execution; and then when I'm done I'd Andrey> switch over to another thread and wind the green thread down so it is Andrey> no more (or maybe I'd cache those threads and destroy them in bulk Andrey> upon debuggee resume). As long as there is a Python API to manage them Andrey> and as long as their model is similar enough to the OS threads' API, Andrey> I'm sure we'd be able to code whatever solution suits one's specific Andrey> needs. Yeah, the API on the branch is very simple. You can create a GreenThread object, and this object supplies a few details: basically registers and the thread name. There's a way to indicate that the thread has exited as well. (I didn't get around to implementing a way for 'bt' in a green thread to know when it should terminate.) So, things like "frame view" could be rewritten in these terms, with the idea being that the new green thread would simply be marked as exited when the user switched away from it. Coroutines could do the same, I think. Tom