summaryrefslogtreecommitdiffstats
path: root/base/debug
diff options
context:
space:
mode:
Diffstat (limited to 'base/debug')
-rw-r--r--base/debug/trace_event_win.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/base/debug/trace_event_win.cc b/base/debug/trace_event_win.cc
index d5a21f4..686ade3 100644
--- a/base/debug/trace_event_win.cc
+++ b/base/debug/trace_event_win.cc
@@ -78,14 +78,17 @@ void TraceEventETWProvider::TraceEvent(const char* name,
event.SetField(1, sizeof(id), &id);
event.SetField(2, extra_len + 1, extra);
- // See whether we're to capture a backtrace.
+ // These variables are declared here so that they are not out of scope when
+ // the event is logged.
+ DWORD depth;
void* backtrace[32];
+
+ // See whether we're to capture a backtrace.
if (enable_flags() & CAPTURE_STACK_TRACE) {
- DWORD hash = 0;
- DWORD depth = CaptureStackBackTrace(0,
- arraysize(backtrace),
- backtrace,
- &hash);
+ depth = CaptureStackBackTrace(0,
+ arraysize(backtrace),
+ backtrace,
+ NULL);
event.SetField(3, sizeof(depth), &depth);
event.SetField(4, sizeof(backtrace[0]) * depth, backtrace);
}