import runner

PLUGIN = {
    "name": "address-space-observer",
    "version": "1.0",
}

def on_exclave_entry(vcpu):
    rc, space = runner.cl4_current_exclave(vcpu)
    if rc != 0:
        return

    runner.log(
        f"{space['address_space']} "
        f"pc={space['entry']:#x} "
        f"ttbr0={space['ttbr0']:#x}\n"
    )
