0

I need to debug android kernel goldfish under MacOS Mojave.

So i cloned android-goldfish-3.18 and android-aosp-9.0.0_r22.

I built aosp under macos while the kernel under debian.

Obviously I built the kernel with debugging symbols and other flags adapt to debug.

Test 1: Running the kernel inside AOSP emulator.

launch emulator:

emulator -selinux permissive -kernel ../../goldfish/arch/x86_64/boot/bzImage -show-kernel -verbose -qemu -monitor unix:/tmp/qemuSocket,server,nowait -s -append nokaslr

launch gdb ( version 8.2.1 installed with brew ):

gdb  vmlinux

gdb with breakpoints never hitted

Test 2: Running the kernel inside sdk emulator with android-9 device.

launch emulator:

emulator -selinux permissive -avd test7 -kernel ../../goldfish_paolo/arch/x86_64/boot/bzImage  -show-kernel -verbose -qemu -monitor unix:/tmp/qemuSocket,server,nowait -s -append nokaslr

launch gdb ( version 8.2.1 installed with brew ):

gdb vmlinux

gdb inserted breakpoint => cannot insert hardware breakpoint

With test2 the emulator crashes here the error:

Operating system: Mac OS X
                  10.14.2 18C54
CPU: amd64
     family 6 model 158 stepping 10
     12 CPUs

Crash reason:  EXC_BAD_ACCESS / KERN_INVALID_ADDRESS
Crash address: 0x0
Process uptime: 41 seconds

Thread 6 (crashed)
 0  qemu-system-x86_64 + 0x10f0542
    rax = 0x0000000000000000   rdx = 0x0000000000000000
    rcx = 0x0000700008c920ac   rbx = 0x0000000107564ea0
    rsi = 0x0000000105c93fa0   rdi = 0x0000000000000030
    rbp = 0x0000700008c8e040   rsp = 0x0000700008c8e020
     r8 = 0x0000700008c8d888    r9 = 0x0000700008c8db00
    r10 = 0x0000700008c920ac   r11 = 0x0000000000000206
    r12 = 0x0000000105c97857   r13 = 0x0000000000000000
    r14 = 0x0000700008c8e070   r15 = 0x0000700008c8e070
    rip = 0x000000010564e542
    Found by: given as instruction pointer in context

Had anyone got some of this problems?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.