Kernel Enhancements to LLDB/C++ Debugging

The Android 8.0 release includes kernel enhancements that help developers create better applications by improving their debugging experience.

The arm64 Android kernels support setting watchpoints on memory addresses that are not 4/8-byte aligned, and reporting all accesses to those addresses.


The feature runs on any ARM 64-bit device. Adding the relevant support for 32-bit hardware/kernels is optional. All necessary kernel modifications have already been done.

This feature is included in the 4.4 and higher common kernels. To add it to a kernel that does not already include it, cherry pick the necessary CLs into your kernel build. Choose the patchset according to the version your kernel is based on, as the patches required some adjustments due to the kernel codebase evolving over time:

  • branch android-4.4:
  • branch android-4.9:

    This feature implements an extension of the ptrace API to support writing a debugger.


    There is a kernel selftest in the upstream repository, a CTS test, and there are CTS tests added exercising the new kernel API: