Opening ARMv7 vmcores with LLDB

From: Stephane Rochoy <stephane.rochoy_at_stormshield.eu>
Date: Wed, 05 Jul 2023 12:57:26 UTC
Hi Hackers,

I struggle with lldb to open vmcores written by a 13.1 arm.armv7
kernel.

I'm using LLDB 16.0.6 (from devel/llvm16) as follow:

    $ uname -a
    FreeBSD sns-debug-armv7.jail.… 13.2-STABLE FreeBSD 
    14.0-CURRENT
        #14 …-n258033-20b8fbf116f7: …/arm64.aarch64/sys/AMPERE arm
    $ sysctl hw.machine_arch
    hw.machine_arch: armv7
    $ file vmcore.last kernel
    vmcore.last: FreeBSD kernel minidump for arm, little endian,
        version 2
    kernel:      ELF 32-bit LSB executable, ARM, EABI5 version 1
        (FreeBSD), dynamically linked, interpreter /red/herring,
        BuildID[sha1]=b3d5fba55e096b9675ec3e374f73faa4c5c8df02,
        for FreeBSD 13.1, not stripped
    $ lldb16 -c vmcore.last kernel
    (lldb) target create "kernel" --core "vmcore.last"
    Core file '/home/stephaner/t/vmcore.last' (arm) was loaded.
    (lldb) bt
    error: Command requires a process which is currently stopped.
    (lldb)

The previous commands are run from a jail built with 
freebsd-ci[1]:

    OSRELEASE=13.2-STABLE-02a7d117b5914dd8c42b8d98fe92faca381148bd
    TARGET=arm
    TARGET_ARCH=armv7

Despite looking at Moritz Systems'[2] blog regarding their (great)
work I'm unable to tell if ARMv7 is supposed to be supported. The
patches seems to be only about arm64, i386 and x86_64. (AFAIK
their work landed somewhere in LLVM 15, that's why I'm using 16.)

Any hint would be greatly appreciated :)

[1] https://github.com/freebsd/freebsd-ci.git
[2] https://www.moritz.systems/tags/lldb/

Regards,
--
Stéphane Rochoy
O: Stormshield