From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104113 invoked by alias); 23 Apr 2018 09:33:43 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 103581 invoked by uid 89); 23 Apr 2018 09:33:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=coredump X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Apr 2018 09:33:41 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 92AB7EB704; Mon, 23 Apr 2018 09:33:39 +0000 (UTC) Received: from localhost (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F532C1FB2; Mon, 23 Apr 2018 09:33:35 +0000 (UTC) Date: Mon, 23 Apr 2018 09:48:00 -0000 From: Stefan Hajnoczi To: Simon Marchi Cc: Stefan Hajnoczi , Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, gdb@sourceware.org Subject: Re: [Qemu-devel] [PATCH] scripts/qemugdb: support coroutine backtrace in coredumps Message-ID: <20180423093334.GA4892@stefanha-x1.localdomain> References: <20180404103440.19546-1-stefanha@redhat.com> <008ac6e8-1e68-b0f6-7e75-77453721d031@virtuozzo.com> <20180410020823.GB11203@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SW-Source: 2018-04/txt/msg00018.txt.bz2 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1386 On Sun, Apr 22, 2018 at 09:37:52PM -0400, Simon Marchi wrote: > On 2018-04-09 10:08 PM, Stefan Hajnoczi wrote: > > I wonder what the point of select-frame is then... > >=20 > > I have CCed the GDB mailing list. Maybe someone can help us. Context: > >=20 > > QEMU implements coroutines using jmpbuf. We'd like to print coroutine > > call stacks in GDB and have a script that works when a process is being > > debugged (it sets the registers). > >=20 > > Now we'd like to extend the script to work on core dumps where it's not > > possible to set registers (since there is no process being debugged). > >=20 > > Is there a way to backtrace an arbitrary call stack in a core dump? >=20 > Not that I know of. The "frame " form of the frame > command sounds like it should be usable to achieve that, but it doesn't > seem to work in that way. I really wonder if it's working as it was > intended initially. I guess using that form of the frame command should > override/mask the real current values of $sp and $pc? Yes, that is what I was expecting. Vladimir has a script to copy the coredump file and manipulate the registers on disk, but it would be nicer to do stack-switching inside the GDB session without needing to create another coredump file. Vladimir: Would you like to write a GDB patch? If GDB is fixed then workaround won't be necessary. Stefan --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature; name="signature.asc" Content-length: 455 -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJa3ahuAAoJEJykq7OBq3PIuW8H/1yx3zAPxYSQ6//Huef03zxK E5ewTnfJ17XpGtRPnZWycNHLHNpS2vxi8mWG84pDy2xwUldT1x5+6zZclX5F6EoV w+CXdhlRN4UkezHFex2NyxTCscAMkU1TG5kgRni2PYV1LFVfI650+7WsnnaII+DL M0/9q78YGlh3AX+2Pnh+hwpRpTrElIo2cLsR4Mn7hek9zynF2cAb5P4r6iS+AzLG E+fNOyqjcKqOkgJzU650y0xipToNFWHHv4vADeLNm+Ud/EkJlY2aHTj/dCbWYj/d ZQ/Rf26Li0pLJpS/nOhlYd+Z1iBJRnSiqYkqgwKb/SLHBNnabVxKBRXC45TFtdI= =NA7j -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb--