From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway30.websitewelcome.com (gateway30.websitewelcome.com [192.185.180.41]) by sourceware.org (Postfix) with ESMTPS id 0CCB23857019 for ; Thu, 10 Sep 2020 21:24:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0CCB23857019 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 5A80B9135 for ; Thu, 10 Sep 2020 16:24:42 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id GU3ekQODALFNkGU3ekkguY; Thu, 10 Sep 2020 16:24:42 -0500 X-Authority-Reason: nr=8 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=X+Po1ipAI0i/XeVGX+NbE8ZxGaZ0LIhQ7LM0WeDUx6A=; b=ftxrSmXZuVM9XQmlBSNfNk2nJr bfcwBAdH4HTncb3lo1sDHzQwoeiRZpxcp+15sXIOmtOFxRkJuaiWMPd3536irPDjGTIxHezQUNtO0 NBd5qo5M9eZaGU1ntHWNc0xIU; Received: from 75-166-96-88.hlrn.qwest.net ([75.166.96.88]:38874 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kGU3e-003m15-0g; Thu, 10 Sep 2020 15:24:42 -0600 From: Tom Tromey To: Botond =?utf-8?Q?D=C3=A9nes?= Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFC PATCH v1] Support inspecting green threads References: <20200814152557.2128464-1-bdenes@scylladb.com> <87zh6tez3l.fsf@tromey.com> X-Attribution: Tom Date: Thu, 10 Sep 2020 15:24:40 -0600 In-Reply-To: ("Botond =?utf-8?Q?D=C3=A9nes=22's?= message of "Wed, 19 Aug 2020 15:14:56 +0300") Message-ID: <874ko5gw9z.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (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: 75.166.96.88 X-Source-L: No X-Exim-ID: 1kGU3e-003m15-0g X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-96-88.hlrn.qwest.net (murgatroyd) [75.166.96.88]:38874 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3024.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_ABUSEAT, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP, URIBL_CSS, URIBL_CSS_A autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: Thu, 10 Sep 2020 21:24:45 -0000 Botond> Now I started thinking whether we could extend this support to Botond> stackless fibers. ... Botond> These stackless fibers are made up of continuation objects, which form Botond> an intrusive forward linked-list. Each continuation object is a Botond> callable and a pointer to the next continuation that should be executed Botond> next, with the value computed by this continuation. Botond> These fibers are an absolute pain to debug in gdb. Backtracing of Botond> course just takes you back to the event loop. As the continuations are Botond> classes templated on lambdas, their type name (even if known based on Botond> the vptr of the continuation object) is unreadable. Botond> I'm wondering if we could piece together these continuations into a Botond> pseudo backtrace, making at least lambda captures (those the optimizer Botond> forgot to destroy) inspectable. AFAIK gdb already has a notion of Botond> pseudo frames that it uses to render inline frames into backtraces. Botond> We should of course allow this mode to be disabled because sometimes Botond> you do want to look at the event loop frames. Yeah, this might be somewhat doable today by writing a customer frame filter and some helper code. The idea would be to capture locations as the chain of continuations progresses, then replay these locations in the frame filter. One problem with this sort of approach is that local variables would be unavailable for these saved frames, but that's just generally an issue with continuations I suppose. Tom