Add support for selective handling of VM traps.