rebased debug options from Alobbs