From b1226959a25b6a5311801d6f204b088c706e7c25 Mon Sep 17 00:00:00 2001 From: Mike Wittman Date: Wed, 29 Nov 2017 13:29:37 -0800 Subject: Add optional field indicating multiple symbols at an address Adds an optional 'm' as the first field in FUNCTION and PUBLIC records to indicate that the address corresponds to more than one symbol. Controls this by a command line flag for now to give symbol file users a chance to update. Also reduces the number of IDiaSymbols retained in memory to one per address. This reduces memory consumption by 8% when processing chrome.dll.pdb. Updates the processor to parse the new optional field. Bug: google-breakpad:751 Change-Id: I6503edaf057312d21a1d63d9c84e5a4fa019dc46 Reviewed-on: https://chromium-review.googlesource.com/773418 Reviewed-by: Mark Mentovai --- src/tools/windows/binaries/dump_syms.exe | Bin 130048 -> 142336 bytes src/tools/windows/binaries/symupload.exe | Bin 195072 -> 243712 bytes src/tools/windows/dump_syms/dump_syms.cc | 17 ++++++++++++++--- .../dump_syms/testdata/dump_syms_regtest64.sym | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) (limited to 'src/tools') diff --git a/src/tools/windows/binaries/dump_syms.exe b/src/tools/windows/binaries/dump_syms.exe index ca4676f5..f27f3ece 100644 Binary files a/src/tools/windows/binaries/dump_syms.exe and b/src/tools/windows/binaries/dump_syms.exe differ diff --git a/src/tools/windows/binaries/symupload.exe b/src/tools/windows/binaries/symupload.exe index ba319b26..cdfee745 100644 Binary files a/src/tools/windows/binaries/symupload.exe and b/src/tools/windows/binaries/symupload.exe differ diff --git a/src/tools/windows/dump_syms/dump_syms.cc b/src/tools/windows/dump_syms/dump_syms.cc index 3e8827b6..dcbe39ae 100644 --- a/src/tools/windows/dump_syms/dump_syms.cc +++ b/src/tools/windows/dump_syms/dump_syms.cc @@ -31,6 +31,7 @@ // a text-based format that we can use from the minidump processor. #include +#include #include @@ -41,12 +42,22 @@ using google_breakpad::PDBSourceLineWriter; int wmain(int argc, wchar_t **argv) { if (argc < 2) { - fprintf(stderr, "Usage: %ws \n", argv[0]); + fprintf(stderr, + "Usage: %ws [--enable_multiple_field] \n", + argv[0]); return 1; } - PDBSourceLineWriter writer; - if (!writer.Open(wstring(argv[1]), PDBSourceLineWriter::ANY_FILE)) { + // This is a temporary option to enable writing the optional 'm' field on FUNC + // and PUBLIC, denoting multiple symbols for the address. This option will be + // removed, with the behavior enabled by default, after all symbol file + // readers have had a chance to update. + bool enable_multiple_field = + (argc >= 3 && wcscmp(L"--enable_multiple_field", argv[1]) == 0); + + PDBSourceLineWriter writer(enable_multiple_field); + if (!writer.Open(wstring(argv[enable_multiple_field ? 2 : 1]), + PDBSourceLineWriter::ANY_FILE)) { fprintf(stderr, "Open failed\n"); return 1; } diff --git a/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym b/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym index a43d3aec..39815245 100644 --- a/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym +++ b/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym @@ -1262,7 +1262,7 @@ FUNC 3320 18 0 NLG_Notify 332a 5 107 69 332f 7 108 69 3336 a 109 69 -FUNC 3340 1 0 _NLG_Dispatch +FUNC 3340 1 0 _NLG_Dispatch2 3340 0 113 69 3340 10 114 69 FUNC 3350 1 0 _NLG_Return2 -- cgit v1.2.1