The effectiveness of debugging software issues depends largely on the capabilities of the tools available to aid in such task. To debug the macOS kernel there is at present no real alternative other than the basic debugger integrated in the kernel itself, intended to be used remotely from another machine through a full-fledged debugger like LLDB. Due to design constraints and implementative choices, this approach has however several drawbacks, such as the necessity of modifying the system configuration, or the impossibility to set hardware breakpoints or to pause the execution of kernel from the debugger. The aim of this work was improving the overall debugging experience for the macOS kernel. To this end we developed LLDBagility, a tool to enable kernel debugging via virtual machine introspection. LLDBagility connects LLDB to any unmodified macOS virtual machine running on a patched version of the VirtualBox hypervisor, allowing the debugger to fully control the machine without the system being aware of the process. This solution have made possible to overcome all limitations of the classic kernel debugging approach, and also to implement new useful features like the ability to save and eventually restore the state of the machine directly from the debugger.

LLDBagility: practical macOS kernel debugging

Cagnin, Francesco
2020/2021

Abstract

The effectiveness of debugging software issues depends largely on the capabilities of the tools available to aid in such task. To debug the macOS kernel there is at present no real alternative other than the basic debugger integrated in the kernel itself, intended to be used remotely from another machine through a full-fledged debugger like LLDB. Due to design constraints and implementative choices, this approach has however several drawbacks, such as the necessity of modifying the system configuration, or the impossibility to set hardware breakpoints or to pause the execution of kernel from the debugger. The aim of this work was improving the overall debugging experience for the macOS kernel. To this end we developed LLDBagility, a tool to enable kernel debugging via virtual machine introspection. LLDBagility connects LLDB to any unmodified macOS virtual machine running on a patched version of the VirtualBox hypervisor, allowing the debugger to fully control the machine without the system being aware of the process. This solution have made possible to overcome all limitations of the classic kernel debugging approach, and also to implement new useful features like the ability to save and eventually restore the state of the machine directly from the debugger.
2020-03-13
File in questo prodotto:
File Dimensione Formato  
840157-1203121.pdf

accesso aperto

Tipologia: Altro materiale allegato
Dimensione 858.57 kB
Formato Adobe PDF
858.57 kB Adobe PDF Visualizza/Apri

I documenti in UNITESI sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/20.500.14247/4493