Updates to tracer to log events.

The tracer can now generates traces for ddms or output to a logfile.
Also includes bugfixes to allow stack walking to work properly when
tracing.

Change-Id: I8894272d9a678eeb1d376734f7822daf2ab298e4
diff --git a/src/thread.h b/src/thread.h
index d24ddca..c5fb914 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -472,6 +472,10 @@
     return trace_stack_->empty();
   }
 
+  TraceStackFrame GetTraceStackFrame(uint32_t depth) const {
+    return trace_stack_->at(trace_stack_->size() - depth - 1);
+  }
+
   void PushTraceStackFrame(const TraceStackFrame& frame) {
     trace_stack_->push_back(frame);
   }