Write field indicating multiple symbols at an address in dump_syms

Updates dump_syms to write the optional 'm' first field in FUNCTION and
PUBLIC records to indicate that the address corresponds to more than one
symbol.

Bug: google-breakpad:751
Change-Id: I850b0122324ed5f9ec747aa92ba354a3126a7ef9
Reviewed-on: https://chromium-review.googlesource.com/820711
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Mike Wittman 2017-12-11 13:50:41 -08:00 committed by Mark Mentovai
parent 23ad65d54a
commit 897a12cd26
8 changed files with 12 additions and 31 deletions

View file

@ -219,8 +219,7 @@ bool CreateDiaDataSourceInstance(CComPtr<IDiaDataSource> &data_source) {
} // namespace
PDBSourceLineWriter::PDBSourceLineWriter(bool enable_multiple_field)
: enable_multiple_field_(enable_multiple_field), output_(NULL) {
PDBSourceLineWriter::PDBSourceLineWriter() : output_(NULL) {
}
PDBSourceLineWriter::~PDBSourceLineWriter() {
@ -373,8 +372,7 @@ bool PDBSourceLineWriter::PrintFunction(IDiaSymbol *function,
MapAddressRange(image_map_, AddressRange(rva, static_cast<DWORD>(length)),
&ranges);
for (size_t i = 0; i < ranges.size(); ++i) {
const char* optional_multiple_field =
enable_multiple_field_ && has_multiple_symbols ? "m " : "";
const char* optional_multiple_field = has_multiple_symbols ? "m " : "";
fprintf(output_, "FUNC %s%lx %lx %x %ws\n", optional_multiple_field,
ranges[i].rva, ranges[i].length, stack_param_size, name.m_str);
}
@ -891,8 +889,7 @@ bool PDBSourceLineWriter::PrintCodePublicSymbol(IDiaSymbol *symbol,
AddressRangeVector ranges;
MapAddressRange(image_map_, AddressRange(rva, 1), &ranges);
for (size_t i = 0; i < ranges.size(); ++i) {
const char* optional_multiple_field =
enable_multiple_field_ && has_multiple_symbols ? "m " : "";
const char* optional_multiple_field = has_multiple_symbols ? "m " : "";
fprintf(output_, "PUBLIC %s%lx %x %ws\n", optional_multiple_field,
ranges[i].rva, stack_param_size > 0 ? stack_param_size : 0,
name.m_str);

View file

@ -92,9 +92,7 @@ class PDBSourceLineWriter {
ANY_FILE // try PDB_FILE and then EXE_FILE
};
// NB: |enable_multiple_field| is temporary while transitioning to enabling
// writing the multiple field permanently.
explicit PDBSourceLineWriter(bool enable_multiple_field = false);
explicit PDBSourceLineWriter();
~PDBSourceLineWriter();
// Opens the given file. For executable files, the corresponding pdb
@ -232,10 +230,6 @@ 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_;