Commit 18ddf6f7 authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Fix ShowGlobals to not report on enums

One of our compiler changes means that the Chrome symbols now contains
references to enums as symbols in a way that makes them show up as
duplicated variables in ShowGlobals.exe reports, despite occupying no
space. This change filters out globals that aren't statics, which avoids
this problem.

This change also updates the .vcxproj file to VC++ 2017 and the 17134.0
SDK.

This tool is discussed in the Windows Binary Sizes page:

https://www.chromium.org/developers/windows-binary-sizes

Change-Id: I73a2a7924107b5027bf68a928954e4480e5b5af5
Reviewed-on: https://chromium-review.googlesource.com/1114291
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: default avatarXi Cheng <chengx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570256}
parent c11285b3
...@@ -105,6 +105,17 @@ bool DumpInterestingGlobals(IDiaSymbol* global, const wchar_t* filename) { ...@@ -105,6 +105,17 @@ bool DumpInterestingGlobals(IDiaSymbol* global, const wchar_t* filename) {
for (ULONG celt = 0; for (ULONG celt = 0;
SUCCEEDED(enum_symbols->Next(1, &symbol, &celt)) && (celt == 1); SUCCEEDED(enum_symbols->Next(1, &symbol, &celt)) && (celt == 1);
symbol.Release()) { symbol.Release()) {
DWORD location_type = 0;
// If we can't get the location type then we assume the variable is not of
// interest.
if (FAILED(symbol->get_locationType(&location_type))) {
continue;
}
// Ignore location types that don't actually correspond to statics and
// globals.
if (location_type != LocIsStatic)
continue;
// If we call get_length on symbol it works for functions but not for // If we call get_length on symbol it works for functions but not for
// data. For some reason for data we have to call get_type() to get // data. For some reason for data we have to call get_type() to get
// another IDiaSymbol object which we can query for length. // another IDiaSymbol object which we can query for length.
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment