aboutsummaryrefslogtreecommitdiff
path: root/src/common/windows/pdb_source_line_writer.h
diff options
context:
space:
mode:
authorMike Wittman <wittman@chromium.org>2017-11-29 13:29:37 -0800
committerMark Mentovai <mark@chromium.org>2017-11-29 21:33:23 +0000
commitb1226959a25b6a5311801d6f204b088c706e7c25 (patch)
tree3dfc65dab8bb0dcd929748873de179ce259030f5 /src/common/windows/pdb_source_line_writer.h
parentUpdate test data for identical-code-folded symbol changes (diff)
downloadbreakpad-b1226959a25b6a5311801d6f204b088c706e7c25.tar.xz
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 <mark@chromium.org>
Diffstat (limited to 'src/common/windows/pdb_source_line_writer.h')
-rw-r--r--src/common/windows/pdb_source_line_writer.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/common/windows/pdb_source_line_writer.h b/src/common/windows/pdb_source_line_writer.h
index e9e89bb2..5a8bcbe7 100644
--- a/src/common/windows/pdb_source_line_writer.h
+++ b/src/common/windows/pdb_source_line_writer.h
@@ -92,7 +92,9 @@ class PDBSourceLineWriter {
ANY_FILE // try PDB_FILE and then EXE_FILE
};
- explicit PDBSourceLineWriter();
+ // NB: |enable_multiple_field| is temporary while transitioning to enabling
+ // writing the multiple field permanently.
+ explicit PDBSourceLineWriter(bool enable_multiple_field = false);
~PDBSourceLineWriter();
// Opens the given file. For executable files, the corresponding pdb
@@ -138,11 +140,12 @@ class PDBSourceLineWriter {
bool PrintLines(IDiaEnumLineNumbers *lines);
// Outputs a function address and name, followed by its source line list.
- // block can be the same object as function, or it can be a reference
- // to a code block that is lexically part of this function, but
- // resides at a separate address.
- // Returns true on success.
- bool PrintFunction(IDiaSymbol *function, IDiaSymbol *block);
+ // block can be the same object as function, or it can be a reference to a
+ // code block that is lexically part of this function, but resides at a
+ // separate address. If has_multiple_symbols is true, this function's
+ // instructions correspond to multiple symbols. Returns true on success.
+ bool PrintFunction(IDiaSymbol *function, IDiaSymbol *block,
+ bool has_multiple_symbols);
// Outputs all functions as described above. Returns true on success.
bool PrintFunctions();
@@ -167,8 +170,10 @@ class PDBSourceLineWriter {
// Outputs a single public symbol address and name, if the symbol corresponds
// to a code address. Returns true on success. If symbol is does not
- // correspond to code, returns true without outputting anything.
- bool PrintCodePublicSymbol(IDiaSymbol *symbol);
+ // correspond to code, returns true without outputting anything. If
+ // has_multiple_symbols is true, the symbol corresponds to a code address and
+ // the instructions correspond to multiple symbols.
+ bool PrintCodePublicSymbol(IDiaSymbol *symbol, bool has_multiple_symbols);
// Outputs a line identifying the PDB file that is being dumped, along with
// its uuid and age.
@@ -227,6 +232,10 @@ class PDBSourceLineWriter {
// a failure, returns 0, which is also a valid number of bytes.
static int GetFunctionStackParamSize(IDiaSymbol *function);
+ // True if the optional 'm' field on FUNC and PUBLIC for multiple symbols at
+ // the same address should be output.
+ bool enable_multiple_field_;
+
// The filename of the PE file corresponding to the currently-open
// pdb file.
wstring code_file_;