diff options
author | ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-11-23 14:50:55 +0000 |
---|---|---|
committer | ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-11-23 14:50:55 +0000 |
commit | 873064894b391181b8e7afb503ffc65b6b28a423 (patch) | |
tree | 3d533f38f254b8d8c6cbb4ee1ba82ae569c41ba8 /src/common/windows/pdb_source_line_writer.cc | |
parent | output function names for PGO-optimized cold function blocks. r=mark at http:... (diff) | |
download | breakpad-873064894b391181b8e7afb503ffc65b6b28a423.tar.xz |
don't output duplicate filenames in PDBSourceLineWriter. r=mark at http://breakpad.appspot.com/43001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@431 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/windows/pdb_source_line_writer.cc')
-rw-r--r-- | src/common/windows/pdb_source_line_writer.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/common/windows/pdb_source_line_writer.cc b/src/common/windows/pdb_source_line_writer.cc index 9525efe2..9cd0d2e3 100644 --- a/src/common/windows/pdb_source_line_writer.cc +++ b/src/common/windows/pdb_source_line_writer.cc @@ -118,11 +118,13 @@ bool PDBSourceLineWriter::PrintLines(IDiaEnumLineNumbers *lines) { return false; } - DWORD source_id; - if (FAILED(line->get_sourceFileId(&source_id))) { + DWORD dia_source_id; + if (FAILED(line->get_sourceFileId(&dia_source_id))) { fprintf(stderr, "failed to get line source file id\n"); return false; } + // duplicate file names are coalesced to share one ID + DWORD source_id = GetRealFileID(dia_source_id); DWORD line_num; if (FAILED(line->get_lineNumber(&line_num))) { @@ -216,7 +218,16 @@ bool PDBSourceLineWriter::PrintSourceFiles() { return false; } - fwprintf(output_, L"FILE %d %s\n", file_id, file_name); + wstring file_name_string(file_name); + if (!FileIDIsCached(file_name_string)) { + // this is a new file name, cache it and output a FILE line. + CacheFileID(file_name_string, file_id); + fwprintf(output_, L"FILE %d %s\n", file_id, file_name); + } else { + // this file name has already been seen, just save this + // ID for later lookup. + StoreDuplicateFileID(file_name_string, file_id); + } file.Release(); } compiland.Release(); |