Allow building symbol dumping without STABS support

R=mark at https://breakpad.appspot.com/536002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1125 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
ted.mielczarek@gmail.com 2013-03-06 15:33:02 +00:00
parent 983903ee0a
commit 718ae3284e

View File

@ -63,8 +63,10 @@
#include "common/linux/file_id.h" #include "common/linux/file_id.h"
#include "common/module.h" #include "common/module.h"
#include "common/scoped_ptr.h" #include "common/scoped_ptr.h"
#ifndef NO_STABS_SUPPORT
#include "common/stabs_reader.h" #include "common/stabs_reader.h"
#include "common/stabs_to_module.h" #include "common/stabs_to_module.h"
#endif
#include "common/using_std_string.h" #include "common/using_std_string.h"
// This namespace contains helper functions. // This namespace contains helper functions.
@ -80,7 +82,9 @@ using google_breakpad::FindElfSectionByName;
using google_breakpad::GetOffset; using google_breakpad::GetOffset;
using google_breakpad::IsValidElf; using google_breakpad::IsValidElf;
using google_breakpad::Module; using google_breakpad::Module;
#ifndef NO_STABS_SUPPORT
using google_breakpad::StabsToModule; using google_breakpad::StabsToModule;
#endif
using google_breakpad::scoped_ptr; using google_breakpad::scoped_ptr;
// //
@ -158,6 +162,7 @@ typename ElfClass::Addr GetLoadingAddress(
return 0; return 0;
} }
#ifndef NO_STABS_SUPPORT
template<typename ElfClass> template<typename ElfClass>
bool LoadStabs(const typename ElfClass::Ehdr* elf_header, bool LoadStabs(const typename ElfClass::Ehdr* elf_header,
const typename ElfClass::Shdr* stab_section, const typename ElfClass::Shdr* stab_section,
@ -183,6 +188,7 @@ bool LoadStabs(const typename ElfClass::Ehdr* elf_header,
handler.Finalize(); handler.Finalize();
return true; return true;
} }
#endif // NO_STABS_SUPPORT
// A line-to-module loader that accepts line number info parsed by // A line-to-module loader that accepts line number info parsed by
// dwarf2reader::LineInfo and populates a Module and a line vector // dwarf2reader::LineInfo and populates a Module and a line vector
@ -537,6 +543,7 @@ bool LoadSymbols(const string& obj_file,
bool found_usable_info = false; bool found_usable_info = false;
if (symbol_data != ONLY_CFI) { if (symbol_data != ONLY_CFI) {
#ifndef NO_STABS_SUPPORT
// Look for STABS debugging information, and load it if present. // Look for STABS debugging information, and load it if present.
const Shdr* stab_section = const Shdr* stab_section =
FindElfSectionByName<ElfClass>(".stab", SHT_PROGBITS, FindElfSectionByName<ElfClass>(".stab", SHT_PROGBITS,
@ -555,6 +562,7 @@ bool LoadSymbols(const string& obj_file,
} }
} }
} }
#endif // NO_STABS_SUPPORT
// Look for DWARF debugging information, and load it if present. // Look for DWARF debugging information, and load it if present.
const Shdr* dwarf_section = const Shdr* dwarf_section =