From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 From: Stefan Hajnoczi To: Pedro Alves Cc: Tom Tromey , gdb@sourceware.org, qemu-devel@nongnu.org, "Dr. David Alan Gilbert" 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-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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 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: , X-List-Received-Date: Tue, 08 Mar 2022 08:43:34 -0000 --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--