Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: base/debug/stack_trace_win.cc

Issue 943933005: Add dbghelp.dll that works on XP, and include in base.isolate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/base.isolate ('k') | build/win/dbghelp_xp/README.chromium » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/debug/stack_trace.h" 5 #include "base/debug/stack_trace.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <dbghelp.h> 8 #include <dbghelp.h>
9 9
10 #include <iostream> 10 #include <iostream>
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // ERROR_INVALID_PARAMETER. 145 // ERROR_INVALID_PARAMETER.
146 // When it fails, we should not call debugbreak since it kills the current 146 // When it fails, we should not call debugbreak since it kills the current
147 // process (prevents future tests from running or kills the browser 147 // process (prevents future tests from running or kills the browser
148 // process). 148 // process).
149 DLOG(ERROR) << "SymInitialize failed: " << init_error_; 149 DLOG(ERROR) << "SymInitialize failed: " << init_error_;
150 return; 150 return;
151 } 151 }
152 152
153 init_error_ = ERROR_SUCCESS; 153 init_error_ = ERROR_SUCCESS;
154 154
155 // Work around a mysterious hang on Windows XP.
156 if (base::win::GetVersion() < base::win::VERSION_VISTA)
157 return;
158
159 // When transferring the binaries e.g. between bots, path put 155 // When transferring the binaries e.g. between bots, path put
160 // into the executable will get off. To still retrieve symbols correctly, 156 // into the executable will get off. To still retrieve symbols correctly,
161 // add the directory of the executable to symbol search path. 157 // add the directory of the executable to symbol search path.
162 // All following errors are non-fatal. 158 // All following errors are non-fatal.
163 const size_t kSymbolsArraySize = 1024; 159 const size_t kSymbolsArraySize = 1024;
164 scoped_ptr<wchar_t[]> symbols_path(new wchar_t[kSymbolsArraySize]); 160 scoped_ptr<wchar_t[]> symbols_path(new wchar_t[kSymbolsArraySize]);
165 161
166 // Note: The below function takes buffer size as number of characters, 162 // Note: The below function takes buffer size as number of characters,
167 // not number of bytes! 163 // not number of bytes!
168 if (!SymGetSearchPathW(GetCurrentProcess(), 164 if (!SymGetSearchPathW(GetCurrentProcess(),
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 (*os) << "\t" << trace_[i] << "\n"; 274 (*os) << "\t" << trace_[i] << "\n";
279 } 275 }
280 } else { 276 } else {
281 (*os) << "Backtrace:\n"; 277 (*os) << "Backtrace:\n";
282 context->OutputTraceToStream(trace_, count_, os); 278 context->OutputTraceToStream(trace_, count_, os);
283 } 279 }
284 } 280 }
285 281
286 } // namespace debug 282 } // namespace debug
287 } // namespace base 283 } // namespace base
OLDNEW
« no previous file with comments | « base/base.isolate ('k') | build/win/dbghelp_xp/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698