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

Side by Side Diff: tools/win/static_initializers/static_initializers.cc

Issue 2656223002: Update static_initializers tool to build easier, find more (Closed)
Patch Set: Add +x attribute to build.bat Created 3 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 | « tools/win/static_initializers/build.bat ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <dia2.h> 5 #include <dia2.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 7
8 #include <string> 8 #include <string>
9 9
10 // Create an IDiaData source and open a PDB file. 10 // Create an IDiaData source and open a PDB file.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 DWORD symtag; 91 DWORD symtag;
92 92
93 if (FAILED(symbol->get_symTag(&symtag))) 93 if (FAILED(symbol->get_symTag(&symtag)))
94 return; 94 return;
95 95
96 if (symtag != SymTagFunction && symtag != SymTagBlock) 96 if (symtag != SymTagFunction && symtag != SymTagBlock)
97 return; 97 return;
98 98
99 BSTR bstr_name; 99 BSTR bstr_name;
100 if (SUCCEEDED(symbol->get_name(&bstr_name))) { 100 if (SUCCEEDED(symbol->get_name(&bstr_name))) {
101 if (wcsstr(bstr_name, L"`dynamic initializer for '")) { 101 if (wcsstr(bstr_name, L"`dynamic initializer for '") ||
102 wcsstr(bstr_name, L"`dynamic atexit destructor for '")) {
102 wprintf(L"%s: %s\n", module.c_str(), bstr_name); 103 wprintf(L"%s: %s\n", module.c_str(), bstr_name);
103 SysFreeString(bstr_name); 104 SysFreeString(bstr_name);
104 } 105 }
105 } 106 }
106 } 107 }
107 108
108 static bool DumpStaticInitializers(IDiaSymbol* global_symbol) { 109 static bool DumpStaticInitializers(IDiaSymbol* global_symbol) {
109 // Retrieve the compilands first. 110 // Retrieve the compilands first.
110 IDiaEnumSymbols* enum_symbols; 111 IDiaEnumSymbols* enum_symbols;
111 if (FAILED(global_symbol->findChildren( 112 if (FAILED(global_symbol->findChildren(
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 170
170 wprintf(L"Static initializers in %s:\n", argv[1]); 171 wprintf(L"Static initializers in %s:\n", argv[1]);
171 172
172 if (!DumpStaticInitializers(global_symbol)) 173 if (!DumpStaticInitializers(global_symbol))
173 return 1; 174 return 1;
174 175
175 Cleanup(global_symbol, dia_session); 176 Cleanup(global_symbol, dia_session);
176 177
177 return 0; 178 return 0;
178 } 179 }
OLDNEW
« no previous file with comments | « tools/win/static_initializers/build.bat ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698