mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-12-23 10:35:30 +00:00
Breakpad DWARF Reader: Also look for DWARF in sections with the proper names.
The DWARF specification specifices which names the sections containing DWARF information should have. OSX uses slightly different names. This patch changes the DWARF reader to look for the sections under both sets of names. a=jimblandy, r=ccoutant git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@493 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
f4a106d4b5
commit
e15bffe466
|
@ -79,8 +79,12 @@ void CompilationUnit::ReadAbbrevs() {
|
|||
if (abbrevs_)
|
||||
return;
|
||||
|
||||
// First get the debug_abbrev section
|
||||
SectionMap::const_iterator iter = sections_.find("__debug_abbrev");
|
||||
// First get the debug_abbrev section. ".debug_abbrev" is the name
|
||||
// recommended in the DWARF spec, and used on Linux;
|
||||
// "__debug_abbrev" is the name used in Mac OS X Mach-O files.
|
||||
SectionMap::const_iterator iter = sections_.find(".debug_abbrev");
|
||||
if (iter == sections_.end())
|
||||
iter = sections_.find("__debug_abbrev");
|
||||
assert(iter != sections_.end());
|
||||
|
||||
abbrevs_ = new vector<Abbrev>;
|
||||
|
@ -267,8 +271,12 @@ void CompilationUnit::ReadHeader() {
|
|||
}
|
||||
|
||||
uint64 CompilationUnit::Start() {
|
||||
// First get the debug_info section
|
||||
SectionMap::const_iterator iter = sections_.find("__debug_info");
|
||||
// First get the debug_info section. ".debug_info" is the name
|
||||
// recommended in the DWARF spec, and used on Linux; "__debug_info"
|
||||
// is the name used in Mac OS X Mach-O files.
|
||||
SectionMap::const_iterator iter = sections_.find(".debug_info");
|
||||
if (iter == sections_.end())
|
||||
iter = sections_.find("__debug_info");
|
||||
assert(iter != sections_.end());
|
||||
|
||||
// Set up our buffer
|
||||
|
@ -298,8 +306,12 @@ uint64 CompilationUnit::Start() {
|
|||
// Otherwise, continue by reading our abbreviation entries.
|
||||
ReadAbbrevs();
|
||||
|
||||
// Set the string section if we have one.
|
||||
iter = sections_.find("__debug_str");
|
||||
// Set the string section if we have one. ".debug_str" is the name
|
||||
// recommended in the DWARF spec, and used on Linux; "__debug_str"
|
||||
// is the name used in Mac OS X Mach-O files.
|
||||
iter = sections_.find(".debug_str");
|
||||
if (iter == sections_.end())
|
||||
iter = sections_.find("__debug_str");
|
||||
if (iter != sections_.end()) {
|
||||
string_buffer_ = iter->second.first;
|
||||
string_buffer_length_ = iter->second.second;
|
||||
|
|
Loading…
Reference in a new issue