Event-driven debugging for distributed software