void generateTrace(PrintWriter writer){
  vm.setDebugTraceMode(debugTraceMode);
  EventThread eventThread=new EventThread(vm,excludes,writer);
  eventThread.setEventRequests(watchFields);
  eventThread.start();
  redirectOutput();
  vm.resume();
  try {
    eventThread.join();
    errThread.join();
    outThread.join();
  }
 catch (  InterruptedException exc) {
  }
  writer.close();
}

void generateTrace ( PrintWriter writer ) { vm . setDebugTraceMode ( debugTraceMode ) ; EventThread eventThread = new EventThread ( vm , excludes , writer ) ; eventThread . setEventRequests ( watchFields ) ; eventThread . start ( ) ; redirectOutput ( ) ; vm . resume ( ) ; try { eventThread . join ( ) ; errThread . join ( ) ; outThread . join ( ) ; } catch ( InterruptedException exc ) { } writer . close ( ) ; }
generate the trace . enable events , start thread to display events , start threads to forward remote error and output streams , resume the remote vm , wait for the final event , and shutdown .
