From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id TY1rN1UXJ2IeLQAAWB0awg (envelope-from ) for ; Tue, 08 Mar 2022 03:44:05 -0500 Received: by simark.ca (Postfix, from userid 112) id D056D1F3CA; Tue, 8 Mar 2022 03:44:05 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED 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 73D441EE1F for ; Tue, 8 Mar 2022 03:43:59 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DEA5F385AC2C for ; Tue, 8 Mar 2022 08:43:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEA5F385AC2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1646729038; bh=9pMEs9bhfOd0hv6hK29dSqTLjMnxYvHSjfJOhP2PNWQ=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=NkUulGDO1lMbviIxqmIqm1dOblJQVhAti+qYigzt+mqhLX3qkZxa2sSGPlOIHqguH X7LnYriN3/jlhJdyOCI20kgjXVIULCeI+/2dQwDpOOaFi6FHvxCnWcXDFnrftj8HPM fwisTA6ZRfRNTfrFkZYjynEhTN2y4FdkJWg48b50= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id E4787385843A for ; Tue, 8 Mar 2022 08:43:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E4787385843A Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-664-mvtIS3jZNkerj-SwVPiy_w-1; Tue, 08 Mar 2022 03:43:31 -0500 X-MC-Unique: mvtIS3jZNkerj-SwVPiy_w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 20913100CAB5; Tue, 8 Mar 2022 08:43:30 +0000 (UTC) Received: from localhost (unknown [10.39.193.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id 500DE83179; Tue, 8 Mar 2022 08:43:28 +0000 (UTC) Date: Tue, 8 Mar 2022 08:43:27 +0000 To: Pedro Alves Subject: Re: How to backtrace an separate stack? Message-ID: References: <87mti11yy9.fsf@tromey.com> <950cc915-d5dd-dbcb-67a2-9186792af8fe@palves.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uTkEYmDFFC4ApIEb" Content-Disposition: inline In-Reply-To: <950cc915-d5dd-dbcb-67a2-9186792af8fe@palves.net> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Stefan Hajnoczi via Gdb Reply-To: Stefan Hajnoczi Cc: gdb@sourceware.org, Tom Tromey , qemu-devel@nongnu.org, "Dr. David Alan Gilbert" Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" --uTkEYmDFFC4ApIEb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 07, 2022 at 05:18:12PM +0000, Pedro Alves wrote: > On 2022-03-07 16:58, Tom Tromey wrote: > >>>>>> "Stefan" =3D=3D Stefan Hajnoczi writes: > >=20 > > Stefan> I hoped that "select-frame address ADDRESS" could be used inste= ad so > > Stefan> this would work on coredumps too. Unfortunately "select-frame" = only > > Stefan> searches stack frames that GDB is already aware of, so it canno= t be used > > Stefan> to backtrace coroutine stacks. > >=20 > > I wonder if "select-frame view" is closer to what you want. > >=20 > > I can't attest to how well it works or doesn't work. I've never tried > > it. >=20 > A backtrace after "select-frame view" will still start at the > current (machine register's) frame. Maybe it's sufficient to emulate it = with > a sequence of "up" + "frame", though. Keep in mind that you'll lose the = view > with "info threads" or any command that flushes the frame cache internall= y, > as I mentioned in that ancient discussion. I tried the following with gdb (11.2-1.fc35): select-frame view STACK_ADDR PC frame <-- this displays the top coroutine stack frame up frame <-- this displays the secondmost main stack frame Unfortunately "up" returns to the main stack instead of unwinding the coroutine stack. "i r" and "i lo" still show values from the main stack frame after "select-frame view". This makes sense since "select-frame view" only sets the stack and PC addresses, not the register contents. Alas, "select-frame view" isn't quite enough from what I can tell. Stefan --uTkEYmDFFC4ApIEb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmInFy4ACgkQnKSrs4Gr c8hyxAf9F93RMB1uyXqvrE84in0Tiv6n+5PBbg55/VEg3JLQt2gEzNcAD/3mZIsr rPr6tz8AH2ufHoDVdC+D2kaTue4XM51Jd8oxUt/8GO6ZIvrIXk6TlH7UgeJmVfXq TLpV0qvjL5tW3jGrtXh1pmXJlfwxAVUXQTYnvdBtKlf3kxibYM+R0y0dXkFFVXzx E3elSCADaatju9orpPbwlULmewZ4ixTkqhzICyhgY4w0mFLK2MBMK9JvAXVctPOr v5ba8nx1FxBsSpv41F+pPwdOT3JKpj/wZBVakk0LGyzLuEGRz744AfZUxt2PUA6b Sxy8rL8cZ+cMejK3/7VOaplYU/zN2Q== =SjF7 -----END PGP SIGNATURE----- --uTkEYmDFFC4ApIEb--