Re: How to backtrace an separate stack?
Stefan Hajnoczi <[email protected]>
| Newsgroups | gmane.comp.emulators.qemu,gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Mar 07, 2022 at 05:18:12PM +0000, Pedro Alves wrote: > On 2022-03-07 16:58, Tom Tromey wrote: > >>>>>> "Stefan" == Stefan Hajnoczi <[email protected]> writes: > > > > Stefan> I hoped that "select-frame address ADDRESS" could be used instead so > > Stefan> this would work on coredumps too. Unfortunately "select-frame" only > > Stefan> searches stack frames that GDB is already aware of, so it cannot be used > > Stefan> to backtrace coroutine stacks. > > > > I wonder if "select-frame view" is closer to what you want. > > > > I can't attest to how well it works or doesn't work. I've never tried > > it. > > 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 internally, > 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
signature.asc
(application/pgp-signature, 488 B)
-----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-----