| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |