[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to debug AArch64 QEMU in AArch32 mode?

From: Peter Maydell
Subject: Re: How to debug AArch64 QEMU in AArch32 mode?
Date: Sat, 4 Jul 2020 15:01:29 +0100

On Sat, 4 Jul 2020 at 14:18, Sergey Anufrienko
<sergey.anoufrienko@gmail.com> wrote:
> I am writing an AArch64 hypervisor running in AArch64 EL2, which
> switches to AArch32 EL1 to run a 32-bit VM. Right now I'm able to only
> debug AArch64 code up to the point where "eret" instruction is
> executed to switch to AArch32. Setting a breakpoint to the AArch32
> entrypoint also doesn't work. I tried GDB multiarch and to switch
> architecture at runtime from aarch64 to armv7, but it complains about
> incompatible data structures.
> Right now the only working way to see what's happening in the 32-bit
> EL1 is to use "-d in_asm,cpu", which will correctly display 32-bit ARM
> code after the "eret" has been executed.
> So the question Is there any way to debug the AArch32 code running in
> qemu-system-aarch64?

You've found the main thing, which is the debug logging. You're
correct that QEMU's gdbstub for qemu-system-aarch64 is aarch64
only and cannot handle the case when the code switches to aarch32.
This was traditionally because gdb itself did not have any
support for that kind of mode-switching. I believe that there
is now at least in principle some support for that in gdb
(not sure whether as framework only or with specifically handling
for aarch32-aarch64 transitions) but in any case QEMU would
need to implement its end of it, and nobody has done that

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]