Contextual debugging and analysis of multithreaded applications