>>>>> "Stefan" == Stefan Hajnoczi <stefa...@redhat.com> 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. Stefan> Is there a way to backtrace a stack at an arbitrary address in GDB? IMO this is just a longstanding hole in GDB. Green threads exist, so it would be good for GDB to have a way to inspect them. For Ada, this problem was solved by adding knowledge of the runtime to GDB itself -- that's basically what the "ravenscar" stuff is about. Not necessarily an approach I'd recommend. I think the main problem with adding green thread support is just finding someone to do the work. Personally I think a decent approach would be to add some core code to handle this, and then expose some necessary bits via the Python API, so that user programs like qemu could ship Python code that would replicate the ideas in the ravenscar layer -- grovelling around in the inferior data structures to find info about the thread. Note that some of the GDB work might be complicated. For ravenscar, there's still an AdaCore-local patch (sent to gdb-patches but not really suitable for inclusion) to avoid problems with "random thread switches" -- there were problems where the current thread would, from GDB's perspective, unexpectedly change when single-stepping through the green scheduler. Tom