mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2025-07-04 15:18:26 +00:00
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:
parent
23ad65d54a
commit
897a12cd26
|
@ -219,8 +219,7 @@ bool CreateDiaDataSourceInstance(CComPtr<IDiaDataSource> &data_source) {
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
PDBSourceLineWriter::PDBSourceLineWriter(bool enable_multiple_field)
|
PDBSourceLineWriter::PDBSourceLineWriter() : output_(NULL) {
|
||||||
: enable_multiple_field_(enable_multiple_field), output_(NULL) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PDBSourceLineWriter::~PDBSourceLineWriter() {
|
PDBSourceLineWriter::~PDBSourceLineWriter() {
|
||||||
|
@ -373,8 +372,7 @@ bool PDBSourceLineWriter::PrintFunction(IDiaSymbol *function,
|
||||||
MapAddressRange(image_map_, AddressRange(rva, static_cast<DWORD>(length)),
|
MapAddressRange(image_map_, AddressRange(rva, static_cast<DWORD>(length)),
|
||||||
&ranges);
|
&ranges);
|
||||||
for (size_t i = 0; i < ranges.size(); ++i) {
|
for (size_t i = 0; i < ranges.size(); ++i) {
|
||||||
const char* optional_multiple_field =
|
const char* optional_multiple_field = has_multiple_symbols ? "m " : "";
|
||||||
enable_multiple_field_ && has_multiple_symbols ? "m " : "";
|
|
||||||
fprintf(output_, "FUNC %s%lx %lx %x %ws\n", optional_multiple_field,
|
fprintf(output_, "FUNC %s%lx %lx %x %ws\n", optional_multiple_field,
|
||||||
ranges[i].rva, ranges[i].length, stack_param_size, name.m_str);
|
ranges[i].rva, ranges[i].length, stack_param_size, name.m_str);
|
||||||
}
|
}
|
||||||
|
@ -891,8 +889,7 @@ bool PDBSourceLineWriter::PrintCodePublicSymbol(IDiaSymbol *symbol,
|
||||||
AddressRangeVector ranges;
|
AddressRangeVector ranges;
|
||||||
MapAddressRange(image_map_, AddressRange(rva, 1), &ranges);
|
MapAddressRange(image_map_, AddressRange(rva, 1), &ranges);
|
||||||
for (size_t i = 0; i < ranges.size(); ++i) {
|
for (size_t i = 0; i < ranges.size(); ++i) {
|
||||||
const char* optional_multiple_field =
|
const char* optional_multiple_field = has_multiple_symbols ? "m " : "";
|
||||||
enable_multiple_field_ && has_multiple_symbols ? "m " : "";
|
|
||||||
fprintf(output_, "PUBLIC %s%lx %x %ws\n", optional_multiple_field,
|
fprintf(output_, "PUBLIC %s%lx %x %ws\n", optional_multiple_field,
|
||||||
ranges[i].rva, stack_param_size > 0 ? stack_param_size : 0,
|
ranges[i].rva, stack_param_size > 0 ? stack_param_size : 0,
|
||||||
name.m_str);
|
name.m_str);
|
||||||
|
|
|
@ -92,9 +92,7 @@ class PDBSourceLineWriter {
|
||||||
ANY_FILE // try PDB_FILE and then EXE_FILE
|
ANY_FILE // try PDB_FILE and then EXE_FILE
|
||||||
};
|
};
|
||||||
|
|
||||||
// NB: |enable_multiple_field| is temporary while transitioning to enabling
|
explicit PDBSourceLineWriter();
|
||||||
// writing the multiple field permanently.
|
|
||||||
explicit PDBSourceLineWriter(bool enable_multiple_field = false);
|
|
||||||
~PDBSourceLineWriter();
|
~PDBSourceLineWriter();
|
||||||
|
|
||||||
// Opens the given file. For executable files, the corresponding pdb
|
// 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.
|
// a failure, returns 0, which is also a valid number of bytes.
|
||||||
static int GetFunctionStackParamSize(IDiaSymbol *function);
|
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
|
// The filename of the PE file corresponding to the currently-open
|
||||||
// pdb file.
|
// pdb file.
|
||||||
wstring code_file_;
|
wstring code_file_;
|
||||||
|
|
|
@ -42,22 +42,12 @@ using google_breakpad::PDBSourceLineWriter;
|
||||||
|
|
||||||
int wmain(int argc, wchar_t **argv) {
|
int wmain(int argc, wchar_t **argv) {
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
fprintf(stderr,
|
fprintf(stderr, "Usage: %ws <file.[pdb|exe|dll]>\n", argv[0]);
|
||||||
"Usage: %ws [--enable_multiple_field] <file.[pdb|exe|dll]>\n",
|
|
||||||
argv[0]);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a temporary option to enable writing the optional 'm' field on FUNC
|
PDBSourceLineWriter writer;
|
||||||
// and PUBLIC, denoting multiple symbols for the address. This option will be
|
if (!writer.Open(wstring(argv[1]), PDBSourceLineWriter::ANY_FILE)) {
|
||||||
// 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");
|
fprintf(stderr, "Open failed\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1958,7 +1958,7 @@ FUNC 4515 84 0 _local_unwind2
|
||||||
FUNC 4599 23 0 _abnormal_termination
|
FUNC 4599 23 0 _abnormal_termination
|
||||||
FUNC 45bc 9 0 _NLG_Notify1
|
FUNC 45bc 9 0 _NLG_Notify1
|
||||||
FUNC 45c5 1f 0 _NLG_Notify
|
FUNC 45c5 1f 0 _NLG_Notify
|
||||||
PUBLIC 45dc 0 _NLG_Dispatch
|
PUBLIC m 45dc 0 _NLG_Dispatch
|
||||||
FUNC 45e4 3 0 _NLG_Call
|
FUNC 45e4 3 0 _NLG_Call
|
||||||
PUBLIC 45e6 0 _NLG_Return2
|
PUBLIC 45e6 0 _NLG_Return2
|
||||||
FUNC 45e7 33 0 abort
|
FUNC 45e7 33 0 abort
|
||||||
|
|
|
@ -2809,7 +2809,7 @@ FUNC 67c0 84 0 _local_unwind2
|
||||||
FUNC 6844 23 0 _abnormal_termination
|
FUNC 6844 23 0 _abnormal_termination
|
||||||
FUNC 6867 9 0 _NLG_Notify1
|
FUNC 6867 9 0 _NLG_Notify1
|
||||||
FUNC 6870 1f 0 _NLG_Notify
|
FUNC 6870 1f 0 _NLG_Notify
|
||||||
PUBLIC 6887 0 _NLG_Dispatch
|
PUBLIC m 6887 0 _NLG_Dispatch
|
||||||
FUNC 688f 3 0 _NLG_Call
|
FUNC 688f 3 0 _NLG_Call
|
||||||
PUBLIC 6891 0 _NLG_Return2
|
PUBLIC 6891 0 _NLG_Return2
|
||||||
FUNC 4695 33 0 abort
|
FUNC 4695 33 0 abort
|
||||||
|
|
|
@ -1958,7 +1958,7 @@ FUNC 293c 84 0 _local_unwind2
|
||||||
FUNC 29c0 23 0 _abnormal_termination
|
FUNC 29c0 23 0 _abnormal_termination
|
||||||
FUNC 29e3 9 0 _NLG_Notify1
|
FUNC 29e3 9 0 _NLG_Notify1
|
||||||
FUNC 29ec 1f 0 _NLG_Notify
|
FUNC 29ec 1f 0 _NLG_Notify
|
||||||
PUBLIC 2a03 0 _NLG_Dispatch
|
PUBLIC m 2a03 0 _NLG_Dispatch
|
||||||
FUNC 2a0b 3 0 _NLG_Call
|
FUNC 2a0b 3 0 _NLG_Call
|
||||||
PUBLIC 2a0d 0 _NLG_Return2
|
PUBLIC 2a0d 0 _NLG_Return2
|
||||||
FUNC 2862 33 0 abort
|
FUNC 2862 33 0 abort
|
||||||
|
|
|
@ -2067,7 +2067,7 @@ FUNC 5263 84 0 _local_unwind2
|
||||||
FUNC 52e7 23 0 _abnormal_termination
|
FUNC 52e7 23 0 _abnormal_termination
|
||||||
FUNC 530a 9 0 _NLG_Notify1
|
FUNC 530a 9 0 _NLG_Notify1
|
||||||
FUNC 5313 1f 0 _NLG_Notify
|
FUNC 5313 1f 0 _NLG_Notify
|
||||||
PUBLIC 532a 0 _NLG_Dispatch
|
PUBLIC m 532a 0 _NLG_Dispatch
|
||||||
FUNC 5332 3 0 _NLG_Call
|
FUNC 5332 3 0 _NLG_Call
|
||||||
PUBLIC 5334 0 _NLG_Return2
|
PUBLIC 5334 0 _NLG_Return2
|
||||||
FUNC 5335 33 0 abort
|
FUNC 5335 33 0 abort
|
||||||
|
|
|
@ -1958,7 +1958,7 @@ FUNC 5263 84 0 _local_unwind2
|
||||||
FUNC 52e7 23 0 _abnormal_termination
|
FUNC 52e7 23 0 _abnormal_termination
|
||||||
FUNC 530a 9 0 _NLG_Notify1
|
FUNC 530a 9 0 _NLG_Notify1
|
||||||
FUNC 5313 1f 0 _NLG_Notify
|
FUNC 5313 1f 0 _NLG_Notify
|
||||||
PUBLIC 532a 0 _NLG_Dispatch
|
PUBLIC m 532a 0 _NLG_Dispatch
|
||||||
FUNC 5332 3 0 _NLG_Call
|
FUNC 5332 3 0 _NLG_Call
|
||||||
PUBLIC 5334 0 _NLG_Return2
|
PUBLIC 5334 0 _NLG_Return2
|
||||||
FUNC 5335 33 0 abort
|
FUNC 5335 33 0 abort
|
||||||
|
|
Loading…
Reference in a new issue